Fix flaky connect to Woo e2e test (#48613)
This commit is contained in:
parent
0608eb7542
commit
3ea4df2055
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: dev
|
||||||
|
|
||||||
|
E2E tests: fixing flaky connect to woo test
|
|
@ -423,21 +423,28 @@ test.describe( 'Store owner can skip the core profiler', () => {
|
||||||
test( 'Can connect to WooCommerce.com', async ( { page } ) => {
|
test( 'Can connect to WooCommerce.com', async ( { page } ) => {
|
||||||
await test.step( 'Go to WC Home and make sure the connect button is visible', async () => {
|
await test.step( 'Go to WC Home and make sure the connect button is visible', async () => {
|
||||||
await page.goto( 'wp-admin/admin.php?page=wc-admin' );
|
await page.goto( 'wp-admin/admin.php?page=wc-admin' );
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole( 'heading', {
|
page.getByRole( 'heading', {
|
||||||
name: 'Connect to WooCommerce.com',
|
name: 'Connect to WooCommerce.com',
|
||||||
} )
|
} )
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await page
|
await page
|
||||||
.getByRole( 'link', { name: 'Connect', exact: true } )
|
.getByRole( 'menuitem', { name: 'Total sales' } )
|
||||||
.click();
|
.waitFor( { state: 'visible' } );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
await test.step( 'Ensure we are redirected to the correct URL and connect store', async () => {
|
await test.step( 'Click Connect and ensure we are redirected to the correct URL and connect store', async () => {
|
||||||
|
await page
|
||||||
|
.getByRole( 'link', { name: 'Connect', exact: true } )
|
||||||
|
.click();
|
||||||
await expect( page.url() ).toContain(
|
await expect( page.url() ).toContain(
|
||||||
'?page=wc-admin&tab=my-subscriptions&path=%2Fextensions'
|
'?page=wc-admin&tab=my-subscriptions&path=%2Fextensions'
|
||||||
);
|
);
|
||||||
|
await expect(
|
||||||
|
page.getByText(
|
||||||
|
'Hundreds of vetted products and services. Unlimited potential.'
|
||||||
|
)
|
||||||
|
).toBeVisible();
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole( 'button', { name: 'My Subscriptions' } )
|
page.getByRole( 'button', { name: 'My Subscriptions' } )
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
@ -451,6 +458,8 @@ test.describe( 'Store owner can skip the core profiler', () => {
|
||||||
|
|
||||||
await test.step( 'Check that we are sent to wp.com', async () => {
|
await test.step( 'Check that we are sent to wp.com', async () => {
|
||||||
await expect( page.url() ).toContain( 'wordpress.com/log-in' );
|
await expect( page.url() ).toContain( 'wordpress.com/log-in' );
|
||||||
|
// reload to avoid flaky blank page
|
||||||
|
await page.reload();
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole( 'heading', {
|
page.getByRole( 'heading', {
|
||||||
name: 'Log in to your account',
|
name: 'Log in to your account',
|
||||||
|
|
Loading…
Reference in New Issue