noredink-ui/script/percy-tests.js

52 lines
1.7 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-15 16:37:27 +03:00
await page.goto('http://localhost:8000/')
2019-11-15 14:16:10 +03:00
// ensure the page has loaded before capturing a snapshot
2019-11-15 18:59:49 +03:00
await page.waitFor('#categories')
2019-11-15 16:58:00 +03:00
2019-11-15 19:00:31 +03:00
await page.goto('http://localhost:8000/#category/Animations')
await percySnapshot('Animations')
await page.goto('http://localhost:8000/#category/Buttons')
await percySnapshot('Buttons')
await page.goto('http://localhost:8000/#category/Colors')
await percySnapshot('Colors')
await page.goto('http://localhost:8000/#category/Icons')
await percySnapshot('Icons')
await page.goto('http://localhost:8000/#category/Inputs')
await percySnapshot('Inputs Unchecked')
2019-11-15 19:00:51 +03:00
await page.click('[for="styleguide-checkbox-interactable"]')
await percySnapshot('Inputs Checked')
2019-11-15 19:00:31 +03:00
await page.goto('http://localhost:8000/#category/Layout')
await percySnapshot('Layout')
await page.goto('http://localhost:8000/#category/Modals')
await percySnapshot('Modals')
2019-11-15 19:00:41 +03:00
await page.click('#launch-info-modal')
await percySnapshot('Full Info Modal')
await page.click('[aria-label="Close modal"]')
await page.click('#launch-warning-modal')
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 percySnapshot('Pages')
await page.goto('http://localhost:8000/#category/Tables')
await percySnapshot('Tables')
await page.goto('http://localhost:8000/#category/Text')
await percySnapshot('Text')
await page.goto('http://localhost:8000/#category/Widgets')
await percySnapshot('Widgets')
await page.goto('http://localhost:8000/#category/Messaging')
await percySnapshot('Messaging')
2019-11-15 14:16:10 +03:00
})