@@ -6,6 +6,10 @@ import SwiftUI
66
77@available ( iOS 13 . 0 , tvOS 13 . 0 , macOS 10 . 15 . 0 , * )
88enum TestUtils {
9+ enum Constants {
10+ static let timeout : TimeInterval = 3
11+ }
12+
913 static func present< ViewType: View > ( view: ViewType ) {
1014
1115 let hostingController = UIHostingController ( rootView: view)
@@ -253,7 +257,7 @@ class UIKitTests: XCTestCase {
253257 expectation. fulfill ( )
254258 } )
255259 TestUtils . present ( view: view)
256- wait ( for: [ expectation] , timeout: 1 )
260+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
257261 }
258262
259263 func testViewController( ) {
@@ -263,7 +267,7 @@ class UIKitTests: XCTestCase {
263267 expectation. fulfill ( )
264268 } )
265269 TestUtils . present ( view: view)
266- wait ( for: [ expectation] , timeout: 1 )
270+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
267271 }
268272
269273 func testTabView( ) {
@@ -273,7 +277,7 @@ class UIKitTests: XCTestCase {
273277 expectation. fulfill ( )
274278 } )
275279 TestUtils . present ( view: view)
276- wait ( for: [ expectation] , timeout: 1 )
280+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
277281 }
278282
279283 func testTabViewRoot( ) {
@@ -283,7 +287,7 @@ class UIKitTests: XCTestCase {
283287 expectation. fulfill ( )
284288 } )
285289 TestUtils . present ( view: view)
286- wait ( for: [ expectation] , timeout: 1 )
290+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
287291 }
288292
289293 func testList( ) {
@@ -295,7 +299,7 @@ class UIKitTests: XCTestCase {
295299 spy2: { expectation2. fulfill ( ) }
296300 )
297301 TestUtils . present ( view: view)
298- wait ( for: [ expectation1, expectation2] , timeout: 1 )
302+ wait ( for: [ expectation1, expectation2] , timeout: TestUtils . Constants . timeout )
299303 }
300304
301305 func testScrollView( ) {
@@ -307,7 +311,7 @@ class UIKitTests: XCTestCase {
307311 spy2: { expectation2. fulfill ( ) }
308312 )
309313 TestUtils . present ( view: view)
310- wait ( for: [ expectation1, expectation2] , timeout: 1 )
314+ wait ( for: [ expectation1, expectation2] , timeout: TestUtils . Constants . timeout )
311315 }
312316
313317 func testTextField( ) {
@@ -317,7 +321,7 @@ class UIKitTests: XCTestCase {
317321 expectation. fulfill ( )
318322 } )
319323 TestUtils . present ( view: view)
320- wait ( for: [ expectation] , timeout: 1 )
324+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
321325 }
322326
323327 func testSegmentedControl( ) {
@@ -327,7 +331,7 @@ class UIKitTests: XCTestCase {
327331 expectation. fulfill ( )
328332 } )
329333 TestUtils . present ( view: view)
330- wait ( for: [ expectation] , timeout: 1 )
334+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
331335 }
332336
333337 #if os(iOS)
@@ -338,7 +342,7 @@ class UIKitTests: XCTestCase {
338342 expectation. fulfill ( )
339343 } )
340344 TestUtils . present ( view: view)
341- wait ( for: [ expectation] , timeout: 1 )
345+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
342346 }
343347
344348 func testToggle( ) {
@@ -348,7 +352,7 @@ class UIKitTests: XCTestCase {
348352 expectation. fulfill ( )
349353 } )
350354 TestUtils . present ( view: view)
351- wait ( for: [ expectation] , timeout: 1 )
355+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
352356 }
353357
354358 func testSlider( ) {
@@ -358,7 +362,7 @@ class UIKitTests: XCTestCase {
358362 expectation. fulfill ( )
359363 } )
360364 TestUtils . present ( view: view)
361- wait ( for: [ expectation] , timeout: 1 )
365+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
362366 }
363367
364368 func testStepper( ) {
@@ -368,7 +372,7 @@ class UIKitTests: XCTestCase {
368372 expectation. fulfill ( )
369373 } )
370374 TestUtils . present ( view: view)
371- wait ( for: [ expectation] , timeout: 1 )
375+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
372376 }
373377
374378 func testDatePicker( ) {
@@ -378,7 +382,7 @@ class UIKitTests: XCTestCase {
378382 expectation. fulfill ( )
379383 } )
380384 TestUtils . present ( view: view)
381- wait ( for: [ expectation] , timeout: 1 )
385+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
382386 }
383387
384388 @available ( iOS 14 . 0 , macCatalyst 14 . 0 , macOS 15 . 0 , * )
@@ -390,7 +394,7 @@ class UIKitTests: XCTestCase {
390394 expectation. fulfill ( )
391395 } )
392396 TestUtils . present ( view: view)
393- wait ( for: [ expectation] , timeout: 1 )
397+ wait ( for: [ expectation] , timeout: TestUtils . Constants . timeout )
394398 }
395399 #endif
396400}
0 commit comments