Skip to content

Commit b7365bf

Browse files
committed
Playwright: Refactor to use assertions instead
1 parent 2b8f65b commit b7365bf

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ test.describe('Testing old theme', () => {
66
}) => {
77
const currentPlus = 'nginx/installing-nginx-open-source/';
88
await page.goto(`/${currentPlus}`, { waitUntil: 'networkidle' });
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)