@@ -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,27 @@ 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
741
752
- if ( await this . isSidebarCollapsed ( page ) ) {
753
- await this . waitForHiddenSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
742
+ if ( semver . lt ( shopVersion , '7.4.0' ) ) {
743
+ await page . hover ( parentSelector ) ;
744
+ await this . clickAndWaitForURL ( page , linkSelector ) ;
754
745
} else {
755
- await this . waitForVisibleSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
746
+ await this . clickSubMenu ( page , parentSelector ) ;
747
+ await this . scrollTo ( page , linkSelector ) ;
748
+ await this . clickAndWaitForURL ( page , linkSelector ) ;
749
+ let linkActiveClass : string = '-active' ;
750
+
751
+ // >= 1.7.8.0
752
+ if ( semver . gte ( shopVersion , '7.8.0' ) ) {
753
+ linkActiveClass = 'link-active' ;
754
+ }
755
+
756
+ if ( await this . isSidebarCollapsed ( page ) ) {
757
+ await this . waitForHiddenSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
758
+ } else {
759
+ await this . waitForVisibleSelector ( page , `${ linkSelector } .${ linkActiveClass } ` ) ;
760
+ }
756
761
}
757
762
}
758
763
@@ -998,14 +1003,13 @@ export default class BOBasePage extends CommonPage implements BOBasePagePageInte
998
1003
const args = { selector : iFrameSelector , vl : value , hasP : hasParagraph } ;
999
1004
// eslint-disable-next-line no-eval
1000
1005
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
- })` ) ;
1006
+ async fnSetValueOnTinymceInput(args) {
1007
+ /* eslint-env browser */
1008
+ const iFrameElement = await document.querySelector(args.selector);
1009
+ const iFrameHtml = iFrameElement.contentDocument.documentElement;
1010
+ const textElement = await iFrameHtml.querySelector(args.hasP ? 'body p' : 'body');
1011
+ textElement.textContent = args.vl;
1012
+ }})` ) ;
1009
1013
await page . evaluate ( fn . fnSetValueOnTinymceInput , args ) ;
1010
1014
}
1011
1015
@@ -1031,15 +1035,14 @@ 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
- }
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'));
1041
1044
}
1042
- })` ) ;
1045
+ }} )` ) ;
1043
1046
await page . evaluate ( fn . fnSetValueOnDTPickerInput , args ) ;
1044
1047
}
1045
1048
0 commit comments