Skip to content

Commit

Permalink
use locator instead of DOM manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbarna committed Jul 15, 2024
1 parent e069102 commit 35ff0c9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions __playwright__/circulars/archive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ test.describe('Circulars archive page', () => {
test('search finds results that contain exact string but not similar strings', async ({
page,
}) => {
// this highlights the search returns limited results because it is looking for exact matches to the string
// this should return many more results and include strings like 230812B
// This highlights the search returns limited results because it is looking for exact matches to the string
// This should return many more results and include strings like 230812B
await page.goto('/circulars?query=230812')
await page.waitForFunction(
(n) =>
document.getElementsByTagName('ol')[0].getElementsByTagName('li')
.length === n,
1
)
const orderedListLocator = page.locator('ol')
const listItemLocator = orderedListLocator.locator('li')

await expect(listItemLocator).toHaveCount(1)
})
})

0 comments on commit 35ff0c9

Please sign in to comment.