-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate 'Global styles sidebar' test to Playwright (#55045)
* Migrate 'Global styles sidebar' test to Playwright * Remove old test file
- Loading branch information
Showing
2 changed files
with
49 additions
and
45 deletions.
There are no files selected for viewing
45 changes: 0 additions & 45 deletions
45
packages/e2e-tests/specs/site-editor/global-styles-sidebar.test.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'Global styles sidebar', () => { | ||
test.beforeAll( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'emptytheme' ); | ||
} ); | ||
|
||
test.afterAll( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'twentytwentyone' ); | ||
} ); | ||
|
||
test.beforeEach( async ( { admin, editor } ) => { | ||
await admin.visitSiteEditor( { | ||
postId: 'emptytheme//index', | ||
postType: 'wp_template', | ||
} ); | ||
await editor.canvas.click( 'body' ); | ||
} ); | ||
|
||
test( 'should filter blocks list results', async ( { page } ) => { | ||
// Navigate to Styles -> Blocks. | ||
await page | ||
.getByRole( 'region', { name: 'Editor top bar' } ) | ||
.getByRole( 'button', { name: 'Styles' } ) | ||
.click(); | ||
await page | ||
.getByRole( 'region', { name: 'Editor settings' } ) | ||
.getByRole( 'button', { name: 'Blocks styles' } ) | ||
.click(); | ||
|
||
await page | ||
.getByRole( 'searchbox', { name: 'Search for blocks' } ) | ||
.fill( 'heading' ); | ||
|
||
// Matches both Heading and Table of Contents blocks. | ||
// The latter contains "heading" in its description. | ||
await expect( | ||
page.getByRole( 'button', { name: 'Heading block styles' } ) | ||
).toBeVisible(); | ||
await expect( | ||
page.getByRole( 'button', { | ||
name: 'Table of Contents block styles', | ||
} ) | ||
).toBeVisible(); | ||
} ); | ||
} ); |
f06e1a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in f06e1a8.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6409557506
📝 Reported issues:
/test/e2e/specs/site-editor/patterns.spec.js