You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Unit tests test your logic and models. With Swift Testing, you can test frameworks and Swift Packages that don't even have user interface.
29
+
- UI automation tests validate your app's user experience, as well as integration with Apple harewares and the behaviors of common workflows.
30
+
31
+
### Benefits of UI automation
32
+
- User experience
33
+
- Accessibility
34
+
- Localization
35
+
- Hareware interaction
36
+
- Launch performance
37
+
38
+
There are three key phrases to setup a UI automation:
39
+
1. Record your interactions
40
+
2. Replay in multiple configurations
41
+
3. Review videos and results
42
+
43
+
> UI automation is supported on all apple platforms: iOS/iPadOS, macOS, watchOS, tvOS, visionOS(Designed for iPad).
44
+
45
+
### Sum up for what UI automation can do
46
+
- Interacts with your app like a person would
47
+
- Runs independently from your app
48
+
- Instructs the operating system what actions to perform
49
+
- Actions include launching your app, interacting with it, and setting system state
50
+
51
+
> Accessibility powers UI automation. Having a great experience of Accessibility means you will get a great UI automation experience too.
52
+
53
+
## Prepare your app for automation
54
+
> Your app can be automated with no code changes. The steps covered in this section is not required, but they can lead to better and higher quality of results.
55
+
56
+
1. Add accessibility identifiers
57
+
- Best way to identify an element in your app for automation
58
+
- Add identifiers for elements with localized strings or dynamic content
59
+
- Good identifiers are:
60
+
- Unique
61
+
- Descriptive
62
+
- Static
63
+
64
+
In SwiftUI, this is done by adding a view modifier `.accessibilityIdentifier`. In UIKit, set the `accessibilityIdentifier` property of an accessibility element.
65
+
> Most UIView like Controls, Texts, and Images are accessibility elements by default.
0 commit comments