{"id":46841645,"url":"https://github.com/cuioss/playwright-test-artifacts","last_synced_at":"2026-03-10T13:16:41.726Z","repository":{"id":337270287,"uuid":"1152894203","full_name":"cuioss/playwright-test-artifacts","owner":"cuioss","description":"Playwright test artifact infrastructure - captures browser logs, network errors, and screenshots per test","archived":false,"fork":false,"pushed_at":"2026-02-18T08:15:06.000Z","size":182,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-18T12:20:08.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuioss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"cuioss"}},"created_at":"2026-02-08T15:49:01.000Z","updated_at":"2026-02-18T08:13:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cuioss/playwright-test-artifacts","commit_stats":null,"previous_names":["cuioss/playwright-test-artifacts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cuioss/playwright-test-artifacts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fplaywright-test-artifacts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fplaywright-test-artifacts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fplaywright-test-artifacts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fplaywright-test-artifacts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuioss","download_url":"https://codeload.github.com/cuioss/playwright-test-artifacts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuioss%2Fplaywright-test-artifacts/sbom","scorecard":{"id":1243553,"data":{"date":"2026-02-18T08:13:21Z","repo":{"name":"github.com/cuioss/playwright-test-artifacts","commit":"3e74c897b390fd783f12e030c09f5e3a63639286"},"scorecard":{"version":"v5.3.0","commit":"c22063e786c11f9dd714d777a687ff7c4599b600"},"score":6.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project was created within the last 90 days. Please review its contents carefully","details":["Warn: Repository was created within the last 90 days."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#packaging"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#dependency-update-tool"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:14","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:17","Info: jobLevel 'checks' permission set to 'read': .github/workflows/scorecards.yml:23","Warn: jobLevel 'security-events' permission set to 'write': .github/workflows/scorecards.yml:17","Info: jobLevel 'contents' permission set to 'read': .github/workflows/scorecards.yml:19","Info: jobLevel 'actions' permission set to 'read': .github/workflows/scorecards.yml:20","Info: jobLevel 'issues' permission set to 'read': .github/workflows/scorecards.yml:21","Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/scorecards.yml:22","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:8","Info: topLevel 'contents' permission set to 'read': .github/workflows/npm-build.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/release.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/scorecards.yml:11"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:   4 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-2g4f-4pwh-qvx6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/cuioss/.github/SECURITY.md:1","Info: Found linked content: github.com/cuioss/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/cuioss/.github/SECURITY.md:1","Info: Found text in security policy: github.com/cuioss/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#sast"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'main'","Info: 'stale review dismissal' is required to merge on branch 'main'","Warn: branch 'main' does not require approvers","Warn: codeowners review is not required on branch 'main'","Warn: 'last push approval' is disabled on branch 'main'","Warn: no status checks found to merge onto branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#license"}},{"name":"Contributors","score":3,"reason":"project has 1 contributing companies or organizations -- score normalized to 3","details":["Info: found contributions from: gip mbh"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#contributors"}},{"name":"CI-Tests","score":9,"reason":"18 out of 19 merged PRs checked by a CI test -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/c22063e786c11f9dd714d777a687ff7c4599b600/docs/checks.md#ci-tests"}}]},"last_synced_at":"2026-02-18T12:21:35.882Z","repository_id":337270287,"created_at":"2026-02-18T12:21:35.883Z","updated_at":"2026-02-18T12:21:35.883Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30334419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-10T13:16:41.091Z","updated_at":"2026-03-10T13:16:41.717Z","avatar_url":"https://github.com/cuioss.png","language":"JavaScript","funding_links":["https://github.com/sponsors/cuioss"],"categories":[],"sub_categories":[],"readme":"# @cuioss/playwright-test-artifacts\n\n## Status\n\n[![Node.js CI](https://github.com/cuioss/playwright-test-artifacts/actions/workflows/npm-build.yml/badge.svg)](https://github.com/cuioss/playwright-test-artifacts/actions/workflows/npm-build.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![npm](https://img.shields.io/npm/v/@cuioss/playwright-test-artifacts)](https://www.npmjs.com/package/@cuioss/playwright-test-artifacts)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cuioss_playwright-test-artifacts\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=cuioss_playwright-test-artifacts)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=cuioss_playwright-test-artifacts\u0026metric=ncloc)](https://sonarcloud.io/summary/new_code?id=cuioss_playwright-test-artifacts)\n\n\n## What is it?\n\nA standalone npm package providing Playwright test artifact infrastructure.\nIt captures browser console logs, JavaScript errors, network failures, and full-page screenshots for every test — automatically.\nAll artifacts are persisted to Playwright's per-test `testInfo.outputDir`, making them immediately available in CI reports and local debugging.\n\n### Installation\n\n```bash\nnpm install @cuioss/playwright-test-artifacts\n```\n\n### Quick Start\n\n```javascript\n// tests/fixtures.js\nimport { test as base } from \"@playwright/test\";\nimport { createArtifactFixture } from \"@cuioss/playwright-test-artifacts\";\n\nexport const test = base.extend(createArtifactFixture());\nexport { expect } from \"@playwright/test\";\n```\n\n```javascript\n// tests/example.spec.js\nimport { test, expect } from \"./fixtures.js\";\n\ntest(\"homepage loads\", async ({ page }) =\u003e {\n    await page.goto(\"https://example.com\");\n    await expect(page).toHaveTitle(/Example/);\n});\n// -\u003e Artifacts automatically saved: start-test.png (if using takeStartScreenshot),\n//    browser.log, test-run.log, end-tests.png\n```\n\n## API\n\n| Export | Type | Description |\n|--------|------|-------------|\n| `TestLogger` | Class | Unified logger capturing browser and Node-side logs per test. |\n| `testLogger` | Instance | Singleton `TestLogger` instance for convenient reuse. |\n| `takeStartScreenshot` | `async function(page, testInfo)` | Takes a full-page screenshot named `start-test.png` at the start of a test. |\n| `createArtifactFixture` | `function(options?)` | Factory returning a Playwright fixture definition for `test.extend()`. |\n\n### Per-Test Artifact Contract\n\nEach test using the artifact fixture produces these files in `testInfo.outputDir`:\n\n| File | Description |\n|------|-------------|\n| `start-test.png` | Full-page screenshot taken at test start (requires explicit `takeStartScreenshot` call or `beforeUse` hook). |\n| `browser.log` | Browser console messages, JavaScript exceptions, and HTTP errors (status \u003e= 400). |\n| `test-run.log` | Node-side log entries from custom `logger.info()` / `logger.warn()` / `logger.error()` calls. |\n| `end-tests.png` | Full-page screenshot taken automatically during teardown. |\n\n### Output Directory\n\nPlaywright automatically creates a **separate subdirectory per test** inside `outputDir`, so each test's artifacts are isolated.\nThe subdirectory name is derived from the test file and test title.\n\n```\ntest-results/\n├── homepage-loads-chromium/\n│   ├── browser.log\n│   ├── test-run.log\n│   └── end-tests.png\n└── login-works-chromium/\n    ├── browser.log\n    ├── test-run.log\n    └── end-tests.png\n```\n\nThe base `outputDir` is configured in your `playwright.config.js`.\nPlaywright's default is `test-results/` at your project root.\n\n```javascript\n// playwright.config.js — default (npm projects)\nimport { defineConfig } from \"@playwright/test\";\n\nexport default defineConfig({\n    outputDir: \"test-results\",\n});\n```\n\nFor Maven-style projects that follow the `target/` convention:\n\n```javascript\n// playwright.config.js — Maven-style project\nimport { defineConfig } from \"@playwright/test\";\n\nexport default defineConfig({\n    outputDir: \"target/test-results\",\n});\n```\n\n### Advanced Usage\n\n#### Custom logger instance\n\n```javascript\nimport { test as base } from \"@playwright/test\";\nimport { TestLogger, createArtifactFixture } from \"@cuioss/playwright-test-artifacts\";\n\nconst myLogger = new TestLogger();\nexport const test = base.extend(createArtifactFixture({ logger: myLogger }));\n```\n\n#### beforeUse / afterUse hooks\n\n```javascript\nimport { test as base } from \"@playwright/test\";\nimport {\n    createArtifactFixture,\n    takeStartScreenshot,\n} from \"@cuioss/playwright-test-artifacts\";\n\nexport const test = base.extend(\n    createArtifactFixture({\n        async beforeUse(page, testInfo) {\n            // Runs after logger setup, before test body\n            await takeStartScreenshot(page, testInfo);\n        },\n        async afterUse(page, testInfo) {\n            // Runs after logs are written — e.g. custom cleanup\n            console.log(`Artifacts saved to ${testInfo.outputDir}`);\n        },\n    }),\n);\n```\n\n#### Manual TestLogger usage\n\n```javascript\nimport { testLogger } from \"@cuioss/playwright-test-artifacts\";\n\n// Inside a Playwright test or helper\ntestLogger.info(\"MyHelper\", \"Navigating to login page\");\ntestLogger.warn(\"MyHelper\", \"Unexpected redirect detected\");\ntestLogger.error(\"MyHelper\", \"Login failed with status 401\");\n```\n\n## License\n\n[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuioss%2Fplaywright-test-artifacts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuioss%2Fplaywright-test-artifacts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuioss%2Fplaywright-test-artifacts/lists"}