Update e2e tests URLs to diff-samples (#149)
* Update e2e tests URLs to diff-samples, and darwin artefacts * Add linux snapshots * Add step test * Add missing linux stp snapshot * Fix consistency * Add missing linux step snapshot
@ -18,18 +18,22 @@ test('authorized popup page', async ({
|
|||||||
await expect(page.locator('button')).toHaveCount(2)
|
await expect(page.locator('button')).toHaveCount(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
async function getFirstDiffScreenshot(page: Page, url: string) {
|
async function getFirstDiffScreenshot(
|
||||||
|
page: Page,
|
||||||
|
url: string,
|
||||||
|
extension: string
|
||||||
|
) {
|
||||||
page.on('console', msg => console.log(msg.text()))
|
page.on('console', msg => console.log(msg.text()))
|
||||||
await page.goto(url)
|
await page.goto(url)
|
||||||
|
|
||||||
// waiting for the canvas (that holds the diff) to show up
|
// waiting for the canvas (that holds the diff) to show up
|
||||||
await page.waitForSelector(
|
await page.waitForSelector(
|
||||||
'.js-file[data-file-type=".obj"] .js-file-content canvas'
|
`.js-file[data-file-type=".${extension}"] .js-file-content canvas`
|
||||||
)
|
)
|
||||||
|
|
||||||
// screenshot the file diff with its toolbar
|
// screenshot the file diff with its toolbar
|
||||||
const element = await page.waitForSelector(
|
const element = await page.waitForSelector(
|
||||||
'.js-file[data-file-type=".obj"]'
|
`.js-file[data-file-type=".${extension}"]`
|
||||||
)
|
)
|
||||||
await page.waitForTimeout(1000) // making sure the element fully settled in
|
await page.waitForTimeout(1000) // making sure the element fully settled in
|
||||||
return await element.screenshot()
|
return await element.screenshot()
|
||||||
@ -39,17 +43,26 @@ test('pull request diff with an .obj file', async ({
|
|||||||
page,
|
page,
|
||||||
authorizedBackground,
|
authorizedBackground,
|
||||||
}) => {
|
}) => {
|
||||||
const url = 'https://github.com/KittyCAD/kittycad.ts/pull/3/files'
|
const url = 'https://github.com/KittyCAD/diff-samples/pull/2/files'
|
||||||
const screenshot = await getFirstDiffScreenshot(page, url)
|
const screenshot = await getFirstDiffScreenshot(page, url, 'obj')
|
||||||
expect(screenshot).toMatchSnapshot()
|
expect(screenshot).toMatchSnapshot()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('commit diff with an .obj file', async ({
|
test('pull request diff with a .step file', async ({
|
||||||
|
page,
|
||||||
|
authorizedBackground,
|
||||||
|
}) => {
|
||||||
|
const url = 'https://github.com/KittyCAD/diff-samples/pull/2/files'
|
||||||
|
const screenshot = await getFirstDiffScreenshot(page, url, 'step')
|
||||||
|
expect(screenshot).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('commit diff with a .step file', async ({
|
||||||
page,
|
page,
|
||||||
authorizedBackground,
|
authorizedBackground,
|
||||||
}) => {
|
}) => {
|
||||||
const url =
|
const url =
|
||||||
'https://github.com/KittyCAD/kittycad.ts/commit/08b50ee5a23b3ae7dd7b19383f14bbd520079cc1'
|
'https://github.com/KittyCAD/diff-samples/commit/fd9eec79f0464833686ea6b5b34ea07145e32734'
|
||||||
const screenshot = await getFirstDiffScreenshot(page, url)
|
const screenshot = await getFirstDiffScreenshot(page, url, 'step')
|
||||||
expect(screenshot).toMatchSnapshot()
|
expect(screenshot).toMatchSnapshot()
|
||||||
})
|
})
|
||||||
|
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 93 KiB |