diff --git a/pages/test_analytics.md b/pages/test_analytics.md index 40e574f2a4..971f5674b9 100644 --- a/pages/test_analytics.md +++ b/pages/test_analytics.md @@ -22,8 +22,9 @@ Test Analytics helps you track and analyze the steps in that pipeline that invol <%= button ":rspec: RSpec", "/docs/test-analytics/ruby-collectors#rspec-collector" %> <%= button ":ruby: minitest", "/docs/test-analytics/ruby-collectors#minitest-collector" %> <%= button ":jest: Jest", "/docs/test-analytics/javascript-collectors#configure-the-test-framework-jest" %> - <%= button ":mocha: Mocha", "/docs/test-analytics/javascript-collectors#configure-the-test-framework-mocha-collector" %> - <%= button ":jasmine: Jasmine", "/docs/test-analytics/javascript-collectors#configure-the-test-framework-jasmine-collector" %> + <%= button ":mocha: Mocha", "/docs/test-analytics/javascript-collectors#configure-the-test-framework-mocha" %> + <%= button ":jasmine: Jasmine", "/docs/test-analytics/javascript-collectors#configure-the-test-framework-jasmine" %> + <%= button ":playwright: Playwright", "/docs/test-analytics/javascript-collectors#configure-the-test-framework-playwright" %> <%= button ":swift: Swift", "/docs/test-analytics/swift-collectors" %> <%= button ":android: Android", "/docs/test-analytics/android-collectors" %> <%= button ":pytest: pytest", "/docs/test-analytics/python-collectors" %> diff --git a/pages/test_analytics/javascript_collectors.md b/pages/test_analytics/javascript_collectors.md index 657908ffe8..48d0218f5d 100644 --- a/pages/test_analytics/javascript_collectors.md +++ b/pages/test_analytics/javascript_collectors.md @@ -5,6 +5,7 @@ To use Test Analytics with your JavaScript (npm) projects, use the :github: [`te - [Jest](https://jestjs.io/) - [Jasmine](https://jasmine.github.io/) - [Mocha](https://mochajs.org/) +- [Playwright](https://playwright.dev) You can also upload test results by importing [JSON](/docs/test-analytics/importing-json) or [JUnit XML](/docs/test-analytics/importing-junit-xml). @@ -44,7 +45,7 @@ With the test collector installed, you need to configure it in the test framewor ### Jest -If you're already using Jest, you can add `buildkite-collector/jest/reporter` to the list of reporters to collect test results into your Test Analytics dashboard. +If you're already using Jest, you can add `buildkite-test-collector/jest/reporter` to the list of reporters to collect test results into your Test Analytics dashboard. To configure Jest: @@ -57,7 +58,7 @@ To configure Jest: } ``` -### Jasmine collector +### Jasmine To configure Jasmine: @@ -80,7 +81,7 @@ To configure Jasmine: }); ``` -### Mocha collector +### Mocha To configure Mocha: @@ -120,6 +121,25 @@ To configure Mocha: } ``` +### Playwright + +If you're already using Playwright, you can add `buildkite-test-collector/playright/reporter` to the list of reporters to collect test results into your Test Analytics dashboard. + +To configure Playwright: + +1. Make sure Playwright runs with access to [CI environment variables](/docs/test-analytics/ci-environments). +1. Add `"buildkite-test-collector/playwright/reporter"` to [Playwright's `reporters` configuration array](https://playwright.dev/docs/test-reporters#multiple-reporters) (typically found in `playwright.config.js`): + + ```js + // playwright.config.js + { + "reporters": [ + ["line"], + ["buildkite-test-collector/playwright/reporter"] + ] + } + ``` + ## Save the changes When your collector is installed, commit and push your changes: