Test the site with Playwright

VerifiedCaution

Runs Playwright tests of the static site in real Chromium and captures screenshots to verify visual rendering, filters, and responsiveness.

Sby Skills Guide Bot
TestingIntermediate
11/12/2026
Claude Code
#playwright#browser-testing#screenshots#mobile-testing#site-testing

Recommended for

Automated summary

Runs Playwright tests in a real Chromium against the static salary site, checking desktop and mobile behavior and capturing screenshots for visual review.

Strengths

  • Combines rebuilding `_site/`, starting a local server, and running Playwright tests in a single command.
  • Fails tests on script, console, or request errors and saves a screenshot on failure.
  • Includes a dedicated screenshot utility that handles scrolling, dark mode, and click sequences better than headless Chrome's built-in capture.
  • Explicitly covers phone-width tests and encourages checking both themes.

Limitations

  • Repository-specific: paths, npm scripts, and `tests/site/site.spec.mjs` are tied to this project.
  • Requires Node, npm dependencies, and Chromium installed through Playwright.
  • Visual review is still manual; screenshots must be inspected to judge appearance.
When to use it

Use it after any user-visible site change or before committing front-end updates.

When not to use it

Do not use it for Python tests, backend code, or projects that do not follow this static-site setup.

Security analysis

Caution
Quality score85/100

The skill is a straightforward local testing/QA workflow: build the static site, serve it on localhost, run Playwright specs, and capture screenshots. There is no obfuscation, no curl|sh piping, no destructive filesystem commands, and nothing that sends data or credentials off-machine (paths are local, output goes to test-results/). The residual risk is ordinary supply-chain and tool surface: npm install executes dependency install scripts and Playwright downloads a browser, both of which run code with developer privileges. Legitimate but powerful, so caution rather than safe.

Findings
  • •No tools declared in allowed-tools, yet the instructions assume shell/Bash execution (npm, npx, python3) — a manifest consistency gap rather than a risk in itself.
  • •First-run setup performs network installs (`npm install && npx playwright install chromium`), which pulls third-party packages; standard for the task but worth noting as a supply-chain surface.
  • •Starts a local web server on a fixed port (47123) serving the built `_site/` directory; local-only, no external exposure or data exfiltration described.
  • •No destructive commands, no credential/token handling, no obfuscated payloads, no attempts to override the auditor or disable safety checks.
  • •Instructs `npm install`, which pulls third-party dependencies and may execute package lifecycle scripts on the developer's machine.
  • •Instructs `npx playwright install chromium`, downloading and installing a browser binary from the network.
  • •Starts a local HTTP server on port 47123 serving the built `_site/` directory and drives a real Chromium instance against it.
  • •No declared allowed_tools, so the agent will need shell/npm/browser execution capability that is not scoped in the manifest.
How this analysis is made

Examples

Run site tests
Run `npm run test:site` and report every failure, including the saved screenshot path.
Screenshot role filter
Take a screenshot of the Spanish role page with the role filter open at desktop width and check the layout.
Add map toggle test
Add a Playwright test for the map toggle in `tests/site/site.spec.mjs`, then run the site test suite.

name: test-site description: Test the salary website (web/app.js, web/style.css, scripts/site.py) in a real Chromium with Playwright, and take screenshots of it. Use after any change to the site, when asked to test, check, verify or screenshot the web, or before committing site changes.

Testing the site

The site is static: scripts/site.py writes _site/ from the aggregates in data/, and web/app.js draws everything in the browser. Python tests do not reach that code; these do.

First time on a machine: npm install && npx playwright install chromium.

Run the tests

npm run test:site

This rebuilds _site/, serves it on port 47123 and runs tests/site/site.spec.mjs in Chromium, at desktop width and (tests tagged @mobile) on a phone. Any script error, console error or failed request fails the test it happened in. On a failure Playwright saves a screenshot under test-results/; open it with Read before guessing at the cause.

One test: npx playwright test -g "role menu". Watch it run: npx playwright test --headed.

Look at the page

Tests check behaviour; a screenshot checks how it looks. After a visual change, take one and read it:

python3 scripts/site.py
npm run shoot -- "/es/#role=software-engineer" --click ".filter[data-k=role] .pick" --out test-results/role.png
npm run shoot -- /es/ --width 390 --dark --scroll 1600 --out test-results/bar.png

Options are in the header of tests/site/shoot.mjs: viewport size, dark mode, clicks in order, scroll to a y offset or a selector, full page. Use this instead of headless Chrome from the shell: Chrome's own --screenshot renders a blank page once the window is scrolled, which hides exactly the sticky-bar and overlap bugs worth looking for. shoot.mjs runs full Chromium rather than Playwright's headless shell for the same reason: the shell does not paint backdrop-filter, so blur and glass effects look wrong.

Check both themes and a phone width (390) when a change touches layout or colour.

When the site changes

Every user-visible feature has a test: filters, the role tree, the years span, sorting, opening rows, the map toggle, logo alignment, no sideways scroll on a phone. Add or update one in tests/site/site.spec.mjs in the same change, asserting what a reader would see (text, order, aria-* state, the URL hash), not implementation details. Spanish copy is the default page; text assertions use it.

Then run npm run test:site, read any failure screenshot, and report the result as it is.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/test-the-site-with-playwright-mw1m8a2f/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/test-the-site-with-playwright-mw1m8a2f' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/test-the-site-with-playwright-mw1m8a2f/download' --output '.skill-downloads/test-the-site-with-playwright-mw1m8a2f/SKILL.md.part' && mv '.skill-downloads/test-the-site-with-playwright-mw1m8a2f/SKILL.md.part' '.skill-downloads/test-the-site-with-playwright-mw1m8a2f/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/test-the-site-with-playwright-mw1m8a2f/SKILL.md' && test -s '.skill-downloads/test-the-site-with-playwright-mw1m8a2f/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/test-site' && cp -R '.skill-downloads/test-the-site-with-playwright-mw1m8a2f' '.claude/skills/test-site'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/test-the-site-with-playwright-mw1m8a2f'

openskills read 'test-the-site-with-playwright-mw1m8a2f'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/test-the-site-with-playwright-mw1m8a2f/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills