@@ -13,36 +13,69 @@ export const openAddon = async (page) => {
13
13
14
14
// take screenshot
15
15
await page . screenshot ( {
16
- path : path . join ( screenshotDir , `main-spreadsheet-page-${ Date . now ( ) } .png` ) ,
16
+ path : path . join (
17
+ screenshotDir ,
18
+ `1-main-spreadsheet-before-signin-${ Date . now ( ) } .png`
19
+ ) ,
17
20
} ) ;
18
21
await page . click ( 'a[aria-label="Sign in"]' ) ; // click on signin button
19
22
20
23
// take screenshot
21
24
await page . screenshot ( {
22
- path : path . join ( screenshotDir , `first -signin-page-${ Date . now ( ) } .png` ) ,
25
+ path : path . join ( screenshotDir , `2 -signin-page-${ Date . now ( ) } .png` ) ,
23
26
} ) ;
24
27
25
28
await page . waitForSelector ( 'input[name="identifier"]' , { visible : true } ) ;
26
29
await page . type ( 'input[name="identifier"]' , process . env . EMAIL ) ; // type email
30
+
31
+ // take screenshot after entering email
32
+ await page . screenshot ( {
33
+ path : path . join ( screenshotDir , `3-email-entered-${ Date . now ( ) } .png` ) ,
34
+ } ) ;
35
+
27
36
await page . click ( '#identifierNext' ) ; // click "next" button
28
37
29
38
await page . waitForSelector ( 'input[name="Passwd"]' , { visible : true } ) ;
30
39
await page . type ( 'input[name="Passwd"]' , process . env . PASSWORD ) ; // type pass
40
+
41
+ // take screenshot after entering password
42
+ await page . screenshot ( {
43
+ path : path . join ( screenshotDir , `4-password-entered-${ Date . now ( ) } .png` ) ,
44
+ } ) ;
45
+
31
46
await page . waitForTimeout ( 500 ) ;
32
47
33
48
await page . click ( '#passwordNext' ) ; // click "next" button
34
49
await page . waitForTimeout ( 3000 ) ;
35
50
51
+ // take screenshot after login attempt
52
+ await page . screenshot ( {
53
+ path : path . join ( screenshotDir , `5-after-login-attempt-${ Date . now ( ) } .png` ) ,
54
+ } ) ;
55
+
36
56
if (
37
57
await page . evaluate (
38
58
( ) =>
39
59
document . querySelector ( 'h1#headingText' ) &&
40
60
document . querySelector ( 'h1#headingText' ) . innerText . includes ( 'erify' )
41
61
)
42
62
) {
63
+ // take screenshot of verification page
64
+ await page . screenshot ( {
65
+ path : path . join ( screenshotDir , `6-verification-needed-${ Date . now ( ) } .png` ) ,
66
+ } ) ;
67
+
43
68
try {
44
69
await page . click ( 'li:nth-child(3)' ) ;
45
70
await page . waitForTimeout ( 6000 ) ;
71
+
72
+ // take screenshot after selecting verification method
73
+ await page . screenshot ( {
74
+ path : path . join (
75
+ screenshotDir ,
76
+ `7-verification-method-selected-${ Date . now ( ) } .png`
77
+ ) ,
78
+ } ) ;
46
79
} catch {
47
80
// eslint-disable-next-line no-console
48
81
console . log ( 'The "choose account recovery method" page isn\'t shown' ) ;
@@ -52,9 +85,26 @@ export const openAddon = async (page) => {
52
85
'input[name="knowledgePreregisteredEmailResponse"]' ,
53
86
process . env . TEST_RECOVERY_EMAIL
54
87
) ; // type recovery email
88
+
89
+ // take screenshot after entering recovery email
90
+ await page . screenshot ( {
91
+ path : path . join (
92
+ screenshotDir ,
93
+ `8-recovery-email-entered-${ Date . now ( ) } .png`
94
+ ) ,
95
+ } ) ;
96
+
55
97
await page . waitForTimeout ( 6000 ) ;
56
98
await page . click ( 'div[data-primary-action-label] button' ) ; // click "next" button
57
99
await page . waitForTimeout ( 5000 ) ;
100
+
101
+ // take screenshot after verification completed
102
+ await page . screenshot ( {
103
+ path : path . join (
104
+ screenshotDir ,
105
+ `9-verification-completed-${ Date . now ( ) } .png`
106
+ ) ,
107
+ } ) ;
58
108
}
59
109
60
110
if (
@@ -66,11 +116,27 @@ export const openAddon = async (page) => {
66
116
. innerText . includes ( 'implify your sign' )
67
117
)
68
118
) {
119
+ // take screenshot of simplify sign-in page
120
+ await page . screenshot ( {
121
+ path : path . join (
122
+ screenshotDir ,
123
+ `10-simplify-signin-page-${ Date . now ( ) } .png`
124
+ ) ,
125
+ } ) ;
126
+
69
127
try {
70
128
await page . click (
71
129
'div[data-secondary-action-label] > div > div:nth-child(2) button'
72
130
) ;
73
131
await page . waitForTimeout ( 6000 ) ;
132
+
133
+ // take screenshot after dismissing simplify sign-in
134
+ await page . screenshot ( {
135
+ path : path . join (
136
+ screenshotDir ,
137
+ `11-after-dismissing-simplify-signin-${ Date . now ( ) } .png`
138
+ ) ,
139
+ } ) ;
74
140
} catch {
75
141
// eslint-disable-next-line no-console
76
142
console . log ( 'The "Simplify your sign-in" page isn\'t shown' ) ;
@@ -82,6 +148,14 @@ export const openAddon = async (page) => {
82
148
{ visible : true }
83
149
) ;
84
150
151
+ // take screenshot before opening addon menu
152
+ await page . screenshot ( {
153
+ path : path . join (
154
+ screenshotDir ,
155
+ `12-before-opening-addon-menu-${ Date . now ( ) } .png`
156
+ ) ,
157
+ } ) ;
158
+
85
159
// open new addon menubar item
86
160
await page . evaluate ( ( ) => {
87
161
const addOnMenuButton = document . querySelector (
@@ -98,6 +172,11 @@ export const openAddon = async (page) => {
98
172
{ visible : true }
99
173
) ;
100
174
175
+ // take screenshot with addon menu opened
176
+ await page . screenshot ( {
177
+ path : path . join ( screenshotDir , `13-addon-menu-opened-${ Date . now ( ) } .png` ) ,
178
+ } ) ;
179
+
101
180
// open "bootstrap" menu item
102
181
await page . evaluate ( ( ) => {
103
182
const bootstrapMenuButton = document . querySelector (
@@ -121,5 +200,18 @@ export const openAddon = async (page) => {
121
200
timeout : 10000 ,
122
201
} ) ;
123
202
203
+ // take screenshot after clicking bootstrap menu item
204
+ await page . screenshot ( {
205
+ path : path . join (
206
+ screenshotDir ,
207
+ `14-bootstrap-dialog-opened-${ Date . now ( ) } .png`
208
+ ) ,
209
+ } ) ;
210
+
124
211
await page . waitForTimeout ( 15000 ) ;
212
+
213
+ // take final screenshot after waiting period
214
+ await page . screenshot ( {
215
+ path : path . join ( screenshotDir , `15-addon-fully-loaded-${ Date . now ( ) } .png` ) ,
216
+ } ) ;
125
217
} ;
0 commit comments