tvOS / iOS suitester¶
Suitest tests are heavily dependent on how robust element selectors are. The Suitest framework that is integrated into your tvOS/iOS application generates XPath for each UIView. This absolute XPath is however fragile.
As XPath is not stable because the UI element may have been wrapped, moved up or down in the view hierarchy very easily therefore making your selector obsolete. Of course, you could change the XPath to something more robust and unique for the element however this greatly increases the amount of effort. This is where the tvOS/iOS suitester command line tool will become very useful.
To use the tool, download and extract the zip file based on your Xcode version:
What does the tool do?¶
The tool sets the AccessibilityIdentifier
for elements that do not have this attribute set. The
tools scans your project folder for any interface builders such as *.xibs
or *.storyboards
,
reads them and then modifies them.
The tool modifies elements which are UIView's or a subclass, that contain an empty
AccessibilityIdentifier
will be given the ID property that the Xcode Interface Builder generated.
Once the tool is ran on the project, all UI elements will have their AccessibilityIdentifier
attributes set correctly in the interface builder.
Usage examples¶
Action | Example | output | Notes |
---|---|---|---|
build ipa | ./suitester build --path $HOME/Projects/SomeProject --export $HOME/ExportOptionsList.plist --scheme AnotherScheme --configuration Release -b |
build using scheme and configuration from arguments then from export plist | |
build ipa | ./suitester build --path $HOME/Projects/SomeProject --export $HOME/ExportOptionsList.plist -b |
/Users/username/.suitest/CommandLineTool/AppBuilds/SomeProject |
only build app from the source code without modification |
Build specific help and options | ./suitester build -h |
||
Copy and modify | ./suitester modify --path $HOME/Projects/SomeProject --output ~/Desktop/ |
/Users/username/Desktop/Project/ |
--output is optional, if null then project will be copied to ~/.suitest/CommandLineTool/Projects/SomeProject |
General help and options | ./suitester -h |
||
Modify and build ipa | ./suitester build --path $HOME/Projects/SomeProject --export $HOME/ExportOptionsList.plist |
/Users/username/.suitest/CommandLineTool/AppBuilds/SomeProject |
|
Modify specific help and options | ./suitester modify -h |
Commands¶
Command | Description |
---|---|
modify | Copies source code, looks for elements without AccesibilityIdentifier in Interface Builder files and sets a value. See -h for options. |
build | Can set AccesibilityIdentifier and/or build IPA file. See -h for options. |
Arguments¶
Argument | Description | Required |
---|---|---|
--configuration |
Configuration to build e.g. AdHoc, Release. | No |
--options |
A path to ExportOption plist used for export ipa. | Yes |
--path |
A path to the Project folder which will be built for Suitest. | Yes |
--scheme |
Scheme name to build. | No |
--workspace |
Project workspace to build. Tool supports only workspaces for now. | No |
-h |
Shows all options. | No |
-verbose |
Log message level. | No |