-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26e2a50
commit 3dd71f0
Showing
11 changed files
with
1,462 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { RemoteBrowserTarget } = require('happo.io'); | ||
|
||
module.exports = { | ||
apiKey: process.env.HAPPO_API_KEY, | ||
apiSecret: process.env.HAPPO_API_SECRET, | ||
compareThreshold: 0.005, | ||
project: 'demo-playwright-test', | ||
targets: { | ||
chrome: new RemoteBrowserTarget('chrome', { | ||
viewport: '1440x900' | ||
}), | ||
firefox: new RemoteBrowserTarget('firefox', { | ||
viewport: '1440x900' | ||
}), | ||
safari: new RemoteBrowserTarget('safari', { | ||
viewport: '1440x900', | ||
scrollStitch: true | ||
}), | ||
iosSafari: new RemoteBrowserTarget('ios-safari', { | ||
viewport: '320x568' | ||
}), | ||
ipadSafari: new RemoteBrowserTarget('ipad-safari', { | ||
viewport: '1080x810' | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { injectAxe, checkA11y } = require('axe-playwright') | ||
|
||
const testA11y = async (page, context = undefined) => { | ||
await injectAxe(page) | ||
|
||
await checkA11y(page, context, { | ||
detailedReport: true | ||
}) | ||
} | ||
|
||
module.exports = { | ||
testA11y | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { test } = require('@playwright/test') | ||
const happoPlaywright = require('happo-playwright') | ||
|
||
test.describe('Login page', () => { | ||
let context, page | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
context = await browser.newContext() | ||
page = await context.newPage() | ||
await happoPlaywright.init(context) | ||
}) | ||
|
||
test.afterAll(async () => { | ||
await happoPlaywright.finish() | ||
}) | ||
|
||
test('has correct form layout', async () => { | ||
await page.goto('/login') | ||
|
||
const form = page.locator('form') | ||
|
||
await happoPlaywright.screenshot(page, form, { | ||
component: 'Login Form', | ||
variant: 'Default' | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { test } = require('@playwright/test') | ||
const happoPlaywright = require('happo-playwright') | ||
|
||
const { openHomepage } = require('../../lib/helpers') | ||
|
||
test.describe('Navbar', () => { | ||
let context, page | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
context = await browser.newContext() | ||
page = await context.newPage() | ||
await happoPlaywright.init(context) | ||
|
||
await openHomepage(page) | ||
}) | ||
|
||
test.afterAll(async () => { | ||
await happoPlaywright.finish() | ||
}) | ||
|
||
test('has correct layout', async () => { | ||
const form = page.locator('.navbar') | ||
|
||
await happoPlaywright.screenshot(page, form, { | ||
component: 'Navbar', | ||
variant: 'Default' | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.