File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed
specs/subscriptions/merchant Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,6 @@ describeif( shouldRunSubscriptionsTests && shouldRunActionSchedulerTests )(
29
29
const customerBillingConfig =
30
30
config . addresses [ 'subscriptions-customer' ] . billing ;
31
31
32
- let subscriptionId : string ;
33
-
34
32
test . beforeAll ( async ( { browser } , { project } ) => {
35
33
const { shopperPage } = await getShopper (
36
34
browser ,
@@ -48,10 +46,6 @@ describeif( shouldRunSubscriptionsTests && shouldRunActionSchedulerTests )(
48
46
await expect (
49
47
shopperPage . getByRole ( 'heading' , { name : 'Order received' } )
50
48
) . toBeVisible ( ) ;
51
-
52
- subscriptionId = await shopperPage
53
- . getByLabel ( 'View subscription number' )
54
- . innerText ( ) ;
55
49
} ) ;
56
50
57
51
test ( 'should renew a subscription with action scheduler' , async ( {
@@ -81,12 +75,8 @@ describeif( shouldRunSubscriptionsTests && shouldRunActionSchedulerTests )(
81
75
// Go to Subscriptions and verify the subscription renewal
82
76
await goToSubscriptions ( merchantPage ) ;
83
77
84
- const numericSubscriptionId = subscriptionId . substring ( 1 ) ;
85
-
86
78
await expect (
87
- merchantPage
88
- . locator ( `#order-${ numericSubscriptionId } ` )
89
- . getByRole ( 'cell' , { name : '2' , exact : true } )
79
+ merchantPage . getByRole ( 'cell' , { name : '2' , exact : true } )
90
80
) . toBeVisible ( ) ;
91
81
} ) ;
92
82
}
Original file line number Diff line number Diff line change @@ -10,3 +10,5 @@ export const products = {
10
10
SUBSCRIPTION_SIGNUP_FEE : 70 ,
11
11
SUBSCRIPTION_NO_SIGNUP_FEE : 88 ,
12
12
} ;
13
+
14
+ export const wooCoreVersion = process . env . E2E_WC_VERSION ;
Original file line number Diff line number Diff line change 4
4
import { Page } from 'playwright/test' ;
5
5
import { dataHasLoaded } from './merchant' ;
6
6
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { wooCoreVersion } from './constants' ;
11
+
7
12
export const goToOrder = async ( page : Page , orderId : string ) => {
8
13
await page . goto (
9
14
`/wp-admin/admin.php?page=wc-orders&action=edit&id=${ orderId } ` ,
@@ -114,10 +119,15 @@ export const goToConnect = async ( page: Page ) => {
114
119
await dataHasLoaded ( page ) ;
115
120
} ;
116
121
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 , {
119
128
waitUntil : 'load' ,
120
129
} ) ;
130
+ } ;
121
131
122
132
export const goToSubscriptionPage = async (
123
133
page : Page ,
You can’t perform that action at this time.
0 commit comments