use evaluate

This commit is contained in:
Matt Charlton 2019-11-27 11:52:26 +00:00
parent 919d2a0c93
commit 6ab3da9055

View File

@ -2,12 +2,11 @@ const PercyScript = require('@percy/script')
PercyScript.run(async (page, percySnapshot) => {
await page.goto('http://localhost:8000')
await page.waitFor('#categories').then(() => {
const categories = document.querySelectorAll('#categories li')
await page.waitFor('#categories')
await page.evaluate (() => {
let categories = Array.from(document.querySelectorAll('#categories a'))
console.log(categories)
})
await page.goto('http://localhost:8000/#category/Animations')