@@ -7,8 +7,7 @@ const copyElement = async (reactGrab: ReactGrabPageObject, selector: string) =>
77 await reactGrab . typeInInput ( "comment" ) ;
88 await reactGrab . submitInput ( ) ;
99 await expect . poll ( ( ) => reactGrab . getClipboardContent ( ) , { timeout : 5000 } ) . toBeTruthy ( ) ;
10- // HACK: Wait for copy feedback transition and comments item addition
11- await reactGrab . page . waitForTimeout ( 300 ) ;
10+ await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 5000 } ) . toBe ( true ) ;
1211} ;
1312
1413test . describe ( "Toolbar Copy All Button" , ( ) => {
@@ -24,18 +23,18 @@ test.describe("Toolbar Copy All Button", () => {
2423 await copyElement ( reactGrab , "li:first-child" ) ;
2524 await reactGrab . clickCommentsButton ( ) ;
2625
27- await expect . poll ( ( ) => reactGrab . isToolbarCopyAllVisible ( ) , { timeout : 2000 } ) . toBe ( true ) ;
26+ await expect . poll ( ( ) => reactGrab . isToolbarCopyAllVisible ( ) , { timeout : 5000 } ) . toBe ( true ) ;
2827 } ) ;
2928
3029 test ( "should hide when comments dropdown is closed" , async ( { reactGrab } ) => {
3130 await copyElement ( reactGrab , "li:first-child" ) ;
3231 await reactGrab . clickCommentsButton ( ) ;
3332
34- await expect . poll ( ( ) => reactGrab . isToolbarCopyAllVisible ( ) , { timeout : 2000 } ) . toBe ( true ) ;
33+ await expect . poll ( ( ) => reactGrab . isToolbarCopyAllVisible ( ) , { timeout : 5000 } ) . toBe ( true ) ;
3534
3635 await reactGrab . clickCommentsButton ( ) ;
3736
38- await expect . poll ( ( ) => reactGrab . isToolbarCopyAllVisible ( ) , { timeout : 2000 } ) . toBe ( false ) ;
37+ await expect . poll ( ( ) => reactGrab . isToolbarCopyAllVisible ( ) , { timeout : 5000 } ) . toBe ( false ) ;
3938 } ) ;
4039 } ) ;
4140
@@ -60,7 +59,7 @@ test.describe("Toolbar Copy All Button", () => {
6059 await reactGrab . clickToolbarCopyAll ( ) ;
6160
6261 await expect
63- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
62+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
6463 . toBe ( true ) ;
6564 } ) ;
6665 } ) ;
@@ -74,7 +73,7 @@ test.describe("Clear History Prompt", () => {
7473 await reactGrab . clickToolbarCopyAll ( ) ;
7574
7675 await expect
77- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
76+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
7877 . toBe ( true ) ;
7978 } ) ;
8079
@@ -84,7 +83,7 @@ test.describe("Clear History Prompt", () => {
8483 await reactGrab . clickCommentsCopyAll ( ) ;
8584
8685 await expect
87- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
86+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
8887 . toBe ( true ) ;
8988 } ) ;
9089 } ) ;
@@ -98,13 +97,13 @@ test.describe("Clear History Prompt", () => {
9897 await reactGrab . clickToolbarCopyAll ( ) ;
9998
10099 await expect
101- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
100+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
102101 . toBe ( true ) ;
103102
104103 await reactGrab . confirmClearCommentsPrompt ( ) ;
105104 await reactGrab . page . waitForTimeout ( 200 ) ;
106105
107- await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 2000 } ) . toBe ( false ) ;
106+ await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 5000 } ) . toBe ( false ) ;
108107 } ) ;
109108
110109 test ( "should clear comments when confirmed via Enter key" , async ( { reactGrab } ) => {
@@ -114,17 +113,17 @@ test.describe("Clear History Prompt", () => {
114113 await reactGrab . clickToolbarCopyAll ( ) ;
115114
116115 await expect
117- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
116+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
118117 . toBe ( true ) ;
119118
120119 await reactGrab . pressEnter ( ) ;
121120 await reactGrab . page . waitForTimeout ( 200 ) ;
122121
123122 await expect
124- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
123+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
125124 . toBe ( false ) ;
126125
127- await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 2000 } ) . toBe ( false ) ;
126+ await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 5000 } ) . toBe ( false ) ;
128127 } ) ;
129128
130129 test ( "should dismiss the prompt after confirming" , async ( { reactGrab } ) => {
@@ -134,13 +133,13 @@ test.describe("Clear History Prompt", () => {
134133 await reactGrab . clickToolbarCopyAll ( ) ;
135134
136135 await expect
137- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
136+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
138137 . toBe ( true ) ;
139138
140139 await reactGrab . confirmClearCommentsPrompt ( ) ;
141140
142141 await expect
143- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
142+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
144143 . toBe ( false ) ;
145144 } ) ;
146145
@@ -153,23 +152,23 @@ test.describe("Clear History Prompt", () => {
153152 await reactGrab . clickToolbarCopyAll ( ) ;
154153
155154 await expect
156- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
155+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
157156 . toBe ( true ) ;
158157
159158 await reactGrab . confirmClearCommentsPrompt ( ) ;
160159
161- await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 2000 } ) . toBe ( false ) ;
160+ await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 5000 } ) . toBe ( false ) ;
162161
163162 await copyElement ( reactGrab , "li:last-child" ) ;
164163
165164 await reactGrab . clickCommentsButton ( ) ;
166165 await reactGrab . clickToolbarCopyAll ( ) ;
167166
168167 await expect
169- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
168+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
170169 . toBe ( false ) ;
171170
172- await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 2000 } ) . toBe ( false ) ;
171+ await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 5000 } ) . toBe ( false ) ;
173172 } ) ;
174173 } ) ;
175174
@@ -181,17 +180,17 @@ test.describe("Clear History Prompt", () => {
181180 await reactGrab . clickToolbarCopyAll ( ) ;
182181
183182 await expect
184- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
183+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
185184 . toBe ( true ) ;
186185
187186 await reactGrab . cancelClearCommentsPrompt ( ) ;
188187 await reactGrab . page . waitForTimeout ( 200 ) ;
189188
190189 await expect
191- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
190+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
192191 . toBe ( false ) ;
193192
194- await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 2000 } ) . toBe ( true ) ;
193+ await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 5000 } ) . toBe ( true ) ;
195194 } ) ;
196195
197196 test ( "should dismiss prompt when cancelled via Escape key" , async ( { reactGrab } ) => {
@@ -201,17 +200,17 @@ test.describe("Clear History Prompt", () => {
201200 await reactGrab . clickToolbarCopyAll ( ) ;
202201
203202 await expect
204- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
203+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
205204 . toBe ( true ) ;
206205
207206 await reactGrab . pressEscape ( ) ;
208207 await reactGrab . page . waitForTimeout ( 200 ) ;
209208
210209 await expect
211- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
210+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
212211 . toBe ( false ) ;
213212
214- await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 2000 } ) . toBe ( true ) ;
213+ await expect . poll ( ( ) => reactGrab . isCommentsButtonVisible ( ) , { timeout : 5000 } ) . toBe ( true ) ;
215214 } ) ;
216215 } ) ;
217216
@@ -223,7 +222,7 @@ test.describe("Clear History Prompt", () => {
223222 await reactGrab . clickToolbarCopyAll ( ) ;
224223
225224 await expect
226- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
225+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
227226 . toBe ( true ) ;
228227
229228 await reactGrab . activate ( ) ;
@@ -232,7 +231,7 @@ test.describe("Clear History Prompt", () => {
232231 await reactGrab . rightClickElement ( "li:first-child" ) ;
233232
234233 await expect
235- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
234+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
236235 . toBe ( false ) ;
237236 } ) ;
238237
@@ -243,14 +242,14 @@ test.describe("Clear History Prompt", () => {
243242 await reactGrab . clickToolbarCopyAll ( ) ;
244243
245244 await expect
246- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
245+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
247246 . toBe ( true ) ;
248247
249248 await reactGrab . clickToolbarEnabled ( ) ;
250249 await reactGrab . page . waitForTimeout ( 200 ) ;
251250
252251 await expect
253- . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 2000 } )
252+ . poll ( ( ) => reactGrab . isClearCommentsPromptVisible ( ) , { timeout : 5000 } )
254253 . toBe ( false ) ;
255254 } ) ;
256255 } ) ;
0 commit comments