Skip to content

Commit

Permalink
re-organized my tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncanma committed May 26, 2024
1 parent 7bf777e commit 7efe01e
Show file tree
Hide file tree
Showing 116 changed files with 18 additions and 12 deletions.
12 changes: 2 additions & 10 deletions tests/minimum.spec.ts → tests/posts-and-tags.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import { test, expect, Page } from '@playwright/test';
import { visualDiff } from './visualDiffAlbum';

test('About', async ({ page }) => {
await visualDiff(page, '/about/');
});

test('Home', async ({ page }) => {
await visualDiff(page, '/');
});

test('Post with images', async ({ page }) => {
await visualDiff(page, '/blog/space-games/');
});
Expand All @@ -25,6 +17,6 @@ test('Tag Performance', async ({ page }) => {
await visualDiff(page, '/tags/performance/');
});

test('Publications', async ({ page }) => {
await visualDiff(page, '/publications/');
test('Blog', async ({ page }) => {
await visualDiff(page, '/blog/');
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions tests/specialpages.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { test, expect, Page } from '@playwright/test';
import { visualDiff } from './visualDiffAlbum';

test('About', async ({ page }) => {
await visualDiff(page, '/about/');
});

test('Home', async ({ page }) => {
await visualDiff(page, '/');
});

test('Publications', async ({ page }) => {
await visualDiff(page, '/publications/');
});
4 changes: 2 additions & 2 deletions tests/visualDiffAlbum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { expect, Page, TestInfo } from '@playwright/test';

export async function visualDiffAlbum(page: Page, url: string, testInfo: TestInfo) {
await page.goto(url);

await page.evaluate(() => document.fonts.ready);
// Trigger loading of all images
for (const img of await page.locator('//img').all()) {
await img.scrollIntoViewIfNeeded();
Expand All @@ -21,7 +21,7 @@ export async function visualDiffAlbum(page: Page, url: string, testInfo: TestInf

export async function visualDiff(page: Page, url: string) {
await page.goto(url);

await page.evaluate(() => document.fonts.ready);
// Trigger loading of all images
for (const img of await page.locator('//img').all()) {
await img.scrollIntoViewIfNeeded();
Expand Down

0 comments on commit 7efe01e

Please sign in to comment.