@@ -25,7 +25,7 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
25
25
26
26
private readonly checkboxModuleForm : ( status : boolean ) => string ;
27
27
28
- private readonly messageModuleForm : ( idLang : number ) => string ;
28
+ private readonly messageModuleForm : ( nth : number ) => string ;
29
29
30
30
private readonly saveButton : string ;
31
31
@@ -45,7 +45,8 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
45
45
+ ' button.dropdown-toggle' ;
46
46
this . btnDropdownItemLangModuleForm = ( idLang : number ) => `div.open ul.dropdown-menu a[data-id="${ idLang } "]` ;
47
47
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' ;
49
50
this . saveButton = '#submitDataConsent' ;
50
51
}
51
52
@@ -112,7 +113,10 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
112
113
* @returns {Promise<void> }
113
114
*/
114
115
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
+ ) ;
116
120
}
117
121
118
122
/**
@@ -134,7 +138,10 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
134
138
* @returns {Promise<void> }
135
139
*/
136
140
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
+ ) ;
138
145
}
139
146
140
147
/**
@@ -156,7 +163,10 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
156
163
* @returns {Promise<void> }
157
164
*/
158
165
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
+ ) ;
160
170
}
161
171
162
172
/**
@@ -181,7 +191,7 @@ class PsGdprTabDataConsentPage extends ModuleConfiguration implements ModulePsGd
181
191
async setMailAlertsMessage ( page : Page , message : string , idLang : number = dataLanguages . english . id ) : Promise < void > {
182
192
await page . locator ( this . btnDropdownLangModuleForm ) . nth ( 3 ) . click ( ) ;
183
193
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 ) ;
185
195
}
186
196
187
197
/**
0 commit comments