{"id":13651542,"url":"https://github.com/inluxc/playwright-xray","last_synced_at":"2026-01-30T12:03:26.964Z","repository":{"id":63493515,"uuid":"561307861","full_name":"inluxc/playwright-xray","owner":"inluxc","description":"XRAY reporter for Playwright","archived":false,"fork":false,"pushed_at":"2026-01-12T11:12:35.000Z","size":1140,"stargazers_count":47,"open_issues_count":7,"forks_count":21,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-01-12T18:11:01.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inluxc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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}},"created_at":"2022-11-03T12:14:33.000Z","updated_at":"2026-01-12T08:30:38.000Z","dependencies_parsed_at":"2024-02-22T15:30:36.620Z","dependency_job_id":"be7171ed-c045-45b0-aa8d-ed66b62ae4d5","html_url":"https://github.com/inluxc/playwright-xray","commit_stats":{"total_commits":81,"total_committers":6,"mean_commits":13.5,"dds":0.617283950617284,"last_synced_commit":"c82c9230ba6253111023392f418f5c6a6978f35e"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/inluxc/playwright-xray","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inluxc%2Fplaywright-xray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inluxc%2Fplaywright-xray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inluxc%2Fplaywright-xray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inluxc%2Fplaywright-xray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inluxc","download_url":"https://codeload.github.com/inluxc/playwright-xray/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inluxc%2Fplaywright-xray/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T11:55:24.701Z","status":"ssl_error","status_checked_at":"2026-01-30T11:54:13.194Z","response_time":66,"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":"2024-08-02T02:00:50.375Z","updated_at":"2026-01-30T12:03:26.957Z","avatar_url":"https://github.com/inluxc.png","language":"TypeScript","funding_links":[],"categories":["Reporters"],"sub_categories":[],"readme":"# Xray reporter for Playwright\n\nPublish Playwright test run on Xray\n\nNOTICE: Playwright Xray will move to its onw organization, were @NiklasBack will be owner also.\nNPM install sshould not have any changes.\n\nThis reporter is based in playwright zephyr from Yevhen Laichenkov https://github.com/elaichenkov/playwright-zephyr\nThanks Yevhen for the great contribution\n\n## Install\n\n```sh\nnpm i -D playwright-xray\n```\n\n## Usage\n\nAdd reporter to your `playwright.config.ts` configuration file\n\n### Cloud version\n\nAuthenticate with `client_id` and `client_secret` key. If your Xray instance is in a specified region, the API url can be configured by setting the cloud.xrayUrl parameter. By default, it will point to the US region with URL https://xray.cloud.getxray.app/\n\n```typescript\n// playwright.config.ts\nimport { PlaywrightTestConfig } from '@playwright/test';\n\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jira: {\n          url: 'https://your-jira-url',\n          type: 'cloud',\n          apiVersion: '1.0',\n        },\n        cloud: {\n          client_id: '',\n          client_secret: '',\n          // Optional: xrayUrl: '' if the xray region needs to be specified\n        },\n        projectKey: 'JIRA_CODE',\n        testPlan: 'JIRA_CODEXXXXX',\n        debug: false,\n      },\n    ],\n  ],\n};\n```\n\n### Server version\n\nAuthenticate with `token` key.\n\n```typescript\n// playwright.config.ts\nimport { PlaywrightTestConfig } from '@playwright/test';\n\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jira: {\n          url: 'https://your-jira-url',\n          type: 'server',\n          apiVersion: '1.0',\n        },\n        server: {\n          token: 'YOUR_SERVER_TOKEN',\n        },\n        projectKey: 'JIRA_CODE',\n        testPlan: 'JIRA_CODEXXXXX',\n        debug: false,\n      },\n    ],\n  ],\n};\n```\n\nAlso, your playwright tests should include unique ID `J79` of your Xray test case + `|`. The library supports both single and multiple test case IDs N.B If you have different step definitions and steps in multiple test cases, the passed and failed will be related to step number. E.g. even if the action of the steps are copletley different the same steps vill be marked as passed or failed :\n\n\n### Single Test Case ID:\n```typescript\n// Xray test case ID + |\ntest('J79 | basic test', async ({ page }) =\u003e {\n  await page.goto('https://playwright.dev/');\n  const title = page.locator('.navbar__inner .navbar__title');\n  await expect(title).toHaveText('Playwright');\n});\n```\n\n### Multiple Test Case IDs:\n```typescript\n// Multiple Xray test case IDs + |\ntest('J79,J80 | basic test', async ({ page }) =\u003e {\n  await page.goto('https://playwright.dev/');\n  const title = page.locator('.navbar__inner .navbar__title');\n  await expect(title).toHaveText('Playwright');\n});\n```\n**Note:** When using multiple test case IDs, separate them with commas  before the `|` separator.\n\n### Optional config\n\nIs it possible to add some optional values to the Test Execution ticket.\n\n`projectsToExclude` - The Playwright projects that should not be reported to XRAY. Default is `undefined`. Othervise set it to array of values or to a single value, that is equal the name field of project in `playwright.config.ts`. E.g. [`setup`, `cleanup`] or `setup`.\nRegExp can also be used e.g. `projectsToExclude = 'setup.*'`. If e.g. `projectsToExclude = 'firefox'` that conflicts with the command line argument e.g.`--project='firefox'` is used, then the `projectsToExclude` will be ignored.\n\n```typescript\n// playwright.config.ts\nimport { PlaywrightTestConfig } from '@playwright/test';\n\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jira: {\n          url: 'https://your-jira-url',\n          type: 'server',\n          apiVersion: '1.0',\n        },\n        cloud: {\n          client_id: '',\n          client_secret: '',\n          // Optional\n          xrayUrl: '',\n        },\n        server: {\n          token: '',\n        },\n        projectKey: 'JIRA_CODE',\n        testPlan: 'JIRA_CODE-XXX',\n        debug: false,\n        // Optional\n        testExecution: 'JIRA_CODE-YYY',\n        version: 'v1.0',\n        revision: '12345',\n        executedBy: 'valid:accountid',\n        description: 'This test was executed automatically',\n        testEnvironments: ['dev', 'test'],\n        uploadScreenShot: true,\n        uploadTrace: true,\n        uploadVideo: true,\n        markFlakyWith: \"FLAKY\",\n        stepCategories: ['test.step'],\n        summary: `[${new Date().toLocaleString('fr-FR', { timeZone: 'Europe/Paris' })}] - Automated`,\n        dryRun: false,\n        runResult: true,\n        projectsToExclude: ['setup', 'cleanup'],\n        jiraXrayStatusMapping: {\n          passed: \"PASS\",\n          failed: \"FAIL\",\n          skipped: \"SKIPPED\",\n          timedOut: \"FAIL\",\n          interrupted: \"ABORTED\",\n        }\n      },\n    ],\n  ],\n};\n```\n## Explain jiraXrayStatusMapping\n\nThe `jiraXrayStatusMapping` configuration is **optional** and allows you to map Playwright test execution statuses to corresponding status values in **XRAY (Jira Test Management)**.\n\n### Functionality\nPlaywright assigns specific statuses to test results, which may not directly align with the statuses used in XRAY. The `jiraXrayStatusMapping` option enables you to define how each Playwright status should be translated into an XRAY status.\n\nIf this option is not specified, XRAY will use its default status mapping.\n\n### Example Configuration\nThe following example demonstrates how to map Playwright statuses to XRAY statuses:\n\n```typescript\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jiraXrayStatusMapping: {\n          passed: \"PASS\",\n          failed: \"FAIL\",\n          skipped: \"SKIPPED\",\n          timedOut: \"FAIL\",\n          interrupted: \"ABORTED\",\n        }\n      },\n    ],\n  ],\n};\n```\n\nYou can also customize the mapping for specific statuses as needed. For example, if you want to override only the skipped status:\n\n```typescript\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jiraXrayStatusMapping: {\n          skipped: \"SOMETHING ELSE\",\n        }\n      },\n    ],\n  ],\n};\n```\nThis configuration leaves all other statuses unchanged, relying on XRAY's default mappings.\n\n\n## Authentication to Jira XRAY server\nSupports either token base auth or basic auth using username and password. \nThe token is the preferred method.\n\nIf server option is used, then either token or username and password must be provided.\nBut not both token and username plus password combination at the same time.\n\n## Using token based authentication\n\n```typescript\n// playwright.config.ts\nimport { PlaywrightTestConfig } from '@playwright/test';\n\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        server: {\n          token: '',\n        },\n      },\n    ],\n  ],\n};\n```\n\n## Using basic authentication\n\n```typescript\n// playwright.config.ts\nimport { PlaywrightTestConfig } from '@playwright/test';\n\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        server: {\n          username: '',\n          password: '',\n        },\n      },\n    ],\n  ],\n};\n```\n\n### Proxy\n\nIf you use a proxy to access Jira, you need to configure the proxy. This proxy information will be used by Axios to send the results to Jira.\n\n```typescript\n// playwright.config.ts\nimport { PlaywrightTestConfig } from '@playwright/test';\n\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jira: {\n          url: 'https://your-jira-url',\n          type: 'server',\n          apiVersion: '1.0',\n        },\n        cloud: {\n          client_id: '',\n          client_secret: '',\n        },\n        server: {\n          token: '',\n        },\n        projectKey: 'JIRA_CODE',\n        testPlan: 'JIRA_CODE-XXX',\n        debug: false,\n        // Optional\n        proxy: {\n          protocol: 'http',\n          host: '0.0.0.0',\n          port: 80,\n          auth: {\n            username: 'USER',\n            password: 'p@$$w0Rd',\n          },\n        },\n      },\n    ],\n  ],\n};\n```\n\n\u003e If your proxy server doesn't need authentication, just omit the `auth` part.\n\u003e\n\u003e If no proxy is configured, Axios is forced to doesn't use proxy.\n\n### Execution\n\nThen run your tests with `npx playwright test` command and you'll see the result in console:\n\n```sh\n-------------------------------------\n\n⏺  Starting the run with 6 tests\n⏺  The following test execution will be imported \u0026 reported: Chrome\n\n✅ Chrome | XRAYISSUE-2 | another test\n✅ Chrome | XRAYISSUE-1 | basic test\n✅ Firefox | XRAYISSUE-1 | basic test\n⛔ Chrome | XRAYISSUE-3 | another test\n⛔ Firefox | XRAYISSUE-2 | another test\n⛔ Firefox | XRAYISSUE-3 | another test\n\n-------------------------------------\n\n😀 Successfully sending test results to Jira\n\n⏺  Description:       Tests executed with playwright-xray plugin\n⏺  Test environments: dev,test\n⏺  Version:           3.5.2\n⏺  Revision:          12345\n⏺  Browser:           Chrome\n⏺  Test plan:         XRAYISSUE-123\n⏺  Test execution:    XRAYISSUE-324\n⏺  Test Duration:     25s\n⏺  Tests ran:         3 (including reruns)\n⏺  Tests passed:      2\n⏺  Tests failed:      1\n⏺  Flaky test:        0\n\n-------------------------------------\n\n⏺  Test cycle XRAYISSUE-324 has been updated\n👇 Check out the test result\n🔗 https://jira.com/XRAYISSUE-324\n\n-------------------------------------\n```\n\nAnd you'll see the result in the Xray:\n\n![alt text](./assets/xray-result.png)\n\n## Multiple Projects\n\nIf you need to run multiple browsers, you need to use the project switch and run them after each other, e.g.\n```console\nnpx playwright test --project=Chrome \nnpx playwright test --project=Firefox\n```\nIf multiple projects are selected in one run, only the first will be reported and imported to Xray. \n\n## Multiple Test Plans\n\nIf you need to send report for more than one test plan, you need to create a config file for each test plan.\nCreate a folder (e.g. configs) in your project and for each test plan, create a new playwright config file in this folder.\n\n```ts\n// configs/TCK-87.config.ts\n\nimport { PlaywrightTestConfig } from '@playwright/test';\nimport base from '../playwright.config';\n\nconst config: PlaywrightTestConfig = {\n  ...base,\n  testDir: '../tests',\n  use: {\n    ...base.use,\n    headless: true,\n  },\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jira: {\n          url: 'https://your-jira-url',\n          type: 'server',\n          apiVersion: '1.0',\n        },\n        server: {\n          token: 'YOUR_SERVER_TOKEN',\n        },\n        projectKey: 'TCK',\n        testPlan: 'TCK-87',\n      },\n    ],\n  ],\n};\nexport default config;\n```\n\nNow you can choose which config file you want to use executing the tests, using the command below:\n\n```\nnpx playwright test --config=configs/TCK-87.config.ts\n```\n\nIf no config file is chosen, the default config file \"playwright.config.ts\" will be used.\n\n## Xray Iteration Support\n\nThe reporter supports data-driven tests and retries, mapping each run of the same test to an [iteration](https://docs.getxray.app/display/XRAYCLOUD/Parameterized+Tests) in Xray.\n\n```typescript\nfor (const url of ['https://example.org', 'https://playwright.dev']) {\n  test(`J42 | visit ${url}`, async ({ page }) =\u003e {\n    await page.goto(url);\n    await expect(page.locator('body')).toBeVisible();\n  });\n}\n```\n\n![xray iteration results](./assets/xray-iterations.png)\n\nTo specify actual iteration parameters, the utility function for defining Xray metadata can be used:\n\n```typescript\nimport { setXrayMetadata } from 'playwright-xray';\n\nfor (const name of ['Jane', 'John', 'Mary']) {\n  test(`XYZ-123 | log in as ${name}`, async ({ page }, testInfo) =\u003e {\n    await setXrayMetadata(testInfo, { parameters: { user: name } })\n    await page.goto(url);\n    // ...\n  });\n}\n```\n\n![xray iteration results with parameters](./assets/xray-iterations-parameters.png)\n\nWhen uploading, evidence for individual test runs is added to the test execution itself, as Xray does not support adding evidence to iterations outside of steps.\n\nThe reporter calculates Xray statuses for tests with iterations as follows:\n\n- tests with iterations are considered passed if at least one iteration passed\n- tests with iterations are considered failed if all iterations failed or timed out\n- if there is at least one passed iteration, one failed iteration _and_ the the flaky flag is defined, the test will be reported as flaky\n\n## Expose reporter options type\nIn order to enable IntelliSense to provide useful suggestions and avoid potential typos not being detected,\nyou can import XrayOptions in the \"playwright.config.ts\" file and use the TypeScript satisfies operator on the\nplaywright-xray configuration block. E.g:\n\n```ts\nimport { PlaywrightTestConfig } from '@playwright/test';\nimport type { XrayOptions } from 'playwright-xray';\n\nconst config: PlaywrightTestConfig = {\n\n  reporter: [\n    [\n      'playwright-xray',\n      {\n        jira: {\n          url: 'https://your-jira-url',\n          type: 'server',\n          apiVersion: '1.0',\n        },\n        server: {\n          token: 'YOUR_SERVER_TOKEN',\n        },\n        projectKey: 'TCK'\n      } satisfies XrayOptions,\n    ],\n  ],\n};\n\n```\n\n## Notes\n\n- To have the steps imported you have to create them in the test issue itself.\n  The steps will be imported by order of execution and inserted into the test.\n\n- Xray only permits an upload size of maximum 100 MiB and subsequently playwright-xray will fail to upload the \n  execution result due to the total size of videos and traces exceeds this limit. In order to still be able to \n  update the Xray execution status while still being able to view the videos and traces in e.g. Jenkins the \n  switches `uploadScreenShot` and/ or `uploadTrace` set to `false` as shown below, can be used to exclude evidence from the Xray import file.\n\n- Test that will pass after a rerun will be tagged with whatever is defined with the option \"markFlakyWith\"\n  If this option is not set, the test will be tagged as PASSED. Please note that you have to define the\n  Execution Status you choose in Xray, e.g. FLAKY.\n\n- During the test run the reporter vill flag each test after execution as Passed, Failed, Flaky or skipped with the following symbols ✅, ⛔, ⚠️ and 🚫.\n  There is though a caveat. If the tests are run in serial mode (test.describe.configure({ mode: 'serial' });) and the last test fails,\n  then all tests fail even if e.g. the first test in the suite passed. This means that when the last test passes in a rerun, the first test will falsely be\n  flagged as flaky (see https://playwright.dev/docs/test-retries#serial-mode) \n\n- Stepcategories defines how playwright-xray reporter should recognize test steps. The built-in categories in Playwright are the following:\n\n* `hook` for fixtures and hooks initialization and teardown\n* `expect` for expect calls\n* `pw:api` for Playwright API calls.\n* `test.step` for test.step API calls.\n\nIf the option `stepCategories` is not set, playwright-xray will default to `['expect', 'pw:api', 'test.step']` If e.g. only `['test.step']`\nis defined, playwright-xray will only record code defined with `test.step('This is a test step', async () =\u003e { .... });` as a test step.\n\n- The test execution summary defaults to `[${new Date().toUTCString()}] - Automated run` but this can be overidden by the\n  config file option `summary:`\n\nThe option `dryRun` can be used to run the tests without uploading the results to Xray. If this option is set to true, the settings `client_id`\nand `client_secret` are ignored, and the reporter will produce a `xray-payload.json` file that can be imported separately.\n\nThe option `runResult` will generate a `runresult.json` file containing a summary of the execution if is set to true (the default is false)\n\nThe option `limitEvidenceSize` will remove evidences starting with tha last failed test case if the upload request exceeds the specified value.\nIf the option is omitted, the upload will be limited to 100 MiB. If option debug is enabled, a `xray-payload-trim.json` file will be created.\n\n```ts\n[\n      'playwright-xray',\n      {\n        jira: {\n          url: 'https://your-jira-url',\n          type: 'server',\n          apiVersion: '1.0',\n        },\n        server: {\n          token: 'YOUR_SERVER_TOKEN',\n        },\n        projectKey: 'TCK',\n        testPlan: 'TCK-87',\n        uploadScreenShot: false,\n        uploadTrace: false,\n        uploadVideo: false,\n        markFlakyWith: \"FLAKY\",\n        stepCategories: ['test.step'],\n        summary: `[${new Date().toLocaleString('fr-FR', { timeZone: 'Europe/Paris' })}] - Automated`,\n        dryRun: true,\n        runResult: true,\n        limitEvidenceSize: 100000000\n      },\n    ],\n```\n- Please ensure that you correctly type the e.g. testKey in the test or you might encounter {\"error\":\"Invalid JQL query\"}\n  respnse, e.g. if you type TES- 49 instead of TES-49. \n\n\n## License\n\nplaywright-xray is [MIT licensed](./LICENSE).\n\n## Contributors (special thanks for supporting the project), in alphabetical order:\n- [Basti](https://github.com/csvtuda)\n- [coolswood](https://github.com/coolswood)\n- [MonishaNikhil](https://github.com/mons-ops)\n- [NiklasBack](https://github.com/NiklasBack)\n- [rodrigoodhin](https://github.com/rodrigoodhin)\n- [roman-gyver](https://github.com/roman-gyver)\n\n\n## Author\n\nFúlvio Carvalhido \u003cinluxc@gmail.com\u003e\n\n## Supported by:\n\nDiller \u003chttps://diller.no/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finluxc%2Fplaywright-xray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finluxc%2Fplaywright-xray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finluxc%2Fplaywright-xray/lists"}