Skip to content

Refactor to use assertions instead for playwright #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ list help::
@echo "<PRE-COMMIT>"
@echo " setup-pre-commit: Sets up pre-commit (assuming it is installed)"
@echo "<PLAYWRIGHT TESTS>"
@echo " test: Runs playwright against the old theme."
@echo " tests: Runs playwright against the old theme."
@echo " tests-update-screenshots: Runs playwright against the old theme."

.PHONY: biome-format biome-lint biome-all setup-pre-commit tests build-example-site
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
{{ block "header" . }}{{end}}
</header>

<section class="base-layout">
<section class="base-layout" data-testid="base-layout">
<section id="breadcrumb-v1">
{{ if not .IsHome }}
{{ if not (in .Params.display_breadcrumb "false" ) }}
Expand Down
6 changes: 5 additions & 1 deletion tests/src/visual-regression.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ test.describe('Testing old theme', () => {
page,
}) => {
const currentPlus = 'nginx/installing-nginx-open-source/';
await page.goto(`/${currentPlus}`, { waitUntil: 'networkidle' });
await page.goto(`/${currentPlus}`);
await expect(
await page.locator('data-testid=base-layout').count()
).toBeTruthy();

await page.waitForFunction(() => window.scrollY === 0);
await expect(page).toHaveScreenshot('example-site-screenshot.png', {
fullPage: true,
Expand Down
Loading