2019-11-15 14:16:10 +03:00
|
|
|
const PercyScript = require('@percy/script')
|
|
|
|
|
|
|
|
PercyScript.run(async (page, percySnapshot) => {
|
2019-11-27 14:40:29 +03:00
|
|
|
await page.goto('http://localhost:8000')
|
2019-11-27 15:06:32 +03:00
|
|
|
await page.waitFor('#categories').then(x => {
|
|
|
|
console.log(x)
|
|
|
|
const categories = Array.from(document.querySelectorAll('#categories a'))
|
2019-11-27 14:43:41 +03:00
|
|
|
console.log(categories)
|
|
|
|
})
|
2019-11-27 14:40:29 +03:00
|
|
|
|
2019-11-27 15:15:39 +03:00
|
|
|
const homepage = await page.evaluate (() => {
|
2019-11-27 15:12:20 +03:00
|
|
|
let categories = Array.from(document.querySelectorAll('#categories a'))
|
|
|
|
console.log(categories)
|
|
|
|
console.log('test')
|
|
|
|
})
|
2019-11-27 15:06:32 +03:00
|
|
|
|
|
|
|
|
2019-11-15 19:00:31 +03:00
|
|
|
await page.goto('http://localhost:8000/#category/Animations')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#animations')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Animations')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Buttons')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#buttons-and-links')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Buttons')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Colors')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#colors')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Colors')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Icons')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#icons')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Icons')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Inputs')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#inputs')
|
2019-11-15 19:06:19 +03:00
|
|
|
await percySnapshot('Inputs')
|
2019-11-15 19:00:31 +03:00
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Layout')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#layout')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Layout')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Modals')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#modals')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Modals')
|
2019-11-15 19:00:41 +03:00
|
|
|
await page.click('#launch-info-modal')
|
2019-11-19 13:56:39 +03:00
|
|
|
await page.waitFor('[role="dialog"]')
|
2019-11-15 19:00:41 +03:00
|
|
|
await percySnapshot('Full Info Modal')
|
|
|
|
await page.click('[aria-label="Close modal"]')
|
|
|
|
await page.click('#launch-warning-modal')
|
2019-11-19 13:56:39 +03:00
|
|
|
await page.waitFor('[role="dialog"]')
|
2019-11-15 19:00:41 +03:00
|
|
|
await percySnapshot('Full Warning Modal')
|
|
|
|
await page.click('[aria-label="Close modal"]')
|
2019-11-15 19:00:31 +03:00
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Pages')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#error-pages')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Pages')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Tables')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#tables')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Tables')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Text')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#text-and-fonts')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Text')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Widgets')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#widgets')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Widgets')
|
|
|
|
|
|
|
|
await page.goto('http://localhost:8000/#category/Messaging')
|
2019-11-20 17:48:47 +03:00
|
|
|
await page.waitFor('#alerts-and-messages')
|
2019-11-15 19:00:31 +03:00
|
|
|
await percySnapshot('Messaging')
|
2019-11-15 14:16:10 +03:00
|
|
|
})
|