Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky E2E test #90860

Merged
merged 2 commits into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,16 @@ describe( 'Lifecyle: Signup, onboard, launch and cancel subscription', function

it( 'See secure payment', async function () {
cartCheckoutPage = new CartCheckoutPage( page );
await cartCheckoutPage.validateCartItem( `WordPress.com ${ newPlanName }` );
try {
// Check for either the "Beginner" or "Starter" plan while the name change experiment is in progress.
await Promise.any( [
cartCheckoutPage.validateCartItem( 'WordPress.com Beginner' ),
cartCheckoutPage.validateCartItem( `WordPress.com ${ newPlanName }` ),
] );
} catch ( error ) {
console.log( `Neither "Beginner" or "Starter" were found on the page.` );
throw error;
}
} );

it( 'Prices are shown in GBP', async function () {
Expand Down Expand Up @@ -231,11 +240,23 @@ describe( 'Lifecyle: Signup, onboard, launch and cancel subscription', function
it( 'View details of purchased plan', async function () {
purchasesPage = new PurchasesPage( page );

await purchasesPage.clickOnPurchase(
`WordPress.com ${ newPlanName }`,
newSiteDetails.blog_details.site_slug
);
await purchasesPage.purchaseAction( 'Cancel plan' );
try {
// Check for either the "Beginner" or "Starter" plan while the name change experiment is in progress.
await Promise.any( [
purchasesPage.clickOnPurchase(
'WordPress.com Beginner',
newSiteDetails.blog_details.site_slug
),
purchasesPage.clickOnPurchase(
`WordPress.com ${ newPlanName }`,
newSiteDetails.blog_details.site_slug
),
] );
await purchasesPage.purchaseAction( 'Cancel plan' );
} catch ( error ) {
console.log( `Neither "Beginner" nor "Starter" plan was found.` );
throw error;
}
} );

it( 'Cancel plan renewal', async function () {
Expand Down
Loading