@@ -5,15 +5,16 @@ import {
55 dataCustomers ,
66 dataModules ,
77 dataProducts ,
8- foClassicHomePage ,
9- foClassicLoginPage ,
10- foClassicModalWishlistPage ,
11- foClassicMyWishlistsViewPage ,
12- foClassicProductPage ,
13- foClassicSearchResultsPage ,
8+ foHomePage ,
9+ foLoginPage ,
10+ foModalWishlistPage ,
11+ foMyWishlistsViewPage ,
12+ foProductPage ,
13+ foSearchResultsPage ,
1414 modBlockwishlistBoMain ,
1515 utilsTest ,
1616} from '@prestashop-core/ui-testing' ;
17+ import semver from 'semver' ;
1718
1819import { test , expect , Page , BrowserContext } from '@playwright/test' ;
1920
@@ -64,6 +65,16 @@ test.describe('Wishlist module - Reset module', () => {
6465 expect ( isModuleVisible ) . toBeTruthy ( ) ;
6566 } ) ;
6667
68+ // >= 9.1.x : Hummingbird is enabled, but blockwishlist is disabled
69+ if ( semver . gte ( utilsTest . getPSVersion ( ) , '9.1.0' ) ) {
70+ test ( `should enable the module ${ dataModules . blockwishlist . name } ` , async ( ) => {
71+ await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'searchModule' , baseContext ) ;
72+
73+ const textResult = await boModuleManagerPage . setActionInModule ( page , dataModules . blockwishlist , 'enable' ) ;
74+ expect ( textResult ) . toEqual ( boModuleManagerPage . enableModuleSuccessMessage ( dataModules . blockwishlist . tag ) ) ;
75+ } ) ;
76+ }
77+
6778 test ( 'should display the reset modal and cancel it' , async ( ) => {
6879 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'resetModuleAndCancel' , baseContext ) ;
6980
@@ -109,53 +120,53 @@ test.describe('Wishlist module - Reset module', () => {
109120 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'goToFo' , baseContext ) ;
110121
111122 page = await modBlockwishlistBoMain . viewMyShop ( page ) ;
112- await foClassicHomePage . changeLanguage ( page , 'en' ) ;
123+ await foHomePage . changeLanguage ( page , 'en' ) ;
113124
114- const isHomePage = await foClassicHomePage . isHomePage ( page ) ;
125+ const isHomePage = await foHomePage . isHomePage ( page ) ;
115126 expect ( isHomePage ) . toBeTruthy ( ) ;
116127 } ) ;
117128
118129 test ( 'should go to login page' , async ( ) => {
119130 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'goToLoginPageFO' , baseContext ) ;
120131
121- await foClassicHomePage . goToLoginPage ( page ) ;
132+ await foHomePage . goToLoginPage ( page ) ;
122133
123- const pageTitle = await foClassicLoginPage . getPageTitle ( page ) ;
124- expect ( pageTitle ) . toContain ( foClassicLoginPage . pageTitle ) ;
134+ const pageTitle = await foLoginPage . getPageTitle ( page ) ;
135+ expect ( pageTitle ) . toContain ( foLoginPage . pageTitle ) ;
125136 } ) ;
126137
127138 test ( 'should sign in with default customer' , async ( ) => {
128139 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'sighInFO' , baseContext ) ;
129140
130- await foClassicLoginPage . customerLogin ( page , dataCustomers . johnDoe ) ;
141+ await foLoginPage . customerLogin ( page , dataCustomers . johnDoe ) ;
131142
132- const isCustomerConnected = await foClassicLoginPage . isCustomerConnected ( page ) ;
143+ const isCustomerConnected = await foLoginPage . isCustomerConnected ( page ) ;
133144 expect ( isCustomerConnected ) . toBeTruthy ( ) ;
134145 } ) ;
135146
136147 test ( `should search the product ${ dataProducts . demo_3 . name } ` , async ( ) => {
137148 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'searchProductDemo3' , baseContext ) ;
138149
139- await foClassicMyWishlistsViewPage . searchProduct ( page , dataProducts . demo_3 . name ) ;
140- await foClassicSearchResultsPage . goToProductPage ( page , 1 ) ;
150+ await foMyWishlistsViewPage . searchProduct ( page , dataProducts . demo_3 . name ) ;
151+ await foSearchResultsPage . goToProductPage ( page , 1 ) ;
141152
142- const pageTitle = await foClassicProductPage . getPageTitle ( page ) ;
153+ const pageTitle = await foProductPage . getPageTitle ( page ) ;
143154 expect ( pageTitle ) . toEqual ( dataProducts . demo_3 . name ) ;
144155 } ) ;
145156
146157 test ( 'should add to the wishlist and get the label' , async ( ) => {
147158 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'addToWishlist1' , baseContext ) ;
148159
149- await foClassicProductPage . clickAddToWishlistButton ( page ) ;
160+ await foProductPage . clickAddToWishlistButton ( page ) ;
150161
151- const textResult = await foClassicModalWishlistPage . getModalAddToCreateWislistLabel ( page ) ;
162+ const textResult = await foModalWishlistPage . getModalAddToCreateWislistLabel ( page ) ;
152163 expect ( textResult ) . toContain ( labelButton ) ;
153164 } ) ;
154165
155166 test ( 'should return to \'Modules > Module Manager\' page' , async ( ) => {
156167 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'goToModuleManagerPageForReset' , baseContext ) ;
157168
158- page = await foClassicModalWishlistPage . changePage ( browserContext , 0 ) ;
169+ page = await foModalWishlistPage . changePage ( browserContext , 0 ) ;
159170 await boDashboardPage . goToSubMenu (
160171 page ,
161172 boDashboardPage . modulesParentLink ,
@@ -185,10 +196,10 @@ test.describe('Wishlist module - Reset module', () => {
185196 await utilsTest . addContextItem ( test . info ( ) , 'testIdentifier' , 'addToWishlist2' , baseContext ) ;
186197
187198 page = await boModuleManagerPage . changePage ( browserContext , 1 ) ;
188- await foClassicProductPage . reloadPage ( page ) ;
189- await foClassicProductPage . clickAddToWishlistButton ( page ) ;
199+ await foProductPage . reloadPage ( page ) ;
200+ await foProductPage . clickAddToWishlistButton ( page ) ;
190201
191- const textResult = await foClassicModalWishlistPage . getModalAddToCreateWislistLabel ( page ) ;
202+ const textResult = await foModalWishlistPage . getModalAddToCreateWislistLabel ( page ) ;
192203 expect ( textResult ) . toContain ( modBlockwishlistBoMain . defaultValueCreateButtonLabel ) ;
193204 } ) ;
194205} ) ;
0 commit comments