@@ -25,7 +25,7 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
2525
2626 private readonly checkboxModuleForm : ( status : boolean ) => string ;
2727
28- private readonly messageModuleForm : ( idLang : number ) => string ;
28+ private readonly messageModuleForm : ( nth : number ) => string ;
2929
3030 private readonly saveButton : string ;
3131
@@ -45,7 +45,8 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
4545 + ' button.dropdown-toggle' ;
4646 this . btnDropdownItemLangModuleForm = ( idLang : number ) => `div.open ul.dropdown-menu a[data-id="${ idLang } "]` ;
4747 this . checkboxModuleForm = ( status : boolean ) => `input[id^="switch_registered_module_"]${ status ? '.yes' : '.no' } ` ;
48- this . messageModuleForm = ( idLang : number ) => `iframe[id^="psgdpr_registered_module_"][id$="_${ idLang } _ifr"]` ;
48+ this . messageModuleForm = ( nth : number ) => `div:nth-child(${ nth + 1 } of [id^="registered_module_message"]) `
49+ + 'div.translatable-field:not([style="display:none"]) iframe' ;
4950 this . saveButton = '#submitDataConsent' ;
5051 }
5152
@@ -112,7 +113,10 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
112113 * @returns {Promise<void> }
113114 */
114115 async setNewsletterMessage ( page : Page , message : string ) : Promise < void > {
115- await this . setTinyMCEInputValue ( page . frameLocator ( this . messageModuleForm ( dataLanguages . english . id ) ) . nth ( 0 ) , message ) ;
116+ await this . setTinyMCEInputValue (
117+ page . locator ( this . messageModuleForm ( 0 ) ) . contentFrame ( ) ,
118+ message ,
119+ ) ;
116120 }
117121
118122 /**
@@ -134,7 +138,10 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
134138 * @returns {Promise<void> }
135139 */
136140 async setContactFormMessage ( page : Page , message : string ) : Promise < void > {
137- await this . setTinyMCEInputValue ( page . frameLocator ( this . messageModuleForm ( dataLanguages . english . id ) ) . nth ( 2 ) , message ) ;
141+ await this . setTinyMCEInputValue (
142+ page . locator ( this . messageModuleForm ( 2 ) ) . contentFrame ( ) ,
143+ message ,
144+ ) ;
138145 }
139146
140147 /**
@@ -156,7 +163,10 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
156163 * @returns {Promise<void> }
157164 */
158165 async setProductCommentsMessage ( page : Page , message : string ) : Promise < void > {
159- await this . setTinyMCEInputValue ( page . frameLocator ( this . messageModuleForm ( dataLanguages . english . id ) ) . nth ( 1 ) , message ) ;
166+ await this . setTinyMCEInputValue (
167+ page . locator ( this . messageModuleForm ( 1 ) ) . contentFrame ( ) ,
168+ message ,
169+ ) ;
160170 }
161171
162172 /**
@@ -181,7 +191,7 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
181191 async setMailAlertsMessage ( page : Page , message : string , idLang : number = dataLanguages . english . id ) : Promise < void > {
182192 await page . locator ( this . btnDropdownLangModuleForm ) . nth ( 3 ) . click ( ) ;
183193 await page . locator ( this . btnDropdownItemLangModuleForm ( idLang ) ) . click ( ) ;
184- await this . setTinyMCEInputValue ( page . frameLocator ( this . messageModuleForm ( idLang ) ) . nth ( 3 ) , message ) ;
194+ await this . setTinyMCEInputValue ( page . locator ( this . messageModuleForm ( 3 ) ) . contentFrame ( ) , message ) ;
185195 }
186196
187197 /**
0 commit comments