go to each url and capture

This commit is contained in:
Matt Charlton 2019-11-15 14:14:27 +00:00
parent 056a67ba9c
commit 651f96b2fd

View File

@ -5,10 +5,28 @@ PercyScript.run(async (page, percySnapshot) => {
// ensure the page has loaded before capturing a snapshot
await page.waitFor('.module-example__Nri-Ui-Alert-V4')
await page.evaluate ((percySnapshot) => {
let categories = Array.from(document.querySelectorAll('#categories a'))
for (let category of categories)
category.click()
percySnapshot(category.innerText)
})
await page.goto('http://localhost:8000/#category/Animations')
percySnapshot('Animations')
await page.goto('http://localhost:8000/#category/Buttons')
percySnapshot('Buttons')
await page.goto('http://localhost:8000/#category/Colors')
percySnapshot('Colors')
await page.goto('http://localhost:8000/#category/Icons')
percySnapshot('Icons')
await page.goto('http://localhost:8000/#category/Inputs')
percySnapshot('Inputs')
await page.goto('http://localhost:8000/#category/Layout')
percySnapshot('Layout')
await page.goto('http://localhost:8000/#category/Modals')
percySnapshot('Modals')
await page.goto('http://localhost:8000/#category/Pages')
percySnapshot('Pages')
await page.goto('http://localhost:8000/#category/Tables')
percySnapshot('Tables')
await page.goto('http://localhost:8000/#category/Text')
percySnapshot('Text')
await page.goto('http://localhost:8000/#category/Widgets')
percySnapshot('Widgets')
await page.goto('http://localhost:8000/#category/Messaging')
percySnapshot('Messaging')
})