Skip to content

Commit

Permalink
Migrate style variation test to Playwright (#40216)
Browse files Browse the repository at this point in the history
* Create style-variation.spec.js

* Delete original test file

* Update style-variation.spec.js

* Update style-variation.spec.js

* Update style-variation.spec.js

* Update style-variation.spec.js

* Update style-variation.spec.js

* Update test/e2e/specs/editor/various/style-variation.spec.js

Co-authored-by: Kai Hao <[email protected]>

Co-authored-by: Kai Hao <[email protected]>
  • Loading branch information
JustinyAhin and kevin940726 authored Apr 11, 2022
1 parent f09a7b0 commit e6de706
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 36 deletions.
36 changes: 0 additions & 36 deletions packages/e2e-tests/specs/editor/various/style-variation.test.js

This file was deleted.

31 changes: 31 additions & 0 deletions test/e2e/specs/editor/various/style-variation.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* WordPress dependencies
*/
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

test.describe( 'adding blocks', () => {
test( 'Should switch to the plain style of the quote block', async ( {
page,
pageUtils,
} ) => {
await pageUtils.createNewPost();

// Inserting a quote block
await pageUtils.insertBlock( {
name: 'core/quote',
attributes: { value: '<p>Quote content</p>' },
} );

await pageUtils.clickBlockToolbarButton( 'Quote' );

await page.click( 'role=menuitem[name="Plain"i]' );

// Check the content
const content = await pageUtils.getEditedPostContent();
expect( content ).toBe(
`<!-- wp:quote {"className":"is-style-plain"} -->
<blockquote class="wp-block-quote is-style-plain"><p>Quote content</p></blockquote>
<!-- /wp:quote -->`
);
} );
} );

0 comments on commit e6de706

Please sign in to comment.