- Repository: https://github.com/currents-dev/currents-playwright-component-tests-example :contentReference[oaicite:0]{index=0}
- Latest (and effectively latest overall) commits are on Nov 2, 2023 (by
agoldisand earlier commits bymiguelangarano). :contentReference[oaicite:1]{index=1} - There are Dependabot dependency PRs visible in the repo, but those are automated and excluded by your rule. :contentReference[oaicite:2]{index=2}
➡️ Answer: Nov 2, 2023 :contentReference[oaicite:3]{index=3}
A minimal example showing Playwright Component Testing (React) reported to Currents (using the pwc command / Currents Playwright integration). It explicitly notes that Playwright component testing support was experimental (Nov 2023). :contentReference[oaicite:4]{index=4}
- Install
npm i:contentReference[oaicite:5]{index=5}
- Create Currents project
- Create a project in Currents and obtain
projectId+recordKey. :contentReference[oaicite:6]{index=6}
- Create a project in Currents and obtain
- Run via
pwc- Example command:
npx pwc --key <recordKey> --project-id <projectId> --ci-build-id hello-currents:contentReference[oaicite:7]{index=7}
- Example command:
- Run component tests locally
npm run test-ctrunsplaywright test -c playwright-ct.config.js. :contentReference[oaicite:8]{index=8}
- Artifacts enabled
- The CT config enables
trace: "on",video: "on",screenshot: "on"and setsctPort: 3100. :contentReference[oaicite:9]{index=9}
- The CT config enables
- Two simple component tests
src/App.spec.jsx(passes, expects “Learn React”). :contentReference[oaicite:10]{index=10}src/AppFailing.spec.jsx(intentionally fails, expects “Dont Learn React”). :contentReference[oaicite:11]{index=11}
- A minimal React app scaffold (Create React App)
src/App.jsrenders the “Learn React” link/text. :contentReference[oaicite:12]{index=12}
- Playwright Component Testing configuration
playwright-ct.config.jsdemonstrates CT setup + artifact capture. :contentReference[oaicite:13]{index=13}
- Currents integration dependency
- Uses
@currents/playwrightinpackage.json. :contentReference[oaicite:14]{index=14}
- Uses
- Make the README readable in raw form
- It’s effectively one long line in the raw file, which makes it harder to scan/copy. Reformat into sections + fenced code blocks. :contentReference[oaicite:15]{index=15}
- Provide a copy/paste “Quickstart” with env vars
- Add
.env.exampleand show both styles:npx pwc --key ... --project-id ...- and/or
CURRENTS_RECORD_KEY=... CURRENTS_PROJECT_ID=... npx pwc ...(whatever the tool supports) so people don’t paste secrets into shell history.
- Add
- Clarify what
pwcis- Add one sentence: “
pwcis the Currents Playwright CLI wrapper that records results to Currents,” plus a link to the official docs (the README already links docs, but doesn’t definepwc). :contentReference[oaicite:16]{index=16}
- Add one sentence: “
- Add a CI snippet
- Even a tiny GitHub Actions example (Node install +
npm run test-ct+npx pwc ...) would reduce guesswork for real usage.
- Even a tiny GitHub Actions example (Node install +
- Pin/upgrade versions or add a compatibility note
- Since CT was experimental in Nov 2023, add a note about the Playwright CT version expected (repo uses
@playwright/experimental-ct-react^1.39.0). :contentReference[oaicite:17]{index=17}
- Since CT was experimental in Nov 2023, add a note about the Playwright CT version expected (repo uses