woocommerce/packages/js/e2e-utils-playwright
github-actions[bot] b0b3666a5c
Prepare Packages for Release (#55181)
Automated change: Prep @woocommerce/e2e-utils-playwright for release.

Co-authored-by: adimoldovan <3854374+adimoldovan@users.noreply.github.com>
2025-02-06 12:30:05 +00:00
..
changelog Prepare Packages for Release (#55181) 2025-02-06 12:30:05 +00:00
src [e2e-utils-playwright] Tweaks for multisite setup compatibility (#55077) 2025-02-05 15:11:26 -08:00
.eslintrc.js [e2e-utils-playwright] Add linting configuration and fix errors (#52664) 2024-11-18 16:01:57 +02:00
babel.config.js [e2e tests] fix/playwright-utils-build: Adds build step to @woocommerce/e2e-playwright-utils (#53474) 2024-12-09 11:13:46 +00:00
CHANGELOG.md Prepare Packages for Release (#55181) 2025-02-06 12:30:05 +00:00
composer.json Prepare @woocommerce/e2e-utils-playwright for 0.1.0 release (#53058) 2024-11-21 20:12:59 +02:00
composer.lock
package.json Prepare Packages for Release (#55181) 2025-02-06 12:30:05 +00:00
README.md [e2e-utils-playwright] Add readme file with basic instructions (#52995) 2024-11-20 13:51:39 -08:00

End-to-End Test Utilities For WooCommerce

This package contains utilities to help writing e2e tests specific to WooCommerce using Playwright.

Warning

This package is still under active development. Documentation might not be up-to-date, and the 0.x version can introduce breaking changes.

Installation

npm install @woocommerce/e2e-utils-playwright --save-dev

Usage

Example:

import { addAProductToCart } from '@woocommerce/e2e-utils-playwright';

test('can add products to cart', async ({ page }) => {
  const product = {
    id: 1,
    name: 'Test Product',
  };

  await addAProductToCart(page, product.id);
  await page.goto('/cart/');

  await expect(page.locator('td.product-name')).toContainText(product.name);
});

Contributing to this package

This is an individual package that's part of the WooCommerce project, which is organized as a monorepo.

To find out more about contributing to this package or WooCommerce as a whole, please read the project's main contributor guide.