DDEV Webship-JS

The ddev-webship-js add-on integrates Webship-JS, a Playwright and Cucumber-JS automated functional acceptance testing framework, into DDEV projects. It lets you write end-to-end browser tests as plain-language Gherkin .feature files and run them entirely inside the DDEV environment, so every team member gets the same browsers, Node version, and test configuration without installing anything on the host machine.

Installing the add-on scaffolds the required configuration files (including cucumber.js), creates a starter feature file under tests/features/, installs the Playwright browsers inside the containers, and restarts the DDEV project so everything is ready to run immediately.

Requirements

  • A working DDEV installation (Docker-based local development environment).
  • An existing DDEV project for the site you want to test.
  • No host-level Node.js or browser installation is needed: everything runs inside the DDEV containers.

Install

From the root of your DDEV project, add and configure the add-on with a single command:

ddev add-on get webship/ddev-webship-js

Then install the JavaScript dependencies with npm:

ddev npm install

Or, if your project uses yarn:

ddev yarn install

Usage

Write your scenarios in tests/features/*.feature using the standard webship-js step phrasings, for example:

Feature: Smoke test the portal

  Scenario: Home page loads and shows the welcome message
    Given I am on the homepage
    When I click "About"
    Then I should be on "/about"
     And I should see "About us"

Run the whole suite against a specific browser engine:

ddev npm run test:chromium
ddev npm run test:firefox
ddev npm run test:webkit

Or run a single feature file directly:

ddev exec npx cucumber-js --config cucumber.js tests/features/example.feature

Commands

CommandDescription
ddev add-on get webship/ddev-webship-jsInstall the add-on, scaffold configuration, install Playwright browsers, and restart the project.
ddev npm install / ddev yarn installInstall the Node.js test dependencies inside the DDEV environment.
ddev npm run test:chromium / ddev yarn test:chromiumRun all feature files with Chromium.
ddev npm run test:firefox / ddev yarn test:firefoxRun all feature files with Firefox.
ddev npm run test:webkit / ddev yarn test:webkitRun all feature files with WebKit.
ddev exec npx cucumber-js --config cucumber.js <path>Run one specific feature file or directory.

Back to Install Webship JS