automation-test/
├── src/ # Source code for the application
│ ├── user.py # Handles user-related logic (e.g., authentication, profiles)
│ ├── order.py # Manages order-related functionality (e.g., creation, updates)
│ └── api/ # API-related source code (e.g., endpoints, services)
├── tests/ # Test code for the project
│ ├── common/ # Shared modules or utilities for tests
│ ├── unit/ # Unit tests for individual components
│ │ ├── test_user.py # Unit tests for user-related functionality
│ │ └── test_order.py # Unit tests for order-related functionality
│ ├── api/ # API tests for endpoints and services
│ │ └── test_api.py # Test cases for API functionality
│ ├── web/ # Web UI tests using automation tools (e.g., Selenium)
│ │ ├── pages/ # Page Object models for web pages
│ │ │ ├── login_page.py # Page Object for login page
│ │ │ └── dashboard_page.py # Page Object for dashboard page
│ │ └── test_web.py # Test cases for web UI functionality
│ ├── app/ # Mobile app tests using automation tools (Appium)
│ │ ├── apps/ # App and APK files
│ │ │ ├── ios_app.app # Place iOS simulator build here
│ │ │ └── android.apk # Place Android emulator build here
│ │ ├── configs/ # Desired capabilities for Appium
│ │ │ ├── android_caps.json # Android capabilities
│ │ │ └── ios_caps.json # iOS capabilities
│ │ ├── drivers/ # Appium & Sauce Lab Drivers
│ │ │ ├── driver_factory.py # Driver loader for Appium
│ │ │ └── sauce_lab_driver.py # SauceLab Driver
│ │ ├── pages/ # Page Object models for mobile app screens
│ │ │ ├── login_screen.py # Page Object for mobile login screen
│ │ │ └── payment_screen.py # Page Object for mobile payment screen
│ │ ├── utils/ # Helpers and utilities for mobile app tests
│ │ │ ├── locators.py # Locators for mobile app screens
│ │ │ ├── look_up.py # Look up utilities for mobile app screens
│ │ │ └── timers.py # Time out utilities for mobile app screens
│ │ ├── tests/ # Test files for mobile app functionality
│ │ │ └── test_dashboard_loading.py # Mobile test cases
│ │ ├── pytest.ini # Configuration file for Pytest settings
│ │ ├── conftest.py # Pytest fixture configuration for app
│ │ └── README.md # Readme for mobile app tests
│ ├── integration/ # Integration tests for system-wide functionality
│ │ └── test_db.py # Tests for database interactions
│ ├── data/ # Test data files for various test cases
│ │ └── users.json # JSON file containing user data for tests
│ └── conftest.py # Global Pytest fixture configuration
├── reports/ # Directory for test reports and outputs
│ ├── allure-results/ # Allure test report results
│ ├── htmlcov/ # Code coverage reports in HTML format
│ └── screenshots/ # Screenshots for failed web and app tests
├── requirements.txt # Project dependencies for Python packages
├── pytest.ini # Configuration file for Pytest settings
└── .gitignore # Git ignore file for excluding files from version control
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Note: This will run all the test cases excluding the mobile app tests
pytest
To run the mobile app test cases refer to Mobile App Automation Testing with Appium & Pytest
Local Testing:
# Run all Android tests locally
pytest --platform=android --env=local tests/app/tests
# Run specific home page explore test locally
pytest --platform=android --env=local tests/app/tests/login -v -s