Skip to content

Commit 55708e7

Browse files
Merge branch 'dev/10238-update-e2e-tests-all-workflow' of https://github.com/Automattic/woocommerce-payments into dev/10238-update-e2e-tests-all-workflow
2 parents 232ca49 + 4443a72 commit 55708e7

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew-action-scheduler.spec.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ describeif( shouldRunSubscriptionsTests && shouldRunActionSchedulerTests )(
2929
const customerBillingConfig =
3030
config.addresses[ 'subscriptions-customer' ].billing;
3131

32-
let subscriptionId: string;
33-
3432
test.beforeAll( async ( { browser }, { project } ) => {
3533
const { shopperPage } = await getShopper(
3634
browser,
@@ -48,10 +46,6 @@ describeif( shouldRunSubscriptionsTests && shouldRunActionSchedulerTests )(
4846
await expect(
4947
shopperPage.getByRole( 'heading', { name: 'Order received' } )
5048
).toBeVisible();
51-
52-
subscriptionId = await shopperPage
53-
.getByLabel( 'View subscription number' )
54-
.innerText();
5549
} );
5650

5751
test( 'should renew a subscription with action scheduler', async ( {
@@ -81,12 +75,8 @@ describeif( shouldRunSubscriptionsTests && shouldRunActionSchedulerTests )(
8175
// Go to Subscriptions and verify the subscription renewal
8276
await goToSubscriptions( merchantPage );
8377

84-
const numericSubscriptionId = subscriptionId.substring( 1 );
85-
8678
await expect(
87-
merchantPage
88-
.locator( `#order-${ numericSubscriptionId }` )
89-
.getByRole( 'cell', { name: '2', exact: true } )
79+
merchantPage.getByRole( 'cell', { name: '2', exact: true } )
9080
).toBeVisible();
9181
} );
9282
}

tests/e2e-pw/utils/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ export const products = {
1010
SUBSCRIPTION_SIGNUP_FEE: 70,
1111
SUBSCRIPTION_NO_SIGNUP_FEE: 88,
1212
};
13+
14+
export const wooCoreVersion = process.env.E2E_WC_VERSION;

tests/e2e-pw/utils/merchant-navigation.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
import { Page } from 'playwright/test';
55
import { dataHasLoaded } from './merchant';
66

7+
/**
8+
* Internal dependencies
9+
*/
10+
import { wooCoreVersion } from './constants';
11+
712
export const goToOrder = async ( page: Page, orderId: string ) => {
813
await page.goto(
914
`/wp-admin/admin.php?page=wc-orders&action=edit&id=${ orderId }`,
@@ -114,10 +119,15 @@ export const goToConnect = async ( page: Page ) => {
114119
await dataHasLoaded( page );
115120
};
116121

117-
export const goToSubscriptions = async ( page: Page ) =>
118-
await page.goto( '/wp-admin/admin.php?page=wc-orders--shop_subscription', {
122+
export const goToSubscriptions = async ( page: Page ) => {
123+
const subscriptionsUrl =
124+
wooCoreVersion === '7.7.0'
125+
? '/wp-admin/edit.php?post_type=shop_subscription'
126+
: '/wp-admin/admin.php?page=wc-orders--shop_subscription';
127+
await page.goto( subscriptionsUrl, {
119128
waitUntil: 'load',
120129
} );
130+
};
121131

122132
export const goToSubscriptionPage = async (
123133
page: Page,

0 commit comments

Comments
 (0)