Skip to content

iamrishab2701/SauceCukeIOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SauceCukeIOS

πŸ“Œ Project Overview

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.


πŸ› οΈ Tech Stack

  • Programming Language: Java
  • Test Framework: TestNG
  • BDD Framework: Cucumber
  • Mobile Automation: Appium
  • Build Tool: Maven
  • Reporting: Allure Reports

πŸ“‚ Project Structure

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

βš™οΈ Setup Instructions

1️⃣ Prerequisites

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

2️⃣ Install Dependencies

Navigate to the project root and run:

mvn clean install

This will download and set up all required dependencies.


πŸš€ Running Tests

1️⃣ Start Appium Server

Ensure Appium is running before executing tests:

appium server

2️⃣ Execute Tests

Run tests using Maven with environment specification:

mvn test -Denv=staging

or specify another environment:

mvn test -Denv=production

βš™οΈ Configuration Management

1️⃣ environment.yaml

This file stores environment-specific configurations such as usernames and passwords.

environments:
  staging:
    username: "[email protected]"
    password: "password123"
  production:
    username: "[email protected]"
    password: "password456"

2️⃣ capabilities.json

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
  }
}

πŸ› οΈ Framework Components

1️⃣ ConfigReader.java

Loads environment configurations from environment.yaml.

2️⃣ CapabilitiesReader.java

Loads Appium capabilities from capabilities.json.

3️⃣ DriverManager.java

Handles WebDriver initialization and teardown.

4️⃣ AppiumServerManager.java

Manages starting and stopping of the Appium server.

5️⃣ Page Object Model (POM)

Each screen has a separate page class. Example:

@iOSXCUITFindBy(xpath = "//XCUIElementTypeTextField[@name='Username input field']")
private WebElement usernameField;

πŸ“Š Reporting

1️⃣ Generate Allure Reports

Run tests and generate reports:

mvn clean test
allure serve allure-results

This will start a local server to display reports in a browser.


🐞 Debugging & Troubleshooting

1️⃣ Appium Logs

If tests fail, check Appium logs for debugging:

appium --log-level debug

2️⃣ Validate Element Locators

Use Appium Inspector to inspect UI elements and verify XPath selectors.

3️⃣ Check getPageSource() Output

Print the current screen elements:

System.out.println(driver.getPageSource());

✨ Contributing

  1. Clone the repository
  2. Create a new branch (feature-branch-name)
  3. Commit your changes
  4. Open a Pull Request

πŸ“ž Support

For issues and feature requests, raise a GitHub issue or contact the project maintainer.


πŸ”— References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors