-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce flakiness by improving some checks to ensure the app is ready. (…
…#61) Changes: 1. Ensures the runloop is fully flushed before continuing 2. Force enables the accessibility engine and waits for it to load if it is the first time loading on a device 3. Improve detection for view did appear to hopefully detect when the window's root view controller has completed appearance better and reduce issues from slow sim boot 4. Check for unfinished animations with the assumption that we can use those for transitions. 5. Adds a new settings object to be able to configure some of these options
- Loading branch information
1 parent
536170a
commit c9c36b7
Showing
7 changed files
with
179 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Sources/Hammer/EventGenerator/EventGenerator+Settings.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Foundation | ||
|
||
extension EventGenerator { | ||
/// Shared setting values for all event generators | ||
public static var settings = Settings() | ||
|
||
/// Shared setting values for all event generators | ||
public struct Settings { | ||
/// The delay to wait after activating the accessibility engine. | ||
public var accessibilityActivateDelay: TimeInterval = 0.02 | ||
|
||
/// The delay to wait after activating the accessibility engine for the first time in a simulator. | ||
public var accessibilityActivateFirstTimeDelay: TimeInterval = 5.0 | ||
|
||
/// The accessibility engine is required for finding accessibility labels. We proactively enable it | ||
/// to avoid issues with the first test case that uses it. | ||
public var forceActivateAccessibilityEngine: Bool = true | ||
|
||
/// If we should wait for animations to complete when an event generator is created. | ||
public var waitForAnimations: Bool = false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters