How do I configure an Azure DevOps pipeline to run Playwright tests on Ubuntu?


Configure Azure DevOps Pipeline for Playwright Tests on Ubuntu

First, install Playwright on your machine by running:

npm install playwright


yarn add playwright

Next, create a new pipeline in Azure DevOps and set it to run on Ubuntu.

Add Command Line Task

Create a new task in the pipeline, select "Command Line" as the task type, and enter the command to run your Playwright tests:

npx playwright test

Ensure that necessary environment variables are set correctly for your tests.

Install Required Browsers

Install any browsers required for testing, such as Chromium or Firefox:

sudo apt-get install chromium-browser


sudo apt-get install firefox

Configure Playwright

Include necessary configuration files like playwright.config.ts in your project and configure them according to your needs.

By following these steps, you'll be able to run your Playwright tests successfully in an Azure DevOps pipeline on Ubuntu. For more information on writing efficient Playwright test scripts, check out Tips for Writing Efficient Playwright Test Scripts.

Thank you!
Was this helpful?
Still have questions?

If you still have questions, please ask a question and I will try to answer it.

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.