@@ -22,7 +22,7 @@ export default class FOBasePage extends CommonPage implements FOBasePagePageInte
22
22
23
23
private readonly breadCrumb : string ;
24
24
25
- private readonly breadCrumbLink : ( link : string ) => string ;
25
+ private readonly breadCrumbLink : ( attributeSel : string , link : string ) => string ;
26
26
27
27
private readonly cartProductsCount : string ;
28
28
@@ -164,7 +164,7 @@ export default class FOBasePage extends CommonPage implements FOBasePagePageInte
164
164
this . desktopLogo = '#_desktop_logo' ;
165
165
this . desktopLogoLink = `${ this . desktopLogo } a` ;
166
166
this . breadCrumb = '#wrapper nav' ;
167
- this . breadCrumbLink = ( link ) => `${ this . breadCrumb } a[href*= ${ link } ]` ;
167
+ this . breadCrumbLink = ( attributeSel : string , link : string ) => `${ this . breadCrumb } a[href${ attributeSel } =" ${ link } " ]` ;
168
168
this . cartProductsCount = '#_desktop_cart .cart-products-count' ;
169
169
this . cartLink = '#_desktop_cart a' ;
170
170
this . userInfoLink = '#_desktop_user_info' ;
@@ -307,7 +307,7 @@ export default class FOBasePage extends CommonPage implements FOBasePagePageInte
307
307
async clickOnBreadCrumbLink ( page : Page , link : string ) : Promise < void > {
308
308
const currentUrl : string = page . url ( ) ;
309
309
310
- await page . locator ( this . breadCrumbLink ( link ) ) . first ( ) . click ( ) ;
310
+ await page . locator ( this . breadCrumbLink ( link === '/' ? '$' : '*' , link ) ) . first ( ) . click ( ) ;
311
311
await page . waitForURL ( ( url : URL ) : boolean => url . toString ( ) !== currentUrl , { waitUntil : 'networkidle' } ) ;
312
312
}
313
313
0 commit comments