Skip to content

Commit 93a4a0a

Browse files
authored
Playwright: Refactor to use assertions instead (#211)
1 parent a6aca9a commit 93a4a0a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ list help::
1616
@echo "<PRE-COMMIT>"
1717
@echo " setup-pre-commit: Sets up pre-commit (assuming it is installed)"
1818
@echo "<PLAYWRIGHT TESTS>"
19-
@echo " test: Runs playwright against the old theme."
19+
@echo " tests: Runs playwright against the old theme."
2020
@echo " tests-update-screenshots: Runs playwright against the old theme."
2121

2222
.PHONY: biome-format biome-lint biome-all setup-pre-commit tests build-example-site

layouts/_default/baseof.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
{{ block "header" . }}{{end}}
172172
</header>
173173

174-
<section class="base-layout">
174+
<section class="base-layout" data-testid="base-layout">
175175
<section id="breadcrumb-v1">
176176
{{ if not .IsHome }}
177177
{{ if not (in .Params.display_breadcrumb "false" ) }}

tests/src/visual-regression.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ test.describe('Testing old theme', () => {
55
page,
66
}) => {
77
const currentPlus = 'nginx/installing-nginx-open-source/';
8-
await page.goto(`/${currentPlus}`, { waitUntil: 'networkidle' });
8+
await page.goto(`/${currentPlus}`);
9+
await expect(
10+
await page.locator('data-testid=base-layout').count()
11+
).toBeTruthy();
12+
913
await page.waitForFunction(() => window.scrollY === 0);
1014
await expect(page).toHaveScreenshot('example-site-screenshot.png', {
1115
fullPage: true,

0 commit comments

Comments
 (0)