Skip to content

Commit 7deecd5

Browse files
committed
@pages/FO/classic/myAccount/myWishlists : Set the property wishlistListItem as public
1 parent 002ca30 commit 7deecd5

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

src/interfaces/FO/myAccount/myWishlists/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {Page} from '@playwright/test';
33

44
export 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>;

src/interfaces/FO/myAccount/myWishlists/view.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type {Page} from '@playwright/test';
33

44
export 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>;

src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {type FoMyWishlistsPageInterface} from '@interfaces/FO/myAccount/myWishlists';
22
import FOBasePage from '@pages/FO/FOBasePage';
3+
import {default as foClassicMyWishlistsViewPage} from '@versions/develop/pages/FO/classic/myAccount/myWishlists/view';
34
import 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
/**

src/versions/develop/pages/FO/classic/myAccount/myWishlists/view.ts

+7-3
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)