diff --git a/src/interfaces/FO/myAccount/myWishlists/index.ts b/src/interfaces/FO/myAccount/myWishlists/index.ts index 6cfec822..dd3b4653 100644 --- a/src/interfaces/FO/myAccount/myWishlists/index.ts +++ b/src/interfaces/FO/myAccount/myWishlists/index.ts @@ -3,6 +3,7 @@ import type {Page} from '@playwright/test'; export interface FoMyWishlistsPageInterface extends FOBasePagePageInterface { readonly pageTitle: string; + readonly wishlistListItemNthTitle: (nth: number) => string; countWishlists(page: Page): Promise; getWishlistName(page: Page, nth: number): Promise; diff --git a/src/interfaces/FO/myAccount/myWishlists/view.ts b/src/interfaces/FO/myAccount/myWishlists/view.ts index fbe3c82c..17968837 100644 --- a/src/interfaces/FO/myAccount/myWishlists/view.ts +++ b/src/interfaces/FO/myAccount/myWishlists/view.ts @@ -3,6 +3,8 @@ import type {Page} from '@playwright/test'; export interface FoMyWishlistsViewPageInterface extends FOBasePagePageInterface { readonly messageSuccessfullyRemoved: string; + readonly productListEmpty: string; + readonly productList: string; countProducts(page: Page): Promise; getProductAttribute(page: Page, nth: number, attribute: string): Promise; diff --git a/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts b/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts index 2152e0e5..1d471647 100644 --- a/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts +++ b/src/versions/develop/pages/FO/classic/myAccount/myWishlists/index.ts @@ -1,5 +1,6 @@ import {type FoMyWishlistsPageInterface} from '@interfaces/FO/myAccount/myWishlists'; import FOBasePage from '@pages/FO/FOBasePage'; +import {default as foClassicMyWishlistsViewPage} from '@versions/develop/pages/FO/classic/myAccount/myWishlists/view'; import type {Page} from 'playwright'; /** @@ -20,7 +21,7 @@ class MyWishlistsPage extends FOBasePage implements FoMyWishlistsPageInterface { private readonly wishlistListItemNthLink: (nth: number) => string; - private readonly wishlistListItemNthTitle: (nth: number) => string; + public readonly wishlistListItemNthTitle: (nth: number) => string; /** * @constructs @@ -70,6 +71,10 @@ class MyWishlistsPage extends FOBasePage implements FoMyWishlistsPageInterface { */ async goToWishlistPage(page: Page, nth: number): Promise { await page.locator(this.wishlistListItemNthLink(nth)).click(); + + if (await this.elementNotVisible(page, foClassicMyWishlistsViewPage.productListEmpty, 3000)) { + await this.elementVisible(page, foClassicMyWishlistsViewPage.productListEmpty, 3000) + } } /** diff --git a/src/versions/develop/pages/FO/classic/myAccount/myWishlists/view.ts b/src/versions/develop/pages/FO/classic/myAccount/myWishlists/view.ts index 5c2cb075..e71cbfec 100644 --- a/src/versions/develop/pages/FO/classic/myAccount/myWishlists/view.ts +++ b/src/versions/develop/pages/FO/classic/myAccount/myWishlists/view.ts @@ -8,12 +8,14 @@ import type {Page} from 'playwright'; * @class * @extends FOBasePage */ -class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface { +class WishlistViewPage extends FOBasePage implements FoMyWishlistsViewPageInterface { public readonly messageSuccessfullyRemoved: string; private readonly headerTitle: string; - private readonly productList: string; + public readonly productListEmpty: string; + + public readonly productList: string; private readonly productListItem: string; @@ -47,6 +49,7 @@ class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface // Selectors this.headerTitle = '#content-wrapper h1'; + this.productListEmpty = '.wishlist-list-empty'; this.productList = '.wishlist-products-list'; this.productListItem = `${this.productList} .wishlist-products-item`; this.productListItemNth = (nth: number) => `${this.productListItem}:nth-child(${nth})`; @@ -191,4 +194,5 @@ class WishlistPage extends FOBasePage implements FoMyWishlistsViewPageInterface } } -module.exports = new WishlistPage(); +export default new WishlistViewPage(); +module.exports = new WishlistViewPage();