@@ -180,21 +180,21 @@ test.describe('lib/fixture.ts (locators)', () => {
180
180
test . afterEach ( async ( { page} ) => page . close ( ) )
181
181
182
182
test ( 'should handle the findBy* methods' , async ( { queries} ) => {
183
- const locator = await queries . findByText ( 'Loaded!' , undefined , { timeout : 7000 } )
183
+ const locator = await queries . findByText ( 'Loaded!' , undefined , { timeout : 3000 } )
184
184
185
185
expect ( await locator . textContent ( ) ) . toEqual ( 'Loaded!' )
186
186
} )
187
187
188
188
test ( 'should handle the findAllBy* methods' , async ( { queries} ) => {
189
- const locator = await queries . findAllByText ( / H e l l o / , undefined , { timeout : 7000 } )
189
+ const locator = await queries . findAllByText ( / H e l l o / , undefined , { timeout : 3000 } )
190
190
191
191
const text = await Promise . all ( [ locator . nth ( 0 ) . textContent ( ) , locator . nth ( 1 ) . textContent ( ) ] )
192
192
193
193
expect ( text ) . toEqual ( [ 'Hello h1' , 'Hello h2' ] )
194
194
} )
195
195
196
196
test ( 'throws Testing Library error when locator times out' , async ( { queries} ) => {
197
- const query = async ( ) => queries . findByText ( / L o a d e d ! / , undefined , { timeout : 1000 } )
197
+ const query = async ( ) => queries . findByText ( / L o a d e d ! / , undefined , { timeout : 500 } )
198
198
199
199
await expect ( query ) . rejects . toThrowError (
200
200
expect . objectContaining ( {
@@ -204,7 +204,7 @@ test.describe('lib/fixture.ts (locators)', () => {
204
204
} )
205
205
206
206
test ( 'throws Testing Library error when multi-element locator times out' , async ( { queries} ) => {
207
- const query = async ( ) => queries . findAllByText ( / H e l l o / , undefined , { timeout : 1000 } )
207
+ const query = async ( ) => queries . findAllByText ( / H e l l o / , undefined , { timeout : 500 } )
208
208
209
209
await expect ( query ) . rejects . toThrowError (
210
210
expect . objectContaining ( {
@@ -214,7 +214,7 @@ test.describe('lib/fixture.ts (locators)', () => {
214
214
} )
215
215
216
216
test . describe ( 'configuring asynchronous queries via `use`' , ( ) => {
217
- test . use ( { asyncUtilTimeout : 7000 } )
217
+ test . use ( { asyncUtilTimeout : 3000 } )
218
218
219
219
test ( 'reads timeout configuration from `use` configuration' , async ( { queries, page} ) => {
220
220
// Ensure this test fails if we don't set `timeout` correctly in the `waitFor` in our find query
@@ -232,7 +232,7 @@ test.describe('lib/fixture.ts (locators)', () => {
232
232
await expect ( queries . getByText ( 'Hidden' ) ) . toBeHidden ( )
233
233
234
234
const locator = await queries . findByText ( 'Hidden' , undefined , {
235
- timeout : 7000 ,
235
+ timeout : 3000 ,
236
236
state : 'visible' ,
237
237
} )
238
238
@@ -245,7 +245,7 @@ test.describe('lib/fixture.ts (locators)', () => {
245
245
test ( 'waits for hidden element to be visible' , async ( { queries} ) => {
246
246
await expect ( queries . getByText ( 'Hidden' ) ) . toBeHidden ( )
247
247
248
- const locator = await queries . findByText ( 'Hidden' , undefined , { timeout : 7000 } )
248
+ const locator = await queries . findByText ( 'Hidden' , undefined , { timeout : 3000 } )
249
249
250
250
expect ( await locator . textContent ( ) ) . toEqual ( 'Hidden' )
251
251
} )
@@ -257,7 +257,7 @@ test.describe('lib/fixture.ts (locators)', () => {
257
257
await expect ( queries . queryByText ( 'Attached' ) ) . toHaveCount ( 0 )
258
258
259
259
const locator = await queries . findByText ( 'Attached' , undefined , {
260
- timeout : 7000 ,
260
+ timeout : 3000 ,
261
261
state : 'attached' ,
262
262
} )
263
263
@@ -271,7 +271,7 @@ test.describe('lib/fixture.ts (locators)', () => {
271
271
test ( 'waits for hidden element to be attached' , async ( { queries} ) => {
272
272
await expect ( queries . queryByText ( 'Attached' ) ) . toHaveCount ( 0 )
273
273
274
- const locator = await queries . findByText ( 'Attached' , undefined , { timeout : 7000 } )
274
+ const locator = await queries . findByText ( 'Attached' , undefined , { timeout : 3000 } )
275
275
276
276
expect ( await locator . textContent ( ) ) . toEqual ( 'Attached' )
277
277
await expect ( locator ) . toBeHidden ( )
0 commit comments