Skip to main content
No Result Found

Automated tests on Playwright (Node.js)

Quick start guide to integrate Automated tests in BrowserStack Accessibility Testing with Playwright (Node.js).

Prerequisites

  • You have an account with BrowserStack (even a free trial works) and can get your Username and Access Key from Account & Profile.
  • You have a pre-existing Playwright test suite integrated with BrowserStack Automate.
  • You use the Playwright test runner in your tests. The test variable used in writing the tests should be imported from @playwright/test.

Integrate with Automated tests

Follow these steps to get started with adding Automated tests to your test suite:

The minimum version of browserstack-node-sdk that supports Automated tests is 1.31.22.

Install or update to the latest version of BrowserStack Node SDK

Go to your Playwright project’s root directory and run the following commands to update or install the BrowserStack Node SDK and verify the installed version.

Terminal
Copy icon Copy

Create the browserstack.yml file

If you don’t already have a browserstack.yml file, run the following command to create one:

Terminal
Copy icon Copy

Set up the browserstack.yml file

Automated tests mandatorily needs the following five configurations in the browserstack.yml file. Especially, ensure to set the accessibility flag as true at the end of the browserstack.yml file.

browserstack.yml
Copy icon Copy

The projectName and buildName config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack Automate since Automated tests will automatically identify different build runs.

Accessibility testing runs only on Desktops (Mac & Windows) with Chrome 100 & above on Automate.

Run your suite with Automated tests

Prepend browserstack-node-sdk to the existing command that you use to trigger an automated build as follows

Terminal
Copy icon Copy


You can check the Accessibility report for your build through the Automated tests page.

Visit Automated tests page

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle