diff --git a/.gitignore b/.gitignore index 8a6e555b56..7cf9712c59 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ .pnpm-store/ .scannerwork/ playwright-report/ +test-results/ # See http://help.github.com/ignore-files/ for more about ignoring files. .coveralls.yml diff --git a/apps/openchallenges/app/e2e/challenge-search-paginator.spec.ts b/apps/openchallenges/app/e2e/challenge-search-paginator.spec.ts index f205703f3c..cee25bcecd 100644 --- a/apps/openchallenges/app/e2e/challenge-search-paginator.spec.ts +++ b/apps/openchallenges/app/e2e/challenge-search-paginator.spec.ts @@ -1,8 +1,17 @@ import { test, expect } from '@playwright/test'; -test('reset page number when query input changes', async ({ page }) => { +test('paginator reset to page 1 on filter change', async ({ page }) => { + // Go to the challenge search page await page.goto('/challenge'); - - // dummy assertion - await expect(page.locator('h2')).toHaveText('Challenges'); + // Go to the second page + await page.getByRole('button', { name: '2' }).click(); + // Make a change to the challenge query input by selecting 'active' status + await page + .locator('div') + .filter({ hasText: /^Active$/ }) + .locator('div') + .nth(2) + .click(); + // Assert that the paginator page number has been reset to 1 + await expect(page.getByRole('button', { name: '1' })).toBeVisible(); }); diff --git a/apps/openchallenges/app/playwright.config.ts b/apps/openchallenges/app/playwright.config.ts index a80a120bd7..04fbf127ca 100644 --- a/apps/openchallenges/app/playwright.config.ts +++ b/apps/openchallenges/app/playwright.config.ts @@ -34,10 +34,10 @@ export default defineConfig({ name: 'Mobile Chrome', use: { ...devices['Pixel 5'] }, }, - { - name: 'Mobile Safari', - use: { ...devices['iPhone 12'] }, - }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, /* Test against branded browsers. */ // When Google Chrome and/or Microsoft Edge are installed in the dev container, Playwright will // use one of them to open the HTML report. These browsers are slow to open and respond because