0.24.0 • Published 12 days ago

@wordpress/e2e-test-utils-playwright v0.24.0

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
12 days ago

E2E Test Utils

End-To-End (E2E) Playwright test utils for WordPress.

It works properly with the minimum version of Gutenberg 9.2.0 or the minimum version of WordPress 5.6.0.

Installation

Install the module

npm install @wordpress/e2e-test-utils-playwright --save-dev

Note: This package requires Node.js 12.0.0 or later. It is not compatible with older versions.

API

test

The extended Playwright's test module with the admin, editor, pageUtils and the requestUtils fixtures.

expect

The Playwright/Jest's expect function.

Admin

End to end test utilities for WordPress admin's user interface.

const admin = new Admin( { page, pageUtils } );
await admin.visitAdminPage( 'options-general.php' );

Editor

End to end test utilities for the WordPress Block Editor.

To use these utilities, instantiate them within each test file:

test.use( {
	editor: async ( { page }, use ) => {
		await use( new Editor( { page } ) );
	},
} );

Within a test or test utility, use the canvas property to select elements within the iframe canvas:

await editor.canvas.locator( 'role=document[name="Paragraph block"i]' )

PageUtils

Generic Playwright utilities for interacting with web pages.

const pageUtils = new PageUtils( { page } );
await pageUtils.pressKeys( 'primary+a' );

RequestUtils

Playwright utilities for interacting with the WordPress REST API.

Create a request utils instance.

const requestUtils = await RequestUtils.setup( {
	user: {
		username: 'admin',
		password: 'password',
	},
} );

Contributing to this package

This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to npm and used by WordPress as well as other software projects.

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

0.24.0

12 days ago

0.23.0

29 days ago

0.22.0

1 month ago

0.21.0

2 months ago

0.19.2

2 months ago

0.20.0

2 months ago

0.19.1

2 months ago

0.19.0

3 months ago

0.18.0

3 months ago

0.17.0

4 months ago

0.16.0

5 months ago

0.10.9

6 months ago

0.11.0

7 months ago

0.10.1

7 months ago

0.12.0

7 months ago

0.10.2

7 months ago

0.13.0

6 months ago

0.10.3

7 months ago

0.14.0

6 months ago

0.10.4

7 months ago

0.15.0

5 months ago

0.10.10

6 months ago

0.10.5

7 months ago

0.10.11

6 months ago

0.10.6

7 months ago

0.10.12

6 months ago

0.10.7

7 months ago

0.10.13

6 months ago

0.10.8

7 months ago

0.10.0

7 months ago

0.9.0

8 months ago

0.8.1

9 months ago

0.8.0

9 months ago

0.5.0

10 months ago

0.3.2

10 months ago

0.4.0

10 months ago

0.7.0

9 months ago

0.3.3

7 months ago

0.6.0

10 months ago

0.3.1

10 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.0

12 months ago