Migrate Adding Inline Token test to Playwright#50844
Migrate Adding Inline Token test to Playwright#50844pooja-muchandikar wants to merge 3 commits intoWordPress:trunkfrom
Conversation
|
Hi @kevin940726, I hope you are going great!.. Could you please help me in reviewing this PR? Thanks!! |
kevin940726
left a comment
There was a problem hiding this comment.
Thank you! Sorry for the late review! This is looking great though! Just a small suggestion 🙇♂️.
| // Check the content. | ||
| const regex = new RegExp( | ||
| `<!-- wp:paragraph -->\\s*<p>a <img class="wp-image-\\d+" style="width:\\s*10px;?" src="[^"]+\\/${ filename }\\.png" alt=""\\/?><\\/p>\\s*<!-- \\/wp:paragraph -->` | ||
| ); | ||
| expect( await getEditedPostContent() ).toMatch( regex ); | ||
| expect( await editor.getEditedPostContent() ).toMatch( regex ); |
There was a problem hiding this comment.
Let's instead do something like:
const contentRegex = new RegExp(
`a <img class="wp-image-\\d+" style="width:\\s*10px;?" src="[^"]+\\/${ filename }\\.png" alt=""\\/?>`
);
await expect.poll( editor.getBlocks ).toMatchObject( [ {
name: 'core/paragraph',
attributes: { content: expect.stringMatching( contentRegex ) }
} ] );| `<!-- wp:paragraph -->\\s*<p>a <img class="wp-image-\\d+" style="width:\\s*20px;?" src="[^"]+\\/${ filename }\\.png" alt=""\\/?><\\/p>\\s*<!-- \\/wp:paragraph -->` | ||
| ); | ||
| expect( await getEditedPostContent() ).toMatch( regex2 ); | ||
| expect( await editor.getEditedPostContent() ).toMatch( regex2 ); |
There was a problem hiding this comment.
Same here with a similar change.
|
Hi @kevin940726, I hope you are doing great! I have addressed all the feedbacks and pushed the code, but seems PR has some conflicts however, I am not able to see these conflicts in my local. Could you please help in resolve it from PR directly or should I create new PR with the suggested changes? |
|
Hi @kevin940726, So I have created new PR with all the changes/feedbacks being addressed - #52020 Please review and let me know if there are more suggestions! Thanks! |
What?
Part of #38851.
Migrate adding-inline-tokens.test.js to its Playwright version.
Why?
Part of #38851.
How?
See MIGRATION.md for migration steps.
Testing Instructions
Run
npm run test:e2e:playwright test/e2e/specs/editor/various/adding-inline-tokens.spec.js