@@ -10,6 +10,8 @@ import {
10
10
import { expect , test } from '@e2e/playwright/zoo-test'
11
11
import { KCL_DEFAULT_LENGTH } from '@src/lib/constants'
12
12
13
+ const TEST_OVERLAY_TIMEOUT_MS = 1_500 // slightly longer than OVERLAY_TIMEOUT_MS in @src /components/ModelingMachineProvider
14
+
13
15
test . beforeEach ( async ( { page, context } ) => {
14
16
// Make the user avatar image always 404
15
17
// so we see the fallback menu icon for all snapshot tests
@@ -173,7 +175,7 @@ test(
173
175
500 - pixelToUnitRatio * 10
174
176
)
175
177
176
- await page . waitForTimeout ( 1_500 ) // modeling machine timeout is 1s
178
+ await page . waitForTimeout ( TEST_OVERLAY_TIMEOUT_MS )
177
179
await expect ( page ) . toHaveScreenshot ( {
178
180
maxDiffPixels : 100 ,
179
181
mask : lowerRightMasks ( page ) ,
@@ -203,7 +205,7 @@ test(
203
205
await page . waitForTimeout ( 500 )
204
206
205
207
await endOfTangentMv ( )
206
- await page . waitForTimeout ( 1_500 ) // modeling machine timeout is 1s
208
+ await page . waitForTimeout ( TEST_OVERLAY_TIMEOUT_MS )
207
209
await expect ( page ) . toHaveScreenshot ( {
208
210
maxDiffPixels : 100 ,
209
211
mask : lowerRightMasks ( page ) ,
@@ -214,7 +216,7 @@ test(
214
216
await page . waitForTimeout ( 500 )
215
217
await endOfTangentClk ( )
216
218
await threePointArcMidPointMv ( )
217
- await page . waitForTimeout ( 1_500 ) // modeling machine timeout is 1s
219
+ await page . waitForTimeout ( TEST_OVERLAY_TIMEOUT_MS )
218
220
await expect ( page ) . toHaveScreenshot ( {
219
221
maxDiffPixels : 100 ,
220
222
mask : lowerRightMasks ( page ) ,
@@ -223,7 +225,7 @@ test(
223
225
await page . waitForTimeout ( 100 )
224
226
225
227
await threePointArcEndPointMv ( )
226
- await page . waitForTimeout ( 1_500 ) // modeling machine timeout is 1s
228
+ await page . waitForTimeout ( TEST_OVERLAY_TIMEOUT_MS )
227
229
await expect ( page ) . toHaveScreenshot ( {
228
230
maxDiffPixels : 100 ,
229
231
mask : lowerRightMasks ( page ) ,
@@ -243,7 +245,7 @@ test(
243
245
await arcCenterClk ( )
244
246
245
247
await arcEndMv ( )
246
- await page . waitForTimeout ( 1_500 ) // modeling machine timeout is 1s
248
+ await page . waitForTimeout ( TEST_OVERLAY_TIMEOUT_MS )
247
249
await expect ( page ) . toHaveScreenshot ( {
248
250
maxDiffPixels : 100 ,
249
251
mask : lowerRightMasks ( page ) ,
@@ -289,7 +291,7 @@ test(
289
291
500 - pixelToUnitRatio * 10 ,
290
292
{ steps : 5 }
291
293
)
292
- await page . waitForTimeout ( 1_500 ) // modeling machine timeout is 1s
294
+ await page . waitForTimeout ( TEST_OVERLAY_TIMEOUT_MS )
293
295
294
296
// Ensure the draft rectangle looks the same as it usually does
295
297
await expect ( page ) . toHaveScreenshot ( {
@@ -333,7 +335,7 @@ test(
333
335
500 - pixelToUnitRatio * 10 ,
334
336
{ steps : 5 }
335
337
)
336
- await page . waitForTimeout ( 1_500 ) // modeling machine timeout is 1s
338
+ await page . waitForTimeout ( TEST_OVERLAY_TIMEOUT_MS )
337
339
338
340
// Ensure the draft circle looks the same as it usually does
339
341
await expect ( page ) . toHaveScreenshot ( {
0 commit comments