Cucumber.js with Playwright Quickstart
saucectl -- the Sauce Labs test orchestrator CLI provides a way to run Cucumber.js tests with Playwright. In this case, Cucumber.js acts as the test framework, utilizing Playwright as the automation framework. Use
saucectl to run Cucumber-js with Playwright tests directly from your existing Cucumber.js Playwright project.
- Don't have Cucumber.js with Playwright tests but want to try? The Demo Repo includes a sample project structure, working configuration file, and sample Playwright test so you can get up and running in less than 10 minutes!
- Already running Cucumber.js with Playwright? Let
saucectlrun your tests in the Sauce Labs Cloud, where you have access to thousands of OS/browser combinations and Sauce Labs analytics.
What You'll Need
- A Sauce Labs account (if you don't have one, start a free trial)
- Your Sauce Labs Username and Access Key
- Node.js to use the NPM package manager
- A GitHub account
Step 1: Install
npm install -g saucectl
Step 2: Link Your Sauce Labs Account
saucectl requires access to a valid Sauce Labs account.
saucectl detects your Sauce Labs credentials environment variables and prioritizes them over values in the
credentials.yml file when both are present. If you have set them, you may skip this step. Not sure if you have them set? Run the following command to check:
If a value is returned for both variables, they are set.
Enter your Sauce Labs Username and Access Key at the prompts.
Step 3: Clone the Playwright Project
git clone https://github.com/saucelabs/saucectl-playwright-example.git
git clone firstname.lastname@example.org:saucelabs/saucectl-playwright-example.git
Step 4: Run Tests
Navigate to the root of the Cucumber.js example folder you just cloned, then use the
run command to execute the sample test included with the
The console displays the executing tests, distinguishing which mode is running.
The results and test assets are available immediately following test completion in your Sauce Labs account.