SauceCukeIOS is an iOS App Automation Framework built using Appium, TestNG, Java, and Cucumber to automate testing of iOS applications. It follows the Page Object Model (POM) and Cucumber BDD principles to ensure modularity, reusability, and scalability.
- Programming Language: Java
- Test Framework: TestNG
- BDD Framework: Cucumber
- Mobile Automation: Appium
- Build Tool: Maven
- Reporting: Allure Reports
SauceCukeIOS/
βββ src/main/java/com/saucecuke/ios/
β βββ config/ # Configuration management (environment.yaml, capabilities.json)
β βββ driver/ # Driver setup & Appium server management
β βββ pages/ # Page Object Model (POM) classes
β βββ tests/ # Test cases (TestNG & Cucumber-based)
βββ src/test/resources/
β βββ configs/ # Configuration files (environment.yaml, capabilities.json)
β βββ features/ # Cucumber feature files
βββ applications/ # iOS app (.app) files for testing
βββ pom.xml # Maven configuration
βββ README.md # Project documentation
Ensure the following dependencies are installed:
- Java 17+ (Download)
- Maven (Download)
- Appium Server (Installation Guide)
- Xcode (for iOS Simulator & WebDriverAgent)
- Homebrew (Mac):
brew install node brew install --cask appium
- Appium Doctor (To verify Appium setup)
npm install -g appium-doctor appium-doctor
Navigate to the project root and run:
mvn clean installThis will download and set up all required dependencies.
Ensure Appium is running before executing tests:
appium serverRun tests using Maven with environment specification:
mvn test -Denv=stagingor specify another environment:
mvn test -Denv=productionThis file stores environment-specific configurations such as usernames and passwords.
environments:
staging:
username: "[email protected]"
password: "password123"
production:
username: "[email protected]"
password: "password456"Stores Appium capabilities for different environments.
{
"staging": {
"platformName": "iOS",
"appium:deviceName": "iPhone 16",
"appium:platformVersion": "18.2",
"appium:app": "./applications/MyRNDemoApp.app",
"appium:automationName": "XCUITest",
"appium:noReset": true
}
}Loads environment configurations from environment.yaml.
Loads Appium capabilities from capabilities.json.
Handles WebDriver initialization and teardown.
Manages starting and stopping of the Appium server.
Each screen has a separate page class. Example:
@iOSXCUITFindBy(xpath = "//XCUIElementTypeTextField[@name='Username input field']")
private WebElement usernameField;Run tests and generate reports:
mvn clean test
allure serve allure-resultsThis will start a local server to display reports in a browser.
If tests fail, check Appium logs for debugging:
appium --log-level debugUse Appium Inspector to inspect UI elements and verify XPath selectors.
Print the current screen elements:
System.out.println(driver.getPageSource());- Clone the repository
- Create a new branch (
feature-branch-name) - Commit your changes
- Open a Pull Request
For issues and feature requests, raise a GitHub issue or contact the project maintainer.
π References