noredink-ui/script/percy-tests.js

76 lines
2.3 KiB
JavaScript
Raw Normal View History

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:06:32 +03:00
//
// await page.evaluate (() => {
// let categories = Array.from(document.querySelectorAll('#categories a'))
// console.log(categories)
// console.log('test')
// })
2019-11-15 19:00:31 +03:00
await page.goto('http://localhost:8000/#category/Animations')
await page.waitFor('#animations')
2019-11-15 19:00:31 +03:00
await percySnapshot('Animations')
await page.goto('http://localhost:8000/#category/Buttons')
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')
await page.waitFor('#colors')
2019-11-15 19:00:31 +03:00
await percySnapshot('Colors')
await page.goto('http://localhost:8000/#category/Icons')
await page.waitFor('#icons')
2019-11-15 19:00:31 +03:00
await percySnapshot('Icons')
await page.goto('http://localhost:8000/#category/Inputs')
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')
await page.waitFor('#layout')
2019-11-15 19:00:31 +03:00
await percySnapshot('Layout')
await page.goto('http://localhost:8000/#category/Modals')
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')
await page.waitFor('#error-pages')
2019-11-15 19:00:31 +03:00
await percySnapshot('Pages')
await page.goto('http://localhost:8000/#category/Tables')
await page.waitFor('#tables')
2019-11-15 19:00:31 +03:00
await percySnapshot('Tables')
await page.goto('http://localhost:8000/#category/Text')
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')
await page.waitFor('#widgets')
2019-11-15 19:00:31 +03:00
await percySnapshot('Widgets')
await page.goto('http://localhost:8000/#category/Messaging')
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
})