@@ -13,36 +13,69 @@ export const openAddon = async (page) => {
1313
1414 // take screenshot
1515 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+ ) ,
1720 } ) ;
1821 await page . click ( 'a[aria-label="Sign in"]' ) ; // click on signin button
1922
2023 // take screenshot
2124 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` ) ,
2326 } ) ;
2427
2528 await page . waitForSelector ( 'input[name="identifier"]' , { visible : true } ) ;
2629 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+
2736 await page . click ( '#identifierNext' ) ; // click "next" button
2837
2938 await page . waitForSelector ( 'input[name="Passwd"]' , { visible : true } ) ;
3039 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+
3146 await page . waitForTimeout ( 500 ) ;
3247
3348 await page . click ( '#passwordNext' ) ; // click "next" button
3449 await page . waitForTimeout ( 3000 ) ;
3550
51+ // take screenshot after login attempt
52+ await page . screenshot ( {
53+ path : path . join ( screenshotDir , `5-after-login-attempt-${ Date . now ( ) } .png` ) ,
54+ } ) ;
55+
3656 if (
3757 await page . evaluate (
3858 ( ) =>
3959 document . querySelector ( 'h1#headingText' ) &&
4060 document . querySelector ( 'h1#headingText' ) . innerText . includes ( 'erify' )
4161 )
4262 ) {
63+ // take screenshot of verification page
64+ await page . screenshot ( {
65+ path : path . join ( screenshotDir , `6-verification-needed-${ Date . now ( ) } .png` ) ,
66+ } ) ;
67+
4368 try {
4469 await page . click ( 'li:nth-child(3)' ) ;
4570 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+ } ) ;
4679 } catch {
4780 // eslint-disable-next-line no-console
4881 console . log ( 'The "choose account recovery method" page isn\'t shown' ) ;
@@ -52,9 +85,26 @@ export const openAddon = async (page) => {
5285 'input[name="knowledgePreregisteredEmailResponse"]' ,
5386 process . env . TEST_RECOVERY_EMAIL
5487 ) ; // 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+
5597 await page . waitForTimeout ( 6000 ) ;
5698 await page . click ( 'div[data-primary-action-label] button' ) ; // click "next" button
5799 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+ } ) ;
58108 }
59109
60110 if (
@@ -66,11 +116,27 @@ export const openAddon = async (page) => {
66116 . innerText . includes ( 'implify your sign' )
67117 )
68118 ) {
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+
69127 try {
70128 await page . click (
71129 'div[data-secondary-action-label] > div > div:nth-child(2) button'
72130 ) ;
73131 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+ } ) ;
74140 } catch {
75141 // eslint-disable-next-line no-console
76142 console . log ( 'The "Simplify your sign-in" page isn\'t shown' ) ;
@@ -82,6 +148,14 @@ export const openAddon = async (page) => {
82148 { visible : true }
83149 ) ;
84150
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+
85159 // open new addon menubar item
86160 await page . evaluate ( ( ) => {
87161 const addOnMenuButton = document . querySelector (
@@ -98,6 +172,11 @@ export const openAddon = async (page) => {
98172 { visible : true }
99173 ) ;
100174
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+
101180 // open "bootstrap" menu item
102181 await page . evaluate ( ( ) => {
103182 const bootstrapMenuButton = document . querySelector (
@@ -121,5 +200,18 @@ export const openAddon = async (page) => {
121200 timeout : 10000 ,
122201 } ) ;
123202
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+
124211 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+ } ) ;
125217} ;
0 commit comments