File tree Expand file tree Collapse file tree
interfaces/FO/myAccount/myWishlists
versions/develop/pages/FO/classic/myAccount/myWishlists Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type {Page} from '@playwright/test';
33
44export interface FoMyWishlistsPageInterface extends FOBasePagePageInterface {
55 readonly pageTitle : string ;
6+ readonly wishlistListItemNthTitle : ( nth : number ) => string ;
67
78 countWishlists ( page : Page ) : Promise < number > ;
89 getWishlistName ( page : Page , nth : number ) : Promise < string > ;
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import type {Page} from '@playwright/test';
33
44export interface FoMyWishlistsViewPageInterface extends FOBasePagePageInterface {
55 readonly messageSuccessfullyRemoved : string ;
6+ readonly productListEmpty : string ;
7+ readonly productList : string ;
68
79 countProducts ( page : Page ) : Promise < number > ;
810 getProductAttribute ( page : Page , nth : number , attribute : string ) : Promise < string | null > ;
Original file line number Diff line number Diff line change 11import { type FoMyWishlistsPageInterface } from '@interfaces/FO/myAccount/myWishlists' ;
22import FOBasePage from '@pages/FO/FOBasePage' ;
3+ import { default as foClassicMyWishlistsViewPage } from '@versions/develop/pages/FO/classic/myAccount/myWishlists/view' ;
34import type { Page } from 'playwright' ;
45
56/**
@@ -20,7 +21,7 @@ class MyWishlistsPage extends FOBasePage implements FoMyWishlistsPageInterface {
2021
2122 private readonly wishlistListItemNthLink : ( nth : number ) => string ;
2223
23- private readonly wishlistListItemNthTitle : ( nth : number ) => string ;
24+ public readonly wishlistListItemNthTitle : ( nth : number ) => string ;
2425
2526 /**
2627 * @constructs
@@ -70,6 +71,10 @@ class MyWishlistsPage extends FOBasePage implements FoMyWishlistsPageInterface {
7071 */
7172 async goToWishlistPage ( page : Page , nth : number ) : Promise < void > {
7273 await page . locator ( this . wishlistListItemNthLink ( nth ) ) . click ( ) ;
74+
75+ if ( await this . elementNotVisible ( page , foClassicMyWishlistsViewPage . productListEmpty , 3000 ) ) {
76+ await this . elementVisible ( page , foClassicMyWishlistsViewPage . productListEmpty , 3000 )
77+ }
7378 }
7479
7580 /**
Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ import type {Page} from 'playwright';
88 * @class
99 * @extends FOBasePage
1010 */
11- class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface {
11+ class WishlistViewPage extends FOBasePage implements FoMyWishlistsViewPageInterface {
1212 public readonly messageSuccessfullyRemoved : string ;
1313
1414 private readonly headerTitle : string ;
1515
16- private readonly productList : string ;
16+ public readonly productListEmpty : string ;
17+
18+ public readonly productList : string ;
1719
1820 private readonly productListItem : string ;
1921
@@ -47,6 +49,7 @@ class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface
4749
4850 // Selectors
4951 this . headerTitle = '#content-wrapper h1' ;
52+ this . productListEmpty = '.wishlist-list-empty' ;
5053 this . productList = '.wishlist-products-list' ;
5154 this . productListItem = `${ this . productList } .wishlist-products-item` ;
5255 this . productListItemNth = ( nth : number ) => `${ this . productListItem } :nth-child(${ nth } )` ;
@@ -191,4 +194,5 @@ class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface
191194 }
192195}
193196
194- module . exports = new WishlistPage ( ) ;
197+ export default new WishlistViewPage ( ) ;
198+ module . exports = new WishlistViewPage ( ) ;
You can’t perform that action at this time.
0 commit comments