{"_rev":"4-1ddc5051e48441d9d34dd1e73634b2d0","time":{"created":"2023-06-20T15:17:46.063Z","1.5.7":"2023-06-19T19:08:05.344Z","modified":"2023-06-20T15:17:46.734Z","1.5.8":"2023-06-20T13:58:31.677Z","1.5.9":"2023-06-20T15:17:46.440Z"},"_id":"@axtherlov/playwright-azure-reporter","name":"@axtherlov/playwright-azure-reporter","dist-tags":{"latest":"1.5.9"},"versions":{"1.5.9":{"name":"@axtherlov/playwright-azure-reporter","version":"1.5.9","description":"Playwright Azure Reporter","main":"./dist/playwright-azure-reporter.js","types":"./dist/playwright-azure-reporter.d.js","scripts":{"test":"npx playwright test","test:reporter":"npx playwright test -c tests/reporter/playwright.config.ts","lint":"tsc --noEmit --skipLibCheck --pretty && eslint --ext .ts .","lint:fix":"eslint src/** tests/** --ext .ts --fix","format":"prettier --write src/**/*.ts tests/**/*.ts","build":"yarn run clean && yarn run dev","clean":"rm -rf dist || true","prepublishOnly":"tsc","dev":"yarn run lint && tsc","dev:watch":"nodemon --watch src --exec \"yarn run build\"","version":"conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md","release":"conventional-github-releaser -p angular","prepare":"husky install"},"keywords":["playwright","azure","reporter"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"author":{"name":"Oleksii Galagan","email":"alexneo2003@gmail.com","url":"https://github.com/alexneo2003/"},"repository":{"type":"git","url":"git+https://github.com/axtherlov/playwright-azure-reporter.git"},"license":"ISC","dependencies":{"azure-devops-node-api":"^12.0.0","chalk":"4.1.2","colors":"^1.4.0","debug":"^4.3.4","mime":"^3.0.0"},"devDependencies":{"@playwright/test":"^1.32.2","@types/debug":"^4.1.7","@types/mime":"^3.0.1","@typescript-eslint/eslint-plugin":"^5.57.1","@typescript-eslint/eslint-plugin-tslint":"^5.57.1","@typescript-eslint/parser":"^5.57.1","eslint":"^8.37.0","eslint-config-standard":"^17.0.0","eslint-plugin-import":"^2.27.5","eslint-plugin-jsdoc":"^40.1.1","eslint-plugin-n":"^15.7.0","eslint-plugin-prefer-arrow":"^1.2.3","eslint-plugin-promise":"^6.1.1","eslint-plugin-simple-import-sort":"^10.0.0","husky":"^8.0.3","prettier":"^2.8.7","socksv5":"^0.0.6","typescript":"^5.0.3"},"licenseText":"MIT License\n\nCopyright (c) Meta Platforms, Inc. and affiliates.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@axtherlov/playwright-azure-reporter@1.5.9","dist":{"shasum":"eeaeabf6c6883680cf5120e899ba83e7fe985c8a","integrity":"sha512-U/o5RJuEsExWckUFVwPs6aTlbY6HIOSFjSPogz6vbJq0Nm9Ecq5noWeFGHvLr2WDsD+N3rW/rk52p3Y68hqEkw==","tarball":"https://registry.npmjs.org/@axtherlov/playwright-azure-reporter/-/playwright-azure-reporter-1.5.9.tgz","fileCount":70,"unpackedSize":288998,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDE2H6ZEBzD/wFQrKlEPpaSVnHb4E5KzfVAXkb3xgzQOAIhAJlF52w4tnHo88u56Jl3xmViLDAqat4xwtNOLyegfTnD"}]},"_npmUser":{"name":"axtherlov","email":"daniel.terceros.b@gmail.com"},"directories":{},"maintainers":[{"name":"axtherlov","email":"daniel.terceros.b@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/playwright-azure-reporter_1.5.9_1687274266279_0.7648481841948944"},"_hasShrinkwrap":false}},"maintainers":[{"name":"axtherlov","email":"daniel.terceros.b@gmail.com"}],"description":"Playwright Azure Reporter","keywords":["playwright","azure","reporter"],"repository":{"type":"git","url":"git+https://github.com/axtherlov/playwright-azure-reporter.git"},"author":{"name":"Oleksii Galagan","email":"alexneo2003@gmail.com","url":"https://github.com/alexneo2003/"},"license":"ISC","readme":"# Playwright Azure Reporter\n![GitHub](https://img.shields.io/github/license/axtherlov/playwright-azure-reporter) ![npm (scoped)](https://img.shields.io/npm/v/@axtherlov/playwright-azure-reporter) ![npm](https://img.shields.io/npm/dw/@axtherlov/playwright-azure-reporter) ![npm](https://img.shields.io/npm/dt/@axtherlov/playwright-azure-reporter)\n\n## A must read!\n**this is based on forked version of https://github.com/alexneo2003/playwright-azure-reporter I've additionally added a functionality to **associate automatically the automated test with test case in Azure Devops\n**Since version 1.5.0 reporter allows using configurationIds to publish results for different configurations e.g. different browsers**\n**Necessarily defining `testRun.configurationIds` or/and `testPointMapper` function in reporter config, otherwise reporter will be publishing results for all configurations**\n\n\n## How to integrate\nInstall package\n\n```bash\nnpm install @axtherlov/playwright-azure-reporter\n```\nor \n```bash\nyarn add @axtherlov/playwright-azure-reporter\n```\n\n## Usage\n\nYou must register an ID already existing test cases from Azure DevOps before running tests.\n\n> **You need write testCaseId wraped in square brackets at the test name.**\n\nYou can define multiple test cases for a single test with next format:\n\n- `[1] Test name` - single test case\n- `[1,2,3] Test name` - multiple test cases\n- `[16, 17, 18] Test name` - multiple test cases with spaces\n- `[1, 2, 3] Test name [4] Test name [5][6] Test name` - with combined format\n\nFor example:\n\n```typescript\ndescribe('Test suite', () => {\n  test('[1] First Test', () => {\n    expect(true).toBe(true);\n  });\n\n  test('Correct test [3]', () => {\n    expect(true).toBe(true);\n  });\n\n  test.skip('Skipped test [4]', () => {\n    expect(true).toBe(true);\n  });\n\n  test('[6] Failed test', () => {\n    expect(true).toBe(false);\n  });\n\n  test('[7] Test seven [8] Test eight [9] Test nine', () => {\n    expect(true).toBe(true);\n  });\n\n  test('[10,11,12] Test ten, eleven, twelve', () => {\n    expect(true).toBe(true);\n  });\n\n  test('[13, 14, 15] Test thirteen, fourteen, fifteen', () => {\n    expect(true).toBe(true);\n  });\n\n  test('[16, 17, 18] Test sixteen, seventeen, eighteen [19] Test nineteen', () => {\n    expect(true).toBe(true);\n  });\n});\n```\n\nConfigure Playwright Azure Reporter with `playwright-azure-reporter` package.\n\n`playwright.config.ts`\n\n```typescript\nimport { PlaywrightTestConfig } from '@playwright/test';\nimport { AzureReporterOptions } from '@axtherlov/playwright-azure-reporter/dist/playwright-azure-reporter';\n\n/**\n * See https://playwright.dev/docs/test-configuration.\n */\nconst config: PlaywrightTestConfig = {\n  testDir: './tests',\n  timeout: 30 * 1000,\n  expect: {\n    timeout: 5000,\n  },\n  forbidOnly: !!process.env.CI,\n  retries: process.env.CI ? 2 : 0,\n  workers: process.env.CI ? 1 : undefined,\n  reporter: [\n    ['list'],\n    [\n      '@axtherlov/playwright-azure-reporter',\n      {\n        orgUrl: 'https://dev.azure.com/your-organization-name',\n        token: process.env.AZURE_TOKEN,\n        planId: 44,\n        projectName: 'SampleSample',\n        environment: 'AQA',\n        logging: true,\n        testRunTitle: 'Playwright Test Run',\n        publishTestResultsMode: 'testRun',\n        uploadAttachments: true,\n        attachmentsType: ['screenshot', 'video', 'trace'],\n        testRunConfig: {\n          owner: {\n            displayName: 'Terceros Daniel',\n          },\n          comment: 'Playwright Test Run',\n          // the configuration ids of this test run, use \n          // https://dev.azure.com/{organization}/{project}/_apis/test/configurations to get the ids of  your project.\n          // if multiple configuration ids are used in one run a testPointMapper should be used to pick the correct one, \n          // otherwise the results are pushed to all.\n          configurationIds: [ 1 ],\n        },\n      } as AzureReporterOptions,\n    ],\n  ],\n  use: {\n    screenshot: 'only-on-failure',\n    actionTimeout: 0,\n    trace: 'on-first-retry',\n  },\n};\n\nexport default config;\n```\n\n## Configuration\n\nReporter options (\\* - required):\n\n- \\*`token` - Azure DevOps token, you can find more information [here](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows)\n- \\*`orgUrl` - Full url for your organization space. Example: `https://dev.azure.com/your-organization-name`\n\n  > **Note:** some API's (e.g. ProfileApi) can't be hit at the org level, and has to be hit at the deployment level, so url should be structured like https://vssps.dev.azure.com/{yourorgname}\n\n- \\*`projectName` - Name of your project (also can be got from run URL). Example: `https://dev.azure.com/alex-neo/SampleProject/` - **SampleProject**\n- \\*`planId` - Id of test plan. You can find it in test plan URL. Example: `https://dev.azure.com/alex-neo/SampleProject/_testPlans/execute?planId=4&suiteId=6` - **planId=4**\n- `environment` - Any string that will be used as environment name. Will be used as prefix for all test runs. Default: `undefined`. Example: `QA`\n- `logging` [true/false] - Enabled debug logging from reporter or not. Default: `false`.\n- `uploadAttachments` [true/false] - Uploading attachments (screenshot/video) after test ended. Default: `false`.\n- `attachmentsType` - List of attachments types or a RegEx to match the name of the attachment that will be uploaded. Default: `['screenshot']`\n- `isDisabled` [true/false] - Disable reporter. Default: `false`.\n- `testRunTitle` - Title of test run using to create new test run. Default: `Playwright Test Run`.\n- `testRunConfig` - Extra data to pass when Test Run creating. Read [doc](https://learn.microsoft.com/en-us/rest/api/azure/devops/test/runs/create?view=azure-devops-rest-7.1&tabs=HTTP#request-body) from more information. Default: `empty`.\n- `testPointMapper` - A callback to map the test runs to test configurations, e.g. by browser\n```\n  testPointMapper: async (testCase: TestCase, testPoints: TestPoint[]) => {\n    switch(testCase.parent.project()?.use.browserName) {\n      case 'chromium':\n        return testPoints.filter((testPoint) => testPoint.configuration.id === '3');\n      case 'firefox':\n        return testPoints.filter((testPoint) => testPoint.configuration.id === '4');\n      case 'webkit':\n        return testPoints.filter((testPoint) => testPoint.configuration.id === '5');\n      default:\n        throw new Error(\"invalid test configuration!\");\n    }\n  }\n```\n- `publishTestResultsMode` - Mode of publishing test results. Default: `'testResult'`. Available options:\n  - `testResult` - Published results of tests, at the end of each test, parallel to test run..\n  - `testRun` - Published test results to test run, at the end of test run.\n    > **Note:** If you use `testRun` mode and using same test cases in different tests (yes i know it sounds funny), it will be overwritten with last test result.\n","readmeFilename":"README.md"}