Skip to content

Commit

Permalink
Fix filter test for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
MTRNord committed Mar 1, 2025
1 parent 602f852 commit 6f0eb05
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default defineConfig({

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',

launchOptions: {
args: ["--window-size=1280,720"],
}
},

/* Configure projects for major browsers */
Expand Down
13 changes: 10 additions & 3 deletions tests/filters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ test('can select filters on ecosystem pages', async ({ page }) => {
const allButton = page.getByRole('button', { name: 'all' })
await allButton.scrollIntoViewIfNeeded()
await allButton.click()
await page.locator("#filter-platform").click()
// Firefox somehow is very odd?! It doesn't click the button on the first try
await page.locator("#filter-platform").click({ clickCount: 2 })
await expect(page.locator("#filters-overlay")).toBeHidden()
await expect(page.locator("#filter-platform-menu")).toBeHidden()

const clients = await page.locator("#all-clients").all()
for (const client of clients) {
await expect(client).toBeHidden()
}

await page.locator("#filter-platform").click()
await page.getByRole('button', { name: 'none' }).click()
// Firefox tries to skip it?!
await page.locator("#filter-platform").click({ force: true })
const noneButton = page.getByRole('button', { name: 'none' })
await noneButton.scrollIntoViewIfNeeded()
await noneButton.click()
await page.locator("#filter-platform").click()
for (const client of clients) {
await expect(client).toBeVisible()
Expand Down

0 comments on commit 6f0eb05

Please sign in to comment.