@@ -90,12 +90,12 @@ module.exports = {
90
90
selector : '*[data-id="matomoModalModalDialogModalBody-react"]' ,
91
91
abortOnFailure : true
92
92
} )
93
- . waitForElementVisible ( '*[data-id="matomoModal-modal-close "]' )
94
- . click ( '[data-id="matomoModal-modal-close "]' ) // click on Manage Preferences
95
- . waitForElementNotVisible ( '*[data-id="managePreferencesModalModalDialogModalBody-react"]' )
96
- . waitForElementNotVisible ( '*[data-id="matomoPerfAnalyticsToggleSwitch"]' )
93
+ . waitForElementVisible ( '*[data-id="matomoModal-modal-footer-cancel-react "]' )
94
+ . click ( '[data-id="matomoModal-modal-footer-cancel-react "]' ) // click on Manage Preferences
95
+ . waitForElementVisible ( '*[data-id="managePreferencesModalModalDialogModalBody-react"]' )
96
+ . waitForElementVisible ( '*[data-id="matomoPerfAnalyticsToggleSwitch"]' )
97
97
. click ( '*[data-id="matomoPerfAnalyticsToggleSwitch"]' ) // disable matomo perf analytics3
98
- . click ( '[managePreferencesModal-modal-footer-ok-react"]' ) // click on Save Preferences
98
+ . click ( '[data-id=" managePreferencesModal-modal-footer-ok-react"]' ) // click on Save Preferences
99
99
. pause ( 2000 )
100
100
. waitForElementPresent ( '*[data-id="beginnerbtn"]' , 10000 )
101
101
. click ( '[data-id="beginnerbtn"]' )
@@ -108,25 +108,8 @@ module.exports = {
108
108
browser . assert . ok ( ( res as any ) . value , 'matomo perf analytics is disabled' )
109
109
} )
110
110
} ,
111
- 'matomo should reappear #group2' : function ( browser : NightwatchBrowser ) {
112
- browser
113
- . refreshPage ( )
114
- . waitForElementPresent ( {
115
- selector : `//*[@data-id='compilerloaded']` ,
116
- locateStrategy : 'xpath' ,
117
- timeout : 120000
118
- } )
119
- . waitForElementVisible ( {
120
- selector : '*[data-id="matomoModalModalDialogModalBody-react"]' ,
121
- abortOnFailure : true
122
- } )
123
- . waitForElementVisible ( '*[data-id="matomoModal-modal-close"]' )
124
- . click ( '[data-id="matomoModal-modal-close"]' )
125
- . waitForElementNotVisible ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
126
- } ,
127
111
'change settings #group2' : function ( browser : NightwatchBrowser ) {
128
112
browser
129
- . clickLaunchIcon ( 'settings' )
130
113
. waitForElementVisible ( '*[data-id="label-matomo-settings"]' )
131
114
. pause ( 1000 )
132
115
. click ( '*[data-id="label-matomo-settings"]' )
@@ -137,34 +120,18 @@ module.exports = {
137
120
timeout : 120000
138
121
} )
139
122
. waitForElementNotPresent ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
140
- } ,
141
- 'should get enter dialog again #group2' : function ( browser : NightwatchBrowser ) {
142
- browser
143
- . waitForElementVisible ( '*[data-id="beginnerbtn"]' , 10000 )
144
- . pause ( 1000 )
145
- . click ( '[data-id="beginnerbtn"]' )
146
- . waitForElementNotPresent ( '*[data-id="beginnerbtn"]' )
147
- . waitForElementVisible ( {
148
- selector : `//*[contains(text(), 'Welcome to Remix IDE')]` ,
149
- locateStrategy : 'xpath'
150
- } )
151
- . waitForElementVisible ( '*[id="remixTourSkipbtn"]' )
152
- . click ( '*[id="remixTourSkipbtn"]' )
153
123
. clickLaunchIcon ( 'settings' )
154
- . waitForElementPresent ( '[id="settingsMatomoPerfAnalytics"]:checked' )
155
- . execute ( function ( ) {
156
- return JSON . parse ( window . localStorage . getItem ( 'config-v0.8:.remix.config' ) ) [ 'settings/matomo-perf-analytics' ] == true
157
- } , [ ] , ( res ) => {
158
- console . log ( 'res' , res )
159
- browser . assert . ok ( ( res as any ) . value , 'matomo analytics is enabled' )
160
- } )
124
+ . pause ( 1000 )
125
+ . click ( '*[data-id="label-matomo-settings"]' ) // disable again
126
+ . pause ( 1000 )
127
+ . refreshPage ( )
161
128
} ,
162
- 'check old timestamp and reappear Matomo #group3 ' : function ( browser : NightwatchBrowser ) {
129
+ 'check old timestamp and reappear Matomo #group2 ' : function ( browser : NightwatchBrowser ) {
163
130
browser . perform ( ( done ) => {
164
131
browser . execute ( function ( ) {
165
132
const oldTimestamp = new Date ( )
166
133
oldTimestamp . setMonth ( oldTimestamp . getMonth ( ) - 7 )
167
- localStorage . setItem ( 'matomo-analytics-consent' , oldTimestamp . getTime ( ) . toString ( ) )
134
+ localStorage . setItem ( 'matomo-perf- analytics-consent' , oldTimestamp . getTime ( ) . toString ( ) )
168
135
} , [ ] )
169
136
. refreshPage ( )
170
137
. perform ( done ( ) )
@@ -176,7 +143,7 @@ module.exports = {
176
143
} )
177
144
. execute ( function ( ) {
178
145
179
- const timestamp = window . localStorage . getItem ( 'matomo-analytics-consent' ) ;
146
+ const timestamp = window . localStorage . getItem ( 'matomo-perf- analytics-consent' ) ;
180
147
if ( timestamp ) {
181
148
182
149
const consentDate = new Date ( Number ( timestamp ) ) ;
@@ -195,26 +162,26 @@ module.exports = {
195
162
196
163
} , [ ] , ( res ) => {
197
164
console . log ( 'res' , res )
198
- browser . assert . ok ( ( res as any ) . value , 'matomo analytics consent timestamp is set' )
165
+ browser . assert . ok ( ( res as any ) . value , 'matomo performance analytics consent timestamp is set' )
199
166
} )
200
167
. waitForElementVisible ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
201
- . click ( '[data-id="matomoModal-modal-footer-cancel -react"]' ) // cancel
168
+ . click ( '[data-id="matomoModal-modal-footer-ok -react"]' ) // accept
202
169
. waitForElementNotVisible ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
203
170
} ,
204
171
'check recent timestamp and do not reappear Matomo #group3' : function ( browser : NightwatchBrowser ) {
205
172
browser . perform ( ( done ) => {
206
173
browser . execute ( function ( ) {
207
174
const recentTimestamp = new Date ( )
208
175
recentTimestamp . setMonth ( recentTimestamp . getMonth ( ) - 1 )
209
- localStorage . setItem ( 'matomo-analytics-consent' , recentTimestamp . getTime ( ) . toString ( ) )
176
+ localStorage . setItem ( 'matomo-perf- analytics-consent' , recentTimestamp . getTime ( ) . toString ( ) )
210
177
} , [ ] )
211
178
. refreshPage ( )
212
179
. perform ( done ( ) )
213
180
} )
214
181
// check if timestamp is younger than 6 months
215
182
. execute ( function ( ) {
216
183
217
- const timestamp = window . localStorage . getItem ( 'matomo-analytics-consent' ) ;
184
+ const timestamp = window . localStorage . getItem ( 'matomo-perf- analytics-consent' ) ;
218
185
if ( timestamp ) {
219
186
220
187
const consentDate = new Date ( Number ( timestamp ) ) ;
@@ -248,7 +215,7 @@ module.exports = {
248
215
browser . execute ( function ( ) {
249
216
localStorage . removeItem ( 'config-v0.8:.remix.config' )
250
217
localStorage . setItem ( 'showMatomo' , 'true' )
251
- localStorage . removeItem ( 'matomo-analytics-consent' )
218
+ localStorage . removeItem ( 'matomo-perf- analytics-consent' )
252
219
} , [ ] )
253
220
. refreshPage ( )
254
221
. perform ( done ( ) )
@@ -264,7 +231,7 @@ module.exports = {
264
231
. pause ( 2000 )
265
232
. execute ( function ( ) {
266
233
267
- const timestamp = window . localStorage . getItem ( 'matomo-analytics-consent' ) ;
234
+ const timestamp = window . localStorage . getItem ( 'matomo-perf- analytics-consent' ) ;
268
235
if ( timestamp ) {
269
236
270
237
const consentDate = new Date ( Number ( timestamp ) ) ;
@@ -290,7 +257,7 @@ module.exports = {
290
257
browser . execute ( function ( ) {
291
258
const oldTimestamp = new Date ( )
292
259
oldTimestamp . setMonth ( oldTimestamp . getMonth ( ) - 7 )
293
- localStorage . setItem ( 'matomo-analytics-consent' , oldTimestamp . getTime ( ) . toString ( ) )
260
+ localStorage . setItem ( 'matomo-perf- analytics-consent' , oldTimestamp . getTime ( ) . toString ( ) )
294
261
} , [ ] )
295
262
. refreshPage ( )
296
263
. perform ( done ( ) )
@@ -308,7 +275,7 @@ module.exports = {
308
275
browser . execute ( function ( ) {
309
276
const recentTimestamp = new Date ( )
310
277
recentTimestamp . setMonth ( recentTimestamp . getMonth ( ) - 1 )
311
- localStorage . setItem ( 'matomo-analytics-consent' , recentTimestamp . getTime ( ) . toString ( ) )
278
+ localStorage . setItem ( 'matomo-perf- analytics-consent' , recentTimestamp . getTime ( ) . toString ( ) )
312
279
} , [ ] )
313
280
. refreshPage ( )
314
281
. perform ( done ( ) )
@@ -327,13 +294,13 @@ module.exports = {
327
294
localStorage . removeItem ( 'config-v0.8:.remix.config' )
328
295
const recentTimestamp = new Date ( )
329
296
recentTimestamp . setMonth ( recentTimestamp . getMonth ( ) - 1 )
330
- localStorage . setItem ( 'matomo-analytics-consent' , recentTimestamp . getTime ( ) . toString ( ) )
297
+ localStorage . setItem ( 'matomo-perf- analytics-consent' , recentTimestamp . getTime ( ) . toString ( ) )
331
298
} , [ ] )
332
299
. refreshPage ( )
333
300
. perform ( done ( ) )
334
301
} )
335
302
. waitForElementVisible ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
336
- . click ( '[data-id="matomoModal-modal-footer-cancel -react"]' ) // cancel
303
+ . click ( '[data-id="matomoModal-modal-footer-ok -react"]' ) // accept
337
304
. waitForElementNotVisible ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
338
305
} ,
339
306
'when there is a old timestamp but no config the dialog should reappear #group3' : function ( browser : NightwatchBrowser ) {
@@ -342,13 +309,13 @@ module.exports = {
342
309
localStorage . removeItem ( 'config-v0.8:.remix.config' )
343
310
const oldTimestamp = new Date ( )
344
311
oldTimestamp . setMonth ( oldTimestamp . getMonth ( ) - 7 )
345
- localStorage . setItem ( 'matomo-analytics-consent' , oldTimestamp . getTime ( ) . toString ( ) )
312
+ localStorage . setItem ( 'matomo-perf- analytics-consent' , oldTimestamp . getTime ( ) . toString ( ) )
346
313
} , [ ] )
347
314
. refreshPage ( )
348
315
. perform ( done ( ) )
349
316
} )
350
317
. waitForElementVisible ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
351
- . click ( '[data-id="matomoModal-modal-footer-cancel -react"]' ) // cancel
318
+ . click ( '[data-id="matomoModal-modal-footer-ok -react"]' ) // accept
352
319
. waitForElementNotVisible ( '*[data-id="matomoModalModalDialogModalBody-react"]' )
353
320
} ,
354
321
'verify Matomo events are tracked on app start #group4' : function ( browser : NightwatchBrowser ) {
0 commit comments