Skip to content

Latest commit

 

History

History
64 lines (52 loc) · 2.02 KB

File metadata and controls

64 lines (52 loc) · 2.02 KB

playwright-json-summary-reporter

This package can be installed to generate a simple summary.json file that can be used as a part of a Playwright Test automation framework. My main use case for building this is to have quick access to a list of failed or succeeded tests for re-running failures (outside of playwright's retry functionality). I also use this as a way to quickly identify if all tests passed within a GitHub action.

Forked from playwright-json-summary-reporter

Install

git clone https://github.com/graffhyrum/playwright-json-summary-reporter.git && cd playwright-json-summary-reporter && npm install

Usage

Modify your playwright.config.ts file to include the reporter:

  reporter: [
    ['playwright-json-summary-reporter'],
    ['html'], // other reporters
    ['dot']
  ],

Now when you run a test there should be a new file summary.json that gets saved to the root of the directory. An example of the file is shown below.

{
  "durationInMS": 41565,
  "passed": [
    "api/create-user-account.spec.ts:34:3",
    "api/create-user-account.spec.ts:55:3",
    "api/delete-user-account.spec.ts:47:3",
    "api/login.spec.ts:12:3",
    "api/login.spec.ts:37:3",
    "api/login.spec.ts:61:3",
    "api/login.spec.ts:84:3",
    "ui/codepen/copyToClipboard.spec.ts:5:1",
    "ui/codepen/copyToClipboard.spec.ts:17:1",
    "ui/internet.app/selectPresentElement.spec.ts:10:1",
    "ui/internet.app/selectPresentElement.spec.ts:35:1",
    "ui/grep.spec.ts:4:3",
    "ui/grep.spec.ts:9:3",
    "ui/loginUser.spec.ts:22:3",
    "ui/loginUserNoImages.spec.ts:23:3",
    "ui/loginUser.spec.ts:37:3",
    "ui/loginUserNoImages.spec.ts:40:3",
    "ui/registerUser.spec.ts:17:1"
  ],
  "skipped": [],
  "failed": [],
  "warned": [],
  "timedOut": [],
    "flakey": [
    "tests.spec.ts:18:7"
  ],
  "status": "passed",
  "startedAt": 1674431153277
}

If you found this helpful feel free to check out https://playwrightsolutions.com!