This repository contains an end-to-end test automation framework built using Python, Pytest, Selenium, and Appium, with full CI/CD integration using GitHub Actions.
The framework supports:
- π Web automation
- π± Mobile automation (BrowserStack)
- π Allure reporting
- π CI/CD pipelines
- π Slack & Email notifications
- π Allure report publishing to GitHub Artifacts
| Tool | Purpose |
|---|---|
| Python 3.10 | Programming language |
| Pytest | Test framework |
| Selenium | Web automation |
| Appium | Mobile automation |
| BrowserStack | Cloud mobile testing |
| Allure | Test reporting |
| GitHub Actions | CI/CD |
| Slack | Notifications |
Dimagi/
βββ .github/
β βββ workflows/
β
βββ .venv/
β
βββ app/
β
βββ config/
β
βββ drivers/
β
βββ locators/
β
βββ pages/
β βββ web_pages/
β βββ mobile_pages/
β
βββ reports/
β βββ allure-report/
β βββ allure-results/
β βββ results.xml
β
βββ test_data/
β
βββ tests/
β βββ web_tests/
β βββ mobile_tests/
β
βββ utils/
β
βββ .gitignore
βββ conftest.py
βββ pytest.ini
βββ README.md
βββ settings-sample.cfg
βββ requirements.txt
- Page Object Model (POM) for clean separation of tests and UI logic
- Pytest fixtures for driver management and setup/teardown
- Separate execution flows for Web and Mobile tests
- Allure reporting for detailed test insights
- Pytest reporting for easier access and test insights
- CI/CD ready with GitHub Actions
- BrowserStack integration for cloud mobile execution
- Secure secrets handling via GitHub Secrets
| Directory | Purpose |
|---|---|
tests/ |
Contains all web and mobile test cases |
pages/ |
Page Object Model implementations |
locators/ |
Element locators for web and mobile tests |
drivers/ |
WebDriver and Appium driver setup |
config/ |
Environment and capability configurations |
test_data/ |
Test data required for web and mobile test cases |
reports/ |
Allure reports and test artifacts |
utils/ |
Reusable helper utilities |
.github/workflows/ |
CI/CD pipeline definitions |
All test-related data is maintained under the test_data/ directory.
- Update or add new test data files as required for your test cases.
- Ensure the data format matches what is expected by the corresponding test cases.
- Test data can be customized separately for:
- Web tests located under
test_data/web_test_data - Mobile tests located under
test_data/mobile_workers
- Web tests located under
Any changes made in test data will directly affect test execution.
The config/ directory contains environment-specific configuration files.
- Used to manage environment-level settings such as:
- Application URLs
- BrowserStack URL
- Appium local server URL
- Modify this file to switch between environments (e.g., Staging, Production).
- Used for mobile automation configuration.
- Update this file to modify Android capabilities such as:
- Device name
- Platform name & version
- App package and activity
- Other Appium-related capabilities
- Used to manage test credentials and execution platform:
- Rename the file settings-sample.cfg to settings.cfg
- Execution platform for mobile tests- "browserstack" or "local" (in case an emulator is setup on local)
- BrowserStack Username and Access Key
- Commcare login credentials
- Modify this file to switch between Execution platforms, user credentials.
The app/ directory contains the Android application .apk file.
- When a new version of the mobile app is available:
- Replace the existing APK in the
app/folder with the new version. - Ensure the APK name and path match the values defined in the configuration.
- Replace the existing APK in the
By default:
- Web tests run locally
- Mobile tests run on BrowserStack
- Python 3.10+
- Google Chrome (for web tests)
- BrowserStack account (for mobile tests)
pip install -r requirements.txtBrowserStack (Required for Mobile Tests)
Run the below commands in terminal/PowerShellmacOS / Linux
export BROWSERSTACK_USERNAME=your_username
export BROWSERSTACK_ACCESS_KEY=your_access_keyWindows
$env:BROWSERSTACK_USERNAME="your_username"
$env:BROWSERSTACK_ACCESS_KEY="your_access_key"Run Web Tests
pytest -v tests/web_tests
Run Mobile Tests
pytest -v tests/mobile_tests
Run a specific test file
pytest -v tests/web_tests/test_olp_1_2_3.py
pytest -v tests/mobile_tests/test_tc_1.py
Generate Allure Results
pytest -v tests/web_tests --html=report.html --self-contained-html --tb=short
No extra steps needed to generate the reports after execution.
Generate Allure Results
pytest -v tests/web_tests --alluredir=reports/web/allure-results
Generate HTML Report
allure generate reports/web/allure-results -o reports/web-allure-report --clean
Open Report
allure open reports/web-allure-report
Trigger Conditions
- Push to main
- Pull request to main
workflow_dispatchfor manual workflow execution
CI Pipeline Includes
- Web tests execution
- Mobile tests execution (BrowserStack)
- Allure report generation
- Slack & email notifications
Steps to Open Allure report from GitHub Artifacts
- Download the Allure report zip file from workflow artifacts
- Unzip and extract the files in file explorer
- Execute the below command in Windows PowerShell
allure open "path_to_downloaded_report_folder"Steps to Open Pytest report from GitHub Artifacts
- Download the html report zips file from workflow artifacts
- Unzip and extract the files in file explorer
- Or if your email address is one of the recipients in the email notifications, the report.html files for we and prod will be attached
Add secrets under:
Repository β Settings β Secrets and variables β Actions
| Secret Name | Description |
|---|---|
| BROWSERSTACK_USERNAME | BrowserStack username |
| BROWSERSTACK_ACCESS_KEY | BrowserStack access key |
| SLACK_WEBHOOK_URL | Slack incoming webhook |
| FROM_EMAIL_USERNAME | Username of the sender email |
| FROM_EMAIL_PASSWORD | Password of the sender email |
| TO_EMAIL_USERNAME | Username of the receiver email |
To enable the CI pipeline to send notifications to a specific Slack channel, follow these steps:
-
Open Slack and navigate to workspace settings
- Click on your workspace name in the top left corner of Slack.
- Select Tools & Settings β Manage Apps.
This will open the Installed Apps section of the Slack Marketplace.
-
Add Incoming Webhooks
- Search for Incoming WebHooks in the marketplace.
- Click Add to Slack.
-
Select the channel for notifications
- Choose the Slack channel where you want the notifications to appear from the dropdown.
- Click Add Incoming Webhook Integration.
-
Copy the Webhook URL
- After adding the integration, Slack will provide a Webhook URL.
- Copy this URL β it will be used to send messages to the selected channel.
-
Store the Webhook URL securely
- In your GitHub repository, navigate to:
Settings β Secrets and variables β Actions - Click New repository secret and add:
- Name:
SLACK_WEBHOOK_URL - Value:
<your-webhook-url>
- Name:
- In your GitHub repository, navigate to:
The webhook URL should be treated as a secret; anyone with this URL can post messages to the channel.
Currently the channel showcasing the Connect test results is #qa-connect-automated-test-results
The framework can send test execution notifications via email. Follow these steps to securely set up email notifications using GitHub repository secrets:
-
Store Sender Email Credentials
-
Save the sender email username and password as GitHub secrets.
-
Important: For security, use an app password instead of your real email password if your email provider supports it (e.g., Gmail, Outlook).
-
FROM_EMAIL_USERNAMEβ your email address -
FROM_EMAIL_PASSWORDβ app password
-
-
Store Recipient Email Addresses
- Save the recipient email addresses as a comma-separated string in a GitHub secret.
TO_EMAIL_USERNAMEβqa1@example.com, qa2@example.com
The workflow or script will use these secrets to send notifications to the specified recipients.
- Go to link : https://github.com/dimagi/dimagi-qa-ccc/actions/workflows/dimagi_pytest.yaml
- Find the Run workflow button on the Right side of the screen

- The above screen will open with 3 fields: Branch (select main), Environment (prod or stage or both), Scope (web or mobile or both)
- Once all fields are selected, click on the green Run workflow button
- TC_6 (Payment Flow) can be executed only once per user per day as per functionality.
- If this test needs to be re-run multiple times:
- Update the user details in:
test_data/mobile_workers.yaml - Use a different user for each execution.
- Update the user details in:
This limitation is due to business rules on the backend.
**P.S. This testcase is currently skipped due to a known bug on the latest apks.