Skip to content

Instantly share code, notes, and snippets.

@angiejones
Created September 11, 2020 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angiejones/87deb80d49c7dacbaf31e1fe5e4be25a to your computer and use it in GitHub Desktop.
Save angiejones/87deb80d49c7dacbaf31e1fe5e4be25a to your computer and use it in GitHub Desktop.
Playwright - accessing children nodes
it('should return one book when exact title is given', async () => {
await page.fill('#searchBar', 'Agile Testing')
await page.waitForSelector('li.ui-screen-hidden', { state: 'attached' })
const visibleBooksSelector = 'li:not(.ui-screen-hidden)'
const visibleBooks = await page.$$(visibleBooksSelector)
assert.equal(visibleBooks.length, 1)
assert.equal(await page.innerText(visibleBooksSelector + ' >> h2'), 'Agile Testing')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment