E2E Tweaks - Stricter selector and smart wait (#48471)

* Strict selector

* Wait for element

* Add changefile(s) from automation for the following project(s): woocommerce

* Linter

* Tweak

* Use a different selector

* Tweak selector

* Wait for Delete Users to be visible

* Trigger CI

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Lucas 2024-06-13 16:07:00 -03:00 committed by GitHub
parent 2165bfd29f
commit 29ee0ab6cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
</details> Improve E2E selector by making it stricter. Wait for text due to AJAX call. <details> <summary>E2E test tweaks</summary>

View File

@ -171,6 +171,9 @@ for ( const productType of Object.keys( productData ) ) {
if ( productData[ productType ].shipping ) {
await test.step( 'add shipping details', async () => {
await page.getByRole( 'link', { name: 'Shipping' } ).click();
await expect(
page.getByText( 'Shipping class', { exact: true } )
).toBeVisible();
await page
.getByPlaceholder( '0' )
.fill( productData[ productType ].shipping.weight );

View File

@ -61,6 +61,10 @@ async function userDeletionTest( page, username ) {
} );
await test.step( 'confirm deletion', async () => {
await expect(
page.getByRole( 'heading', { name: 'Delete Users' } )
).toBeVisible();
await expect( page.getByText( `${ username }` ) ).toBeVisible();
await page.getByRole( 'button', { name: 'Confirm Deletion' } ).click();
} );