@@ -617,7 +617,7 @@ export default class BOBasePage extends CommonPage implements BOBasePagePageInte
617
617
618
618
// Symfony Toolbar
619
619
this . sfToolbarMainContentDiv = "div[id*='sfToolbarMainContent']" ;
620
- this . sfCloseToolbarLink = "[id*='sfToolbarHideButton']" ;
620
+ this . sfCloseToolbarLink = "[id*='sfToolbarHideButton'], a.hide-button " ;
621
621
622
622
// Sidebar
623
623
this . rightSidebar = '#right-sidebar' ;
@@ -638,7 +638,7 @@ export default class BOBasePage extends CommonPage implements BOBasePagePageInte
638
638
* @param page {Page} Browser tab
639
639
* @returns {Promise<string> }
640
640
*/
641
- async getShopVersion ( page :Page ) :Promise < string > {
641
+ async getShopVersion ( page : Page ) : Promise < string > {
642
642
return this . getTextContent ( page , this . shopVersion ) ;
643
643
}
644
644
@@ -737,22 +737,26 @@ export default class BOBasePage extends CommonPage implements BOBasePagePageInte
737
737
* @returns {Promise<void> }
738
738
*/
739
739
async goToSubMenu ( page : Page , parentSelector : string , linkSelector : string ) : Promise < void > {
740
- await this . clickSubMenu ( page , parentSelector ) ;
741
- await this . scrollTo ( page , linkSelector ) ;
742
- await this . clickAndWaitForURL ( page , linkSelector ) ;
743
-
744
740
const shopVersion = testContext . getPSVersion ( ) ;
745
- let linkActiveClass : string = '-active' ;
746
-
747
- // >= 1.7.8.0
748
- if ( semver . gte ( shopVersion , '7.8.0' ) ) {
749
- linkActiveClass = 'link-active' ;
750
- }
751
-
752
- if ( await this . isSidebarCollapsed ( page ) ) {
753
- await this . waitForHiddenSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
741
+ if ( semver . lt ( shopVersion , '7.4.0' ) ) {
742
+ await page . hover ( parentSelector ) ;
743
+ await this . clickAndWaitForURL ( page , linkSelector ) ;
754
744
} else {
755
- await this . waitForVisibleSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
745
+ await this . clickSubMenu ( page , parentSelector ) ;
746
+ await this . scrollTo ( page , linkSelector ) ;
747
+ await this . clickAndWaitForURL ( page , linkSelector ) ;
748
+ let linkActiveClass : string = '-active' ;
749
+
750
+ // >= 1.7.8.0
751
+ if ( semver . gte ( shopVersion , '7.8.0' ) ) {
752
+ linkActiveClass = 'link-active' ;
753
+ }
754
+
755
+ if ( await this . isSidebarCollapsed ( page ) ) {
756
+ await this . waitForHiddenSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
757
+ } else {
758
+ await this . waitForVisibleSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
759
+ }
756
760
}
757
761
}
758
762
@@ -998,14 +1002,14 @@ export default class BOBasePage extends CommonPage implements BOBasePagePageInte
998
1002
const args = { selector : iFrameSelector , vl : value , hasP : hasParagraph } ;
999
1003
// eslint-disable-next-line no-eval
1000
1004
const fn : { fnSetValueOnTinymceInput : PageFunction < { selector : string , vl : string , hasP : boolean } , void > } = eval ( `({
1001
- async fnSetValueOnTinymceInput(args) {
1002
- /* eslint-env browser */
1003
- const iFrameElement = await document.querySelector(args.selector);
1004
- const iFrameHtml = iFrameElement.contentDocument.documentElement;
1005
- const textElement = await iFrameHtml.querySelector(args.hasP ? 'body p' : 'body');
1006
- textElement.textContent = args.vl;
1007
- }
1008
- })`) ;
1005
+ async fnSetValueOnTinymceInput(args) {
1006
+ /* eslint-env browser */
1007
+ const iFrameElement = await document.querySelector(args.selector);
1008
+ const iFrameHtml = iFrameElement.contentDocument.documentElement;
1009
+ const textElement = await iFrameHtml.querySelector(args.hasP ? 'body p' : 'body');
1010
+ textElement.textContent = args.vl;
1011
+ }
1012
+ })`) ;
1009
1013
await page . evaluate ( fn . fnSetValueOnTinymceInput , args ) ;
1010
1014
}
1011
1015
@@ -1031,15 +1035,15 @@ export default class BOBasePage extends CommonPage implements BOBasePagePageInte
1031
1035
const args = { selector, value, onChange} ;
1032
1036
// eslint-disable-next-line no-eval
1033
1037
const fn : { fnSetValueOnDTPickerInput : PageFunction < { selector : string , value : string , onChange : boolean } , void > } = eval ( `({
1034
- async fnSetValueOnDTPickerInput(args) {
1035
- /* eslint-env browser */
1036
- const textElement = await document.querySelector(args.selector);
1037
- textElement.value = args.value;
1038
- if (args.onChange) {
1039
- textElement.dispatchEvent(new Event('change'));
1040
- }
1041
- }
1042
- })`) ;
1038
+ async fnSetValueOnDTPickerInput(args) {
1039
+ /* eslint-env browser */
1040
+ const textElement = await document.querySelector(args.selector);
1041
+ textElement.value = args.value;
1042
+ if (args.onChange) {
1043
+ textElement.dispatchEvent(new Event('change'));
1044
+ }
1045
+ }
1046
+ })`) ;
1043
1047
await page . evaluate ( fn . fnSetValueOnDTPickerInput , args ) ;
1044
1048
}
1045
1049
0 commit comments