Set up Running Playwright Test in BuildWise CT Server

How to run Playwright Test in BuildWise, a Continuous Testing server

Courtney Zhan
4 min readDec 30, 2023

This article shows you how to set up running Playwrigt Test (JS) on a Continuous Testing (CT) server, BuildWise. BuildWise Server works on all major platform, here I used macOS.

1. Prerequisite: Install Node.js, Playwright Test libraries

First of all, you need to install Node.js.

Install the @playwright/test package, this includes Playwright and its test runner.

npm install --global @playwright/test

Then, install its browser drivers.

npx playwright install

You will see an output like below:

Downloading Chromium 120.0.6099.28 (playwright build v1091) from https://playwright.azureedge.net/builds/chromium/1091/chromium-mac.zip
140.3 Mb [====================] 100% 0.0s
Chromium 120.0.6099.28 (playwright build v1091) downloaded to /Users/courtney/Library/Caches/ms-playwright/chromium-1091
Downloading FFMPEG playwright build v1009 from https://playwright.azureedge.net/builds/ffmpeg/1009/ffmpeg-mac.zip
1.1 Mb [====================] 100% 0.0s
FFMPEG playwright build v1009 downloaded to /Users/courtney/Library/Caches/ms-playwright/ffmpeg-1009
Downloading Firefox 119.0 (playwright build v1429) from https://playwright.azureedge.net/builds/firefox/1429/firefox-mac-13.zip
78.4 Mb [====================] 100% 0.0s
Firefox 119.0 (playwright build v1429) downloaded to /Users/courtney/Library/Caches/ms-playwright/firefox-1429
Downloading Webkit 17.4 (playwright build v1944) from https://playwright.azureedge.net/builds/webkit/1944/webkit-mac-13.zip
65.8 Mb [====================] 100% 0.0s
Webkit 17.4 (playwright build v1944) downloaded to /Users/courtney/Library/Caches/ms-playwright/webkit-1944

2. Verify Test Execution Setup

I have a habit of immediately verifying the operation. Execute the following commands in a terminal.

% cd 
% git clone https://github.com/testwisely/buildwise-samples

If you don’t use Git (for version control), I highly encourage learning it, and it is quite easy to use. Check out the 10-Minute Guide to Git Version Control for Testers.

You will find a set of folders and files under buildwise-samples. Go to that folder in your terminal. Then, in the same terminal window, run these three commands (one by one).

% cd buildwise-samples/e2e-playwright-test-refactored
% npm install

# run single test
% npx playwright test tests/login.spec.ts --headed

# run all tests
% npx playwright test --headed

You should see a Chromium browser open and run tests.

3. Install and run BuildWise Server

Then, install BuildWise, a CT server. You can follow this article’s 3rd and 4th steps to install and run the server.

> ./start-demo.sh

Log in, with the default password ( admin / buildwise ).

4. Set Up the Playwright Test Build Project in BuildWise

Fill in details for your new project (I am using the sample Playwright Test one in the above’s GitHub repo). You can do this quickly via the “Fill demo project” drop down.

My final “Create Project” settings are below, note the test framework on the bottom-right is Playwright Test.

Pay special attention to the Working folder: , which is where you cloned the test project to.

Click the “Create” button.

Verify the Project’s Settings

In some BuildWise versions, the test framework is not saved properly. Click on the project’s name to view the project settings. Then, under Build Steps, make sure the framework is “Playwright Test (JS)”.

Let’s kick off a build by clicking the ‘Build Now’ button.

After a few seconds of waiting, you shall see launching the Chromnium browser and executes tests in it.

A successful build with test reports.

--

--

No responses yet