File tree 4 files changed +16
-4
lines changed
interfaces/FO/myAccount/myWishlists
versions/develop/pages/FO/classic/myAccount/myWishlists
4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type {Page} from '@playwright/test';
3
3
4
4
export interface FoMyWishlistsPageInterface extends FOBasePagePageInterface {
5
5
readonly pageTitle : string ;
6
+ readonly wishlistListItemNthTitle : ( nth : number ) => string ;
6
7
7
8
countWishlists ( page : Page ) : Promise < number > ;
8
9
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';
3
3
4
4
export interface FoMyWishlistsViewPageInterface extends FOBasePagePageInterface {
5
5
readonly messageSuccessfullyRemoved : string ;
6
+ readonly productListEmpty : string ;
7
+ readonly productList : string ;
6
8
7
9
countProducts ( page : Page ) : Promise < number > ;
8
10
getProductAttribute ( page : Page , nth : number , attribute : string ) : Promise < string | null > ;
Original file line number Diff line number Diff line change 1
1
import { type FoMyWishlistsPageInterface } from '@interfaces/FO/myAccount/myWishlists' ;
2
2
import FOBasePage from '@pages/FO/FOBasePage' ;
3
+ import { default as foClassicMyWishlistsViewPage } from '@versions/develop/pages/FO/classic/myAccount/myWishlists/view' ;
3
4
import type { Page } from 'playwright' ;
4
5
5
6
/**
@@ -20,7 +21,7 @@ class MyWishlistsPage extends FOBasePage implements FoMyWishlistsPageInterface {
20
21
21
22
private readonly wishlistListItemNthLink : ( nth : number ) => string ;
22
23
23
- private readonly wishlistListItemNthTitle : ( nth : number ) => string ;
24
+ public readonly wishlistListItemNthTitle : ( nth : number ) => string ;
24
25
25
26
/**
26
27
* @constructs
@@ -70,6 +71,10 @@ class MyWishlistsPage extends FOBasePage implements FoMyWishlistsPageInterface {
70
71
*/
71
72
async goToWishlistPage ( page : Page , nth : number ) : Promise < void > {
72
73
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
+ }
73
78
}
74
79
75
80
/**
Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ import type {Page} from 'playwright';
8
8
* @class
9
9
* @extends FOBasePage
10
10
*/
11
- class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface {
11
+ class WishlistViewPage extends FOBasePage implements FoMyWishlistsViewPageInterface {
12
12
public readonly messageSuccessfullyRemoved : string ;
13
13
14
14
private readonly headerTitle : string ;
15
15
16
- private readonly productList : string ;
16
+ public readonly productListEmpty : string ;
17
+
18
+ public readonly productList : string ;
17
19
18
20
private readonly productListItem : string ;
19
21
@@ -47,6 +49,7 @@ class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface
47
49
48
50
// Selectors
49
51
this . headerTitle = '#content-wrapper h1' ;
52
+ this . productListEmpty = '.wishlist-list-empty' ;
50
53
this . productList = '.wishlist-products-list' ;
51
54
this . productListItem = `${ this . productList } .wishlist-products-item` ;
52
55
this . productListItemNth = ( nth : number ) => `${ this . productListItem } :nth-child(${ nth } )` ;
@@ -191,4 +194,5 @@ class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface
191
194
}
192
195
}
193
196
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