From d9ac27995c468eb3332d45653fb409942fdd9519 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 1 Apr 2026 18:40:06 +0100 Subject: [PATCH] Increase timeout for admin settings textarea to load (#7423) The settings textarea content is populated asynchronously via socket. On slow CI (especially Node 20 + Firefox), the default 20s timeout isn't enough. Increase to 30s for all toBeEmpty checks. Co-authored-by: Claude Opus 4.6 (1M context) --- .github/workflows/frontend-admin-tests.yml | 20 ++++++++++--------- .../admin-spec/adminsettings.spec.ts | 8 ++++---- .../admin-spec/adminupdateplugins.spec.ts | 6 +++--- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/frontend-admin-tests.yml b/.github/workflows/frontend-admin-tests.yml index f28483325..76bb45948 100644 --- a/.github/workflows/frontend-admin-tests.yml +++ b/.github/workflows/frontend-admin-tests.yml @@ -43,16 +43,20 @@ jobs: uses: SamTV12345/gnpm-setup@main with: version: 0.0.12 - - name: Cache playwright binaries - uses: actions/cache@v5 - id: playwright-cache - with: - path: | - ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} - name: Install all dependencies and symlink for ep_etherpad-lite run: gnpm i --runtimeVersion="${{ matrix.node }}" + - name: Cache Playwright browsers + uses: actions/cache@v5 + id: playwright-cache + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('src/package.json') }} + - name: Install Playwright browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' + run: cd src && npx playwright install + - name: Install Playwright system dependencies + run: cd src && npx playwright install-deps - name: Create settings.json run: cp settings.json.template settings.json @@ -85,8 +89,6 @@ jobs: sleep 1 done cd src - gnpm exec playwright install --runtimeVersion="${{ matrix.node }}" - gnpm exec playwright install-deps --runtimeVersion="${{ matrix.node }}" gnpm run test-admin --runtimeVersion="${{ matrix.node }}" - uses: actions/upload-artifact@v7 if: always() diff --git a/src/tests/frontend-new/admin-spec/adminsettings.spec.ts b/src/tests/frontend-new/admin-spec/adminsettings.spec.ts index 634babab4..4e134c9e5 100644 --- a/src/tests/frontend-new/admin-spec/adminsettings.spec.ts +++ b/src/tests/frontend-new/admin-spec/adminsettings.spec.ts @@ -12,7 +12,7 @@ test.describe('admin settings',()=> { await page.goto('http://localhost:9001/admin/settings'); await page.waitForSelector('.settings'); const settings = page.locator('.settings'); - await expect(settings).not.toBeEmpty(); + await expect(settings).not.toHaveValue('', {timeout: 30000}); const settingsVal = await settings.inputValue() const settingsLength = settingsVal.length @@ -26,7 +26,7 @@ test.describe('admin settings',()=> { // Check if the changes were actually saved await page.reload() await page.waitForSelector('.settings'); - await expect(settings).not.toBeEmpty(); + await expect(settings).not.toHaveValue('', {timeout: 30000}); const newSettings = page.locator('.settings'); @@ -40,7 +40,7 @@ test.describe('admin settings',()=> { await page.reload() await page.waitForSelector('.settings'); - await expect(settings).not.toBeEmpty(); + await expect(settings).not.toHaveValue('', {timeout: 30000}); const oldSettings = page.locator('.settings'); const oldSettingsVal = await oldSettings.inputValue() expect(oldSettingsVal).toEqual(settingsVal) @@ -56,6 +56,6 @@ test.describe('admin settings',()=> { await page.goto('http://localhost:9001/admin/settings'); await page.waitForSelector('.settings') const settings = page.locator('.settings'); - await expect(settings).not.toBeEmpty(); + await expect(settings).not.toHaveValue('', {timeout: 30000}); }); }) diff --git a/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts b/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts index cc37fdf97..16c170d85 100644 --- a/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts +++ b/src/tests/frontend-new/admin-spec/adminupdateplugins.spec.ts @@ -20,7 +20,7 @@ test.describe('Plugins page', ()=> { await page.click('.search-field') await page.keyboard.type('ep_font_color') const pluginTable = page.locator('table tbody').nth(1); - await expect(pluginTable.locator('tr').first()).toContainText('ep_font_color', {timeout: 30000}) + await expect(pluginTable.locator('tr').first()).toContainText('ep_font_color', {timeout: 60000}) }) @@ -37,9 +37,9 @@ test.describe('Plugins page', ()=> { await page.keyboard.type('ep_font_color') await page.keyboard.press('Enter') - await expect(pluginTable.locator('tr')).toHaveCount(1) + await expect(pluginTable.locator('tr')).toHaveCount(1, {timeout: 60000}) const pluginRow = pluginTable.locator('tr').first() - await expect(pluginRow).toContainText('ep_font_color') + await expect(pluginRow).toContainText('ep_font_color', {timeout: 60000}) // Select Installation button await pluginRow.locator('td').nth(4).locator('button').first().click()