{"_id":"@demin97sergey/testit-adapter-playwright","name":"@demin97sergey/testit-adapter-playwright","dist-tags":{"latest":"3.2.11-TMS-5.4"},"versions":{"3.2.11-TMS-5.4":{"name":"@demin97sergey/testit-adapter-playwright","version":"3.2.11-TMS-5.4","description":"Playwright adapter for Test IT","license":"Apache-2.0","author":{"name":"Integration team","email":"integrations@testit.software"},"repository":{"type":"git","url":"git+https://github.com/testit-tms/adapters-js.git"},"keywords":[],"main":"./dist/reporter.js","types":"./dist/reporter.d.ts","scripts":{"clean":"rimraf ./dist ./out","prebuild":"npm --prefix ../testit-js-commons run build && npm link ../testit-js-commons","build":"tsc -p tsconfig.json"},"devDependencies":{"@playwright/test":"^1.34.1","@types/debug":"^4.1.7","@types/eslint":"^8","@types/node":"^20.6.3","@types/request":"^2.48.8","@typescript-eslint/eslint-plugin":"^6.7.0","@typescript-eslint/parser":"^6.7.0","eslint":"^8.49.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.1","eslint-plugin-jsdoc":"^46.6.0","eslint-plugin-no-null":"^1.0.2","eslint-plugin-prefer-arrow":"^1.2.3","jest":"^29.5.0","prettier":"^3.0.1","properties":"^1.2.1","rimraf":"^5.0.1","typescript":"^5.2.2"},"dependencies":{"testit-js-commons":"3.2.11-TMS-5.4"},"_id":"@demin97sergey/testit-adapter-playwright@3.2.11-TMS-5.4","gitHead":"ac51e46e36227de355e2fbdaa67a1ea080c20f14","bugs":{"url":"https://github.com/testit-tms/adapters-js/issues"},"homepage":"https://github.com/testit-tms/adapters-js#readme","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-1j0e6IVoOJexExgphgd5CjCRUk6ptQGifF0PcuIyGJOdv55B11CVjtCjV1M8yAwz4dOmsHHYdFRZOQ4MMzgcow==","shasum":"e7773c9c767bdc2d61da45c592a3674ecda44f91","tarball":"https://registry.npmjs.org/@demin97sergey/testit-adapter-playwright/-/testit-adapter-playwright-3.2.11-TMS-5.4.tgz","fileCount":12,"unpackedSize":36641,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC7+EkXLZmoOdgoU1JjicAeapa9ZWRvoyHr+GDzhiRcBwIhAKHlKSMCJZtheE2QO4p25o8v2moGBQvf2192MfQYmvuJ"}]},"_npmUser":{"name":"demin97sergey","email":"sergey.demin1997@gmail.com"},"directories":{},"maintainers":[{"name":"demin97sergey","email":"sergey.demin1997@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/testit-adapter-playwright_3.2.11-TMS-5.4_1780579429827_0.8489044151106837"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T13:23:49.649Z","3.2.11-TMS-5.4":"2026-06-04T13:23:49.972Z","modified":"2026-06-04T13:23:50.202Z"},"maintainers":[{"name":"demin97sergey","email":"sergey.demin1997@gmail.com"}],"description":"Playwright adapter for Test IT","homepage":"https://github.com/testit-tms/adapters-js#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/testit-tms/adapters-js.git"},"author":{"name":"Integration team","email":"integrations@testit.software"},"bugs":{"url":"https://github.com/testit-tms/adapters-js/issues"},"license":"Apache-2.0","readme":"# Test IT TMS adapters for Playwright\n![Test IT](https://raw.githubusercontent.com/testit-tms/adapters-js/master/images/banner.png)\n\n## Getting Started\n\n### Installation\n```\nnpm install testit-adapter-playwright\n```\n\n## Usage\n\n### Configuration\n\n| Description                                                                                                                                                                                                                                                                                                                                                                            | File property                     | Environment variable                       |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|--------------------------------------------|\n| Location of the TMS instance                                                                                                                                                                                                                                                                                                                                                           | url                               | TMS_URL                                    |\n| API secret key [How to getting API secret key?](https://github.com/testit-tms/.github/tree/main/configuration#privatetoken)                                                                                                                                                                                                                                                            | privateToken                      | TMS_PRIVATE_TOKEN                          |\n| ID of project in TMS instance [How to getting project ID?](https://github.com/testit-tms/.github/tree/main/configuration#projectid)                                                                                                                                                                                                                                                    | projectId                         | TMS_PROJECT_ID                             |\n| ID of configuration in TMS instance [How to getting configuration ID?](https://github.com/testit-tms/.github/tree/main/configuration#configurationid)                                                                                                                                                                                                                                  | configurationId                   | TMS_CONFIGURATION_ID                       |\n| ID of the created test run in TMS instance.<br/>It's necessary for **adapterMode** 0 or 1                                                                                                                                                                                                                                                                                              | testRunId                         | TMS_TEST_RUN_ID                            |\n| Parameter for specifying the name of test run in TMS instance (**It's optional**). If it is not provided, it is created automatically                                                                                                                                                                                                                                                  | testRunName                       | TMS_TEST_RUN_NAME                          |\n| Adapter mode. Default value - 0. The adapter supports following modes:<br/>0 - in this mode, the adapter filters tests by test run ID and configuration ID, and sends the results to the test run<br/>1 - in this mode, the adapter sends all results to the test run without filtering<br/>2 - in this mode, the adapter creates a new test run and sends results to the new test run | adapterMode                       | TMS_ADAPTER_MODE                           |\n| It enables/disables certificate validation (**It's optional**). Default value - true                                                                                                                                                                                                                                                                                                   | certValidation                    | TMS_CERT_VALIDATION                        |\n| Mode of automatic creation test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will create a test case linked to the created autotest (not to the updated autotest)<br/>false - in this mode, the adapter will not create a test case                                                                    | automaticCreationTestCases        | TMS_AUTOMATIC_CREATION_TEST_CASES          |\n| Mode of automatic updation links to test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will update links to test cases<br/>false - in this mode, the adapter will not update link to test cases                                                                                                         | automaticUpdationLinksToTestCases | TMS_AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES |\n\nAdd Adapter to Playwright file configuration:\n\n```ts\nimport { PlaywrightTestConfig } from '@playwright/test';\n\nconst config: PlaywrightTestConfig = {\n  reporter: [\n    ['testit-adapter-playwright']\n  ],\n};\n\nexport default config;\n```\n\n#### File\n\nCreate .env config or file config with default name tms.config.json in the root directory of the project\n\n```json\n{\n  \"url\": \"URL\",\n  \"privateToken\": \"USER_PRIVATE_TOKEN\",\n  \"projectId\": \"PROJECT_ID\",\n  \"configurationId\": \"CONFIGURATION_ID\",\n  \"testRunId\": \"TEST_RUN_ID\",\n  \"testRunName\": \"TEST_RUN_NAME\",\n  \"adapterMode\": \"ADAPTER_MODE\",\n  \"automaticCreationTestCases\": \"AUTOMATIC_CREATION_TEST_CASES\",\n  \"automaticUpdationLinksToTestCases\": \"AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES\"\n}\n```\n\n#### Parallel run\nTo create and complete TestRun you can use the Test IT CLI (use adapterMode 1 for parallel run):\n\n```\n$ export TMS_TOKEN=<YOUR_TOKEN>\n$ testit testrun create\n  --url https://tms.testit.software \\\n  --project-id 5236eb3f-7c05-46f9-a609-dc0278896464 \\\n  --testrun-name \"New test run\" \\\n  --output tmp/output.txt\n\n$ export TMS_TEST_RUN_ID=$(cat tmp/output.txt)  \n\n$ npx playwright test\n\n$ testit testrun complete\n  --url https://tms.testit.software \\\n  --testrun-id $(cat tmp/output.txt) \n```\n\n#### Run with filter\nTo create filter by autotests you can use the Test IT CLI (use adapterMode 1 for run with filter):\n\n```\n$ export TMS_TOKEN=<YOUR_TOKEN>\n$ testit autotests_filter \n  --url https://tms.testit.software \\\n  --configuration-id 5236eb3f-7c05-46f9-a609-dc0278896464 \\\n  --testrun-id 6d4ac4b7-dd67-4805-b879-18da0b89d4a8 \\\n  --framework playwright \\\n  --output tmp/filter.txt\n\n$ export TMS_TEST_RUN_ID=6d4ac4b7-dd67-4805-b879-18da0b89d4a8\n$ export TMS_ADAPTER_MODE=1\n\n$ npx playwright test --grep \"$(cat tmp/filter.txt)\"\n```\n\n#### Launch using GitLab repository\nTo run your Playwright test's from GitLab to TestIT or in reverse order using \"testit-adapter-playwright\", you can take this .gitlab-ci.yml file example:\n\n```\nimage: node:latest\n\nstages:\n  - run\n\nfirst-job:\n  stage: run\n  script:\n    - npm install\n    - npx playwright test\n  artifacts:\n    paths:\n      - node_modules/\n```\n\n\n### Methods\n\nMethods can be used to specify information about autotest.\n\nDescription of metadata methods:\n- `testit.workItemIds` - linking an autotest to a test case\n- `testit.displayName` - name of the autotest in the Test IT system (can be replaced with documentation strings)\n- `testit.externalId` - ID of the autotest within the project in the Test IT System\n- `testit.title` - title in the autotest card\n- `testit.description` - description in the autotest card\n- `testit.labels` - tags in the work item\n- `testit.links` - links in the autotest card\n- `testit.namespace` - directory in the TMS system (default - directory's name of test)\n- `testit.classname` - subdirectory in the TMS system (default - file's name of test)\n\nDescription of methods:\n- `testit.addLinks` - links in the autotest result\n- `testit.addAttachments` - uploading files in the autotest result\n- `testit.addMessage` - information about autotest in the autotest result\n- `testit.step` - information about step in the autotest result\n\n### Examples\n\n#### Simple test\n```js\nimport { test } from \"@playwright/test\";\nimport { testit } from \"testit-adapter-playwright\";\n\ntest('All annotations', async () => {\n  testit.externalId('all_annotations');\n  testit.displayName('All annotations');\n  testit.title('All annotations title');\n  testit.description('Test with all annotations');\n  testit.labels(['label1', 'label2']);\n\n  testit.addMessage('This is a message');\n  testit.addLinks([\n    {\n      url: 'https://www.google.com',\n      title: 'Google',\n      description: 'This is a link to Google',\n      type: 'Related',\n    },\n  ]);\n\n  testit.addAttachment('file01.txt', 'Content', {contentType: \"text/markdown\",});\n\n  await testit.step(\"step with title\", async () => {\n  });\n});\n```\n\n#### Parameterized test\n```js\nconst people = ['Alice', 'Bob'];\nfor (const name of people) {\n  test(`testing with ${name}`, async () => {\n    testit.params(people);\n  });\n}\n```\n\n#### Content types\n```\n  TEXT = \"text/plain\",\n  XML = \"application/xml\",\n  HTML = \"text/html\",\n  CSV = \"text/csv\",\n  TSV = \"text/tab-separated-values\",\n  CSS = \"text/css\",\n  URI = \"text/uri-list\",\n  SVG = \"image/svg+xml\",\n  PNG = \"image/png\",\n  JSON = \"application/json\",\n  ZIP = \"application/zip\",\n  WEBM = \"video/webm\",\n  JPEG = \"image/jpeg\",\n  MP4 = \"video/mp4\",\n```\n\n# Contributing\n\nYou can help to develop the project. Any contributions are **greatly appreciated**.\n\n* If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/testit-tms/adapters-js/issues/new) to discuss it, or directly create a pull request after you edit the *README.md* file with necessary changes.\n* Please make sure you check your spelling and grammar.\n* Create individual PR for each suggestion.\n* Please also read through the [Code Of Conduct](https://github.com/testit-tms/adapters-js/blob/master/CODE_OF_CONDUCT.md) before posting your first idea as well.\n\n# License\n\nDistributed under the Apache-2.0 License. See [LICENSE](https://github.com/testit-tms/adapters-js/blob/master/LICENSE.md) for more information.\n\n","readmeFilename":"README.md","_rev":"1-7496259df8170721eda1143bc00f8d2e"}