Environment Management Tools

Introduction

E2E testing gets its name from the fact that it tests software by simulating an end user interacting with a test webserver/website running that software. This page discusses tools for implementing WooCommerce and WooCommerce extension E2E testing.

See our guide to learn how to set up a local environment for testing.


Docker

Docker provides a cross platform, light weight, loosely isolated environment called a container. The Docker community offers many packages which allow developers to create custom portable container images.

Both @woocommerce/e2e-environment and @wordpress/env use Docker containers to provide the test environment.

https://docs.docker.com/get-started/overview/


@woocommerce/e2e-environment

The WooCommerce E2E environment is an npm package that provides both a test environment and a test runner.

The test runner uses jest and Puppeteer to simulate users interacting with the site running in the test container.

The test environment is a Docker container. It uses WordPress CLI to initialize the container for E2E testing.

https://github.com/woocommerce/woocommerce/blob/trunk/tests/e2e/env/README.md


@wordpress/env

The WordPress environment package is a desktop development environment that includes both a development and a test environment. It uses Docker containers to power both environments. In E2E testing, it can be used as a substitute for the WooCommerce E2E environment container.

https://www.npmjs.com/package/@wordpress/env


WordPress CLI

WordPress CLI (WP CLI) is a command line tool for managing a WordPress site. It allows a user to do most maintenance tasks from the command line. It’s the tool @woocommerce/e2e-environment uses to add users, install plugins, and install the theme. See the WooCommerce E2E initialization script for example usage.

https://wp-cli.org/