This project aims to automate testing for native mobile applications developed for iOS platforms, this project will be using Swift as programming language and XCUITest as the Testing framework
Test automation on mobile devices can be performed with different tools, such as Detox or Appium. These tools will be useful when the application is developed with a cross-platform approach, for example applications made with react-native or flutter. On the other hand, when the applications are native for each platform, the native automation approach appears. In this repository you will find examples of how this automation can be done for iOS platforms.
Make sure you have the following tools and environments set up on your system before running the tests:
- Xcode: For iOS test development and execution.
- iOS Emulators: Natively included with XCode dev tools.
- Swift: The programming language used in the automation project.
- Cocoapods (Optional): Will be needed if the project uses external packages
-
cd
intobase-iOS-project
-
Run iOS Tests from terminal:
make run-tests
(You must be located on project root directory to run this command) (root folder: base-iOS-project) For more information about the commands that are being executed to run the test check the Makefile
- Automation code located at:
base-iOS-project/TAUUITests/
- AccessibilityIdentifiers: Location for enums containing the ids used to get elements
- Base: Setup and Teardown configuration
- Extensions: Base interactions extending XCElement class
- GenericComponents: Generic way to interact with reused components
- Screens: Page Object Models for the app screens
- TestData: Test data to use in tests
- Tests: Test scripts
A breakpoint must be setted and the test should be runned.
When the execution stops at the breakpoint, the terminal can be used to type po app
, with this command the whole structure of the screen will be displayed on the terminal.