-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate 'Post Title block' e2e tests to Playwright (#55297)
* Migrate 'Post Title block' e2e tests to Playwright Co-authored-by: Justin Ahinon <justiny.ahinon@gmail.com> Co-authored-by: Alvi Tazwar <55917380+alvitazwar@users.noreply.github.com>
- Loading branch information
1 parent
c0f7916
commit 0e2e554
Showing
2 changed files
with
36 additions
and
36 deletions.
There are no files selected for viewing
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,36 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'Post Title block', () => { | ||
test.beforeEach( async ( { admin } ) => { | ||
await admin.createNewPost(); | ||
} ); | ||
|
||
test( 'Can edit the post title', async ( { editor, page } ) => { | ||
await editor.insertBlock( { name: 'core/post-title' } ); | ||
|
||
// Add the post title | ||
await editor.canvas | ||
.getByRole( 'textbox', { | ||
name: 'Add title', | ||
} ) | ||
.fill( 'Just tweaking the post title' ); | ||
|
||
// Save the post draft and reload. | ||
await page.getByRole( 'button', { name: 'Save draft' } ).click(); | ||
await expect( | ||
page | ||
.getByRole( 'button', { name: 'Dismiss this notice' } ) | ||
.filter( { hasText: 'Draft saved' } ) | ||
).toBeVisible(); | ||
await page.reload(); | ||
|
||
const titleBlock = editor.canvas.getByRole( 'document', { | ||
name: 'Block: Title', | ||
} ); | ||
await expect( titleBlock ).toBeVisible(); | ||
await expect( titleBlock ).toHaveText( 'Just tweaking the post title' ); | ||
} ); | ||
} ); |
0e2e554
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 0e2e554.
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/6495125118
📝 Reported issues:
/test/e2e/specs/editor/various/writing-flow.spec.js