File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,21 @@ import { Page } from 'playwright/test';
8
8
*/
9
9
import { isUIUnblocked } from './helpers' ;
10
10
11
- export const goToShop = async ( page : Page , pageNumber ?: number ) => {
11
+ export const goToShop = async (
12
+ page : Page ,
13
+ { pageNumber, currency } : { pageNumber ?: number ; currency ?: string } = { }
14
+ ) => {
15
+ let url = '/shop/' ;
16
+
12
17
if ( pageNumber ) {
13
- await page . goto ( `/shop/page/` + pageNumber , { waitUntil : 'load' } ) ;
14
- } else {
15
- await page . goto ( `/shop/` , { waitUntil : 'load' } ) ;
18
+ url += `page/${ pageNumber } /` ;
19
+ }
20
+
21
+ if ( currency ) {
22
+ url += `?currency=${ currency } ` ;
16
23
}
17
- } ;
18
24
19
- export const goToShopWithCurrency = async ( page : Page , currency : string ) => {
20
- await page . goto ( `/shop/?currency=${ currency } ` , { waitUntil : 'load' } ) ;
25
+ await page . goto ( url , { waitUntil : 'load' } ) ;
21
26
} ;
22
27
23
28
export const goToProductPageBySlug = async (
You can’t perform that action at this time.
0 commit comments