@@ -56,7 +56,7 @@ async function waitForPasswordConceal(passwordLine) {
56
56
{
57
57
attributeFilter : [ "inputtype" ] ,
58
58
} ,
59
- ( ) => passwordLine . loginLine . getAttribute ( "inputtype" ) === "password"
59
+ ( ) => passwordLine . getAttribute ( "inputtype" ) === "password"
60
60
) ;
61
61
return concealedPromise ;
62
62
}
@@ -124,6 +124,9 @@ add_task(async function test_passwords_sidebar() {
124
124
} ) ;
125
125
126
126
add_task ( async function test_login_line_commands ( ) {
127
+ Services . fog . testResetFOG ( ) ;
128
+ await Services . fog . testFlushAllChildren ( ) ;
129
+
127
130
await addLocalOriginLogin ( ) ;
128
131
const passwordsSidebar = await openPasswordsSidebar ( ) ;
129
132
await checkAllLoginsRendered ( passwordsSidebar ) ;
@@ -146,6 +149,10 @@ add_task(async function test_login_line_commands() {
146
149
) ;
147
150
info ( `click on ${ selector } ` ) ;
148
151
loginLineInput . click ( ) ;
152
+ let events = Glean . contextualManager . recordsInteraction . testGetValue ( ) ;
153
+ assertCPMGleanEvent ( events [ 0 ] , {
154
+ interaction_type : "url_navigate" ,
155
+ } ) ;
149
156
await browserLoadedPromise ;
150
157
ok ( true , "origin url loaded" ) ;
151
158
} else if ( selector === "usernameLine" ) {
@@ -154,6 +161,11 @@ add_task(async function test_login_line_commands() {
154
161
( ) => {
155
162
info ( `click on ${ selector } ` ) ;
156
163
loginLineInput . click ( ) ;
164
+ let events =
165
+ Glean . contextualManager . recordsInteraction . testGetValue ( ) ;
166
+ assertCPMGleanEvent ( events [ 1 ] , {
167
+ interaction_type : "copy_username" ,
168
+ } ) ;
157
169
}
158
170
) ;
159
171
} else if (
@@ -168,6 +180,11 @@ add_task(async function test_login_line_commands() {
168
180
( ) => {
169
181
info ( `click on ${ selector } ` ) ;
170
182
loginLineInput . click ( ) ;
183
+ let events =
184
+ Glean . contextualManager . recordsInteraction . testGetValue ( ) ;
185
+ assertCPMGleanEvent ( events [ 2 ] , {
186
+ interaction_type : "copy_password" ,
187
+ } ) ;
171
188
}
172
189
) ;
173
190
} ) ;
@@ -182,12 +199,28 @@ add_task(async function test_login_line_commands() {
182
199
) ;
183
200
info ( "click on reveal button" ) ;
184
201
revealBtn . click ( ) ;
202
+
203
+ let events = Glean . contextualManager . recordsInteraction . testGetValue ( ) ;
204
+ assertCPMGleanEvent ( events [ 3 ] , {
205
+ interaction_type : "view_password" ,
206
+ } ) ;
207
+
185
208
await revealBtnPromise ;
186
209
is (
187
210
loginLineInput . value ,
188
211
expectedPasswordCard [ selector ] . value ,
189
212
"password revealed"
190
213
) ;
214
+
215
+ info ( "click on button again to conceal the password" ) ;
216
+ revealBtn . click ( ) ;
217
+ await waitForPasswordConceal ( loginLine ) ;
218
+ ok ( true , "Password is hidden." ) ;
219
+
220
+ events = Glean . contextualManager . recordsInteraction . testGetValue ( ) ;
221
+ assertCPMGleanEvent ( events [ 4 ] , {
222
+ interaction_type : "hide_password" ,
223
+ } ) ;
191
224
}
192
225
}
193
226
@@ -313,7 +346,7 @@ add_task(async function test_passwords_visibility_when_view_shown() {
313
346
megalist = await openPasswordsSidebar ( ) ;
314
347
await checkAllLoginsRendered ( megalist ) ;
315
348
passwordCard = megalist . querySelector ( "password-card" ) ;
316
- await waitForPasswordConceal ( passwordCard . passwordLine ) ;
349
+ await waitForPasswordConceal ( passwordCard . passwordLine . loginLine ) ;
317
350
ok ( true , "Password is hidden." ) ;
318
351
319
352
info (
@@ -323,7 +356,7 @@ add_task(async function test_passwords_visibility_when_view_shown() {
323
356
megalist = await openPasswordsSidebar ( ) ;
324
357
await checkAllLoginsRendered ( megalist ) ;
325
358
passwordCard = megalist . querySelector ( "password-card" ) ;
326
- await waitForPasswordConceal ( passwordCard . passwordLine ) ;
359
+ await waitForPasswordConceal ( passwordCard . passwordLine . loginLine ) ;
327
360
ok ( true , "Password is hidden." ) ;
328
361
329
362
SidebarController . hide ( ) ;
0 commit comments