forked from wei/socialify
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Updated Playwright tests, config, and snapshots
selectively checked out wei#405 's updated working 100% passing Playwright tests and config to current branch. Resovled to not including stargazers issue mentioned in wei#404 comments. Updated all snapshots to reflect this new config. Also only using Chrome and Mobile Chrome to ensure small testing footprint while covering responsiveness of the app.
- Loading branch information
Showing
20 changed files
with
119 additions
and
31 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,67 @@ | ||
import { type Page, expect, test } from '@playwright/test' | ||
|
||
// Give navigation expects a generous timeout of 60 seconds. | ||
const customPageLoadTimeout = { timeout: 60000 } | ||
|
||
// Give component transition/animation expects a generous timeout of 1 second(s). | ||
const customTransitionTimeout = { timeout: 1000 } | ||
|
||
// Testing constants. | ||
const repoPreviewURL: string = | ||
'/wei/socialify?language=1&owner=1&name=1&stargazers=1&theme=Light' | ||
|
||
test.describe('Socialify UI:', () => { | ||
test('is consistent for landing page', async ({ | ||
page, | ||
}: { page: Page }): Promise<void> => { | ||
await page.goto('/', customPageLoadTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customPageLoadTimeout) | ||
|
||
const image = await page.screenshot() | ||
expect(image).toMatchSnapshot() | ||
}) | ||
|
||
test('is consistent for error (404) page', async ({ | ||
page, | ||
}: { page: Page }): Promise<void> => { | ||
await page.goto('/404', customPageLoadTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customPageLoadTimeout) | ||
|
||
const image = await page.screenshot() | ||
expect(image).toMatchSnapshot() | ||
}) | ||
|
||
test('is consistent for preview config page', async ({ | ||
page, | ||
}: { page: Page }): Promise<void> => { | ||
await page.goto(repoPreviewURL, customPageLoadTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customPageLoadTimeout) | ||
|
||
// To maintain consistency, de-select the 'Stars' checkbox, | ||
// and selects the 'Description' checkbox. | ||
await page.click('input[name="stargazers"]') | ||
await page.click('input[name="description"]') | ||
|
||
// Wait for the component transition/animation to finish completely. | ||
await page.waitForTimeout(customTransitionTimeout.timeout) | ||
|
||
const image = await page.screenshot() | ||
expect(image).toMatchSnapshot() | ||
|
||
// Also check the toaster UI consistency. | ||
await page.click('button:has-text("URL")') | ||
await page.waitForSelector('[role="alert"]', customPageLoadTimeout) | ||
|
||
// Wait for the component transition/animation to finish completely. | ||
await page.waitForTimeout(customTransitionTimeout.timeout) | ||
|
||
const toastImage = await page.screenshot() | ||
expect(toastImage).toMatchSnapshot() | ||
}) | ||
}) |
Binary file added
BIN
+555 KB
...apshots/Socialify-UI-is-consistent-for-error-404-page-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+294 KB
...ts-snapshots/Socialify-UI-is-consistent-for-error-404-page-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+516 KB
...snapshots/Socialify-UI-is-consistent-for-landing-page-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+282 KB
...c.ts-snapshots/Socialify-UI-is-consistent-for-landing-page-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+200 KB
...ts/Socialify-UI-is-consistent-for-preview-config-page-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+199 KB
...apshots/Socialify-UI-is-consistent-for-preview-config-page-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+209 KB
...ts/Socialify-UI-is-consistent-for-preview-config-page-2-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+199 KB
...apshots/Socialify-UI-is-consistent-for-preview-config-page-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file removed
BIN
-31.5 KB
...ub-r-50b6f-click-URL-and-get-the-social-preview-image-1-Google-Chrome-linux.png
Binary file not shown.
Binary file removed
BIN
-31.5 KB
...b-r-50b6f-click-URL-and-get-the-social-preview-image-1-Microsoft-Edge-linux.png
Binary file not shown.
Binary file modified
BIN
+8.31 KB
(120%)
...ub-r-50b6f-click-URL-and-get-the-social-preview-image-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10.6 KB
(130%)
...-GitHub-r-50b6f-click-URL-and-get-the-social-preview-image-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-58 KB
...a-GitHub-r-50b6f-click-URL-and-get-the-social-preview-image-1-firefox-linux.png
Binary file not shown.
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