{"id":43352383,"url":"https://github.com/dimagi/dimagi-qa-ccc","last_synced_at":"2026-02-02T02:33:00.083Z","repository":{"id":334203675,"uuid":"1093420945","full_name":"dimagi/dimagi-qa-ccc","owner":"dimagi","description":"This repository is dedicated to Commcare Connect Automation","archived":false,"fork":false,"pushed_at":"2026-01-23T15:49:57.000Z","size":39622,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T03:13:08.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T10:53:45.000Z","updated_at":"2026-01-23T15:50:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dimagi/dimagi-qa-ccc","commit_stats":null,"previous_names":["dimagi/dimagi-qa-ccc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dimagi/dimagi-qa-ccc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimagi%2Fdimagi-qa-ccc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimagi%2Fdimagi-qa-ccc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimagi%2Fdimagi-qa-ccc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimagi%2Fdimagi-qa-ccc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimagi","download_url":"https://codeload.github.com/dimagi/dimagi-qa-ccc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimagi%2Fdimagi-qa-ccc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29001654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T01:32:03.847Z","status":"online","status_checked_at":"2026-02-02T02:00:07.448Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-02T02:33:00.022Z","updated_at":"2026-02-02T02:33:00.075Z","avatar_url":"https://github.com/dimagi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dimagi\n\n### CommCare - Connect Pytest Automation Suite\n\nThis repository contains an end-to-end **test automation framework** built using **Python, Pytest, Selenium, and Appium**, with full CI/CD integration using **GitHub Actions**.\n\nThe framework supports:\n- 🌐 Web automation\n- 📱 Mobile automation (BrowserStack)\n- 📊 Allure reporting\n- 🔁 CI/CD pipelines\n- 🔔 Slack \u0026 Email notifications\n- 🌍 Allure report publishing to GitHub Artifacts\n\n---\n\n### 📌 Tech Stack\n\n| Tool           | Purpose              |\n|----------------|----------------------|\n| Python 3.10    | Programming language |\n| Pytest         | Test framework       |\n| Selenium       | Web automation       |\n| Appium         | Mobile automation    |\n| BrowserStack   | Cloud mobile testing |\n| Allure         | Test reporting       |\n| GitHub Actions | CI/CD                |\n| Slack          | Notifications        |\n\n---\n\n### 📂 Project Structure\n```\nDimagi/\n├── .github/\n│ └── workflows/\n│\n├── .venv/\n│\n├── app/\n│\n├── config/\n│\n├── drivers/\n│\n├── locators/\n│\n├── pages/\n│ ├── web_pages/\n│ └── mobile_pages/\n│\n├── reports/\n│ ├── allure-report/\n│ ├── allure-results/\n│ └── results.xml\n│\n├── test_data/\n│\n├── tests/\n│ ├── web_tests/\n│ └── mobile_tests/\n│\n├── utils/\n│\n├── .gitignore\n├── conftest.py\n├── pytest.ini\n├── README.md\n└── requirements.txt\n```\n---\n\n### 🧠 Framework Design Highlights\n- **Page Object Model (POM)** for clean separation of tests and UI logic\n- **Pytest fixtures** for driver management and setup/teardown\n- **Separate execution flows** for Web and Mobile tests\n- **Allure reporting** for detailed test insights\n- **CI/CD ready** with GitHub Actions\n- **BrowserStack integration** for cloud mobile execution\n- **Secure secrets handling** via GitHub Secrets\n\n---\n\n### 📌 Key Directories Explained\n\n| Directory            | Purpose                                          |\n|----------------------|--------------------------------------------------|\n| `tests/`             | Contains all web and mobile test cases           |\n| `pages/`             | Page Object Model implementations                |\n| `locators/`          | Element locators for web and mobile tests        |\n| `drivers/`           | WebDriver and Appium driver setup                |\n| `config/`            | Environment and capability configurations        |\n| `test_data/`         | Test data required for web and mobile test cases |\n| `reports/`           | Allure reports and test artifacts                |\n| `utils/`             | Reusable helper utilities                        |\n| `.github/workflows/` | CI/CD pipeline definitions                       |\n\n---\n\n### 🗂️ Test Data Configuration (Web \u0026 Mobile)\n\nAll test-related data is maintained under the `test_data/` directory.\n\n- Update or add new test data files as required for your test cases.\n- Ensure the data format matches what is expected by the corresponding test cases.\n- Test data can be customized separately for:\n  - Web tests located under `test_data/web_test_data`\n  - Mobile tests located under `test_data/mobile_workers`\n\nAny changes made in test data will directly affect test execution.\n\n---\n\n### 🛠️ Environment Configuration (`config` Folder)\n\nThe `config/` directory contains environment-specific configuration files.\n\n#### `env.yaml`\n- Used to manage environment-level settings such as:\n  - Application Username \u0026 Password\n  - Application URLs\n  - BrowserStack URL\n  - Appium local server URL\n- Modify this file to switch between environments (e.g., Staging, Production).\n\n#### `android_caps.json`\n- Used for mobile automation configuration.\n- Update this file to modify Android capabilities such as:\n  - Device name\n  - Platform name \u0026 version\n  - App package and activity\n  - Other Appium-related capabilities\n\n---\n\n### 📱 Mobile Application Update\n\nThe `app/` directory contains the Android application `.apk` file.\n\n- When a new version of the mobile app is available:\n  - Replace the existing APK in the `app/` folder with the new version.\n  - Ensure the APK name and path match the values defined in the configuration.\n\n---\n\n### Local vs BrowserStack Execution\n\nBy default:\n- Web tests run locally\n- Mobile tests run on BrowserStack\n\n### ⚙️ Prerequisites\n\n- Python **3.10+**\n- Google Chrome (for web tests)\n- BrowserStack account (for mobile tests)\n\n### 📦 Install Dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### 🔑 Storing Environment Variables\nBrowserStack (Required for Mobile Tests)\n\n```bash\nRun the below commands in terminal/PowerShell\n```\n\n```bash\nmacOS / Linux\nexport BROWSERSTACK_USERNAME=your_username\nexport BROWSERSTACK_ACCESS_KEY=your_access_key\n```\n\n```bash\nWindows\n$env:BROWSERSTACK_USERNAME=\"your_username\"\n$env:BROWSERSTACK_ACCESS_KEY=\"your_access_key\"\n```\n\n### ▶️ Run Tests Locally\nRun Web Tests\n```\npytest -v tests/web_tests\n```\n\nRun Mobile Tests\n```\npytest -v tests/mobile_tests --run_on=local\n```\n\nRun a specific test file\n```\npytest -v tests/web_tests/test_olp_1_2_3.py\npytest -v tests/mobile_tests/test_tc_1.py --run_on=local\n```\n\n### 📊 Allure Reports (Local Execution)\nGenerate Allure Results\n```\npytest -v tests/web_tests --alluredir=reports/web/allure-results\n```\n\nGenerate HTML Report\n```\nallure generate reports/web/allure-results -o reports/web-allure-report --clean\n```\n\nOpen Report\n```\nallure open reports/web-allure-report\n```\n⚠️ allure open works only on local machines, not in CI/CD.\n\n---\n\n### 🚀 CI/CD with GitHub Actions\nTrigger Conditions\n- Push to main\n- Pull request to main\n- `workflow_dispatch` for manual workflow execution\n\nCI Pipeline Includes\n- Web tests execution\n- Mobile tests execution (BrowserStack)\n- Allure report generation\n- Slack \u0026 email notifications\n\nSteps to Open Allure report from GitHub Artifacts\n- Download the Allure report zip file from workflow artifacts\n- Unzip and extract the files in file explorer\n- Execute the below command in Windows PowerShell\n```bash\nallure open \"path_to_downloaded_report_folder\"\n```\n\n### 🔐 GitHub Secrets Configuration\nAdd secrets under:\n\nRepository → Settings → Secrets and variables → Actions\n\n| Secret Name             | Description                    |\n|-------------------------|--------------------------------|\n| BROWSERSTACK_USERNAME   | BrowserStack username          |\n| BROWSERSTACK_ACCESS_KEY | BrowserStack access key        |\n| SLACK_WEBHOOK_URL       | Slack incoming webhook         |\n| FROM_EMAIL_USERNAME     | Username of the sender email   |\n| FROM_EMAIL_PASSWORD     | Password of the sender email   |\n| TO_EMAIL_USERNAME       | Username of the receiver email |\n\n---\n\n### 🔔 Configuring Slack Incoming Webhook for Notifications\n\nTo enable the CI pipeline to send notifications to a specific Slack channel, follow these steps:\n\n1. **Open Slack and navigate to workspace settings**  \n   - Click on your ***workspace name*** in the top left corner of Slack.  \n   - Select ***Tools \u0026 Settings → Manage Apps***.  \n     This will open the ***Installed Apps*** section of the Slack Marketplace.\n\n2. **Add Incoming Webhooks**  \n   - Search for ***Incoming WebHooks*** in the marketplace.  \n   - Click ***Add to Slack***.\n\n3. **Select the channel for notifications**  \n   - Choose the Slack channel where you want the notifications to appear from the dropdown.  \n   - Click ***Add Incoming Webhook Integration***.\n\n4. **Copy the Webhook URL**  \n   - After adding the integration, Slack will provide a ***Webhook URL***.  \n   - Copy this URL — it will be used to send messages to the selected channel.\n\n5. **Store the Webhook URL securely**  \n   - In your ***GitHub repository***, navigate to:\n     ```\n     Settings → Secrets and variables → Actions\n     ```  \n   - Click ***New repository secret*** and add:  \n     - **Name:** `SLACK_WEBHOOK_URL`  \n     - **Value:** `\u003cyour-webhook-url\u003e`  \n\n\u003e The webhook URL should be treated as a secret; anyone with this URL can post messages to the channel.\n\n---\n\n### ✉️ Configuring Email Notifications\n\nThe framework can send test execution notifications via email. Follow these steps to securely set up email notifications using GitHub repository secrets:\n\n1. **Store Sender Email Credentials**\n\n   - Save the *sender email username* and *password* as GitHub secrets.  \n   - **Important:** For security, use an *app password* instead of your real email password if your email provider supports it (e.g., Gmail, Outlook).\n\n   - `FROM_EMAIL_USERNAME` → your email address\n   - `FROM_EMAIL_PASSWORD` → app password  \n\n\n2. **Store Recipient Email Addresses**\n\n   - Save the *recipient email addresses* as a comma-separated string in a GitHub secret.\n   - `TO_EMAIL_USERNAME` → `qa1@example.com, qa2@example.com`  \n\n\u003e The workflow or script will use these secrets to send notifications to the specified recipients.\n\n---\n## ⚠️ Mobile Test Execution – Important Considerations\n\n### 1. Test Cases Requiring New Users (TC_3 \u0026 TC_4)\n\nThe following mobile test cases require a **fresh user on every execution**:\n\n- **TC_3** – Opportunity Invite \u0026 Notifications  \n- **TC_4** – Learn App Assessments (Delivery App)\n\n#### Prerequisites\nBefore running these tests:\n\n1. Manually create a **new mobile user** in the system.\n2. Invite this user to **any existing opportunity**  \n   (Do NOT use opportunity: `test_opp_221225_01`)\n\n#### Update Test Data\nAfter creating the user, update the following file:\ntest_data/mobile_workers.yaml\n\nUnder section: TC_3_to_4\n\n\nProvide:\n- `phone_number`\n- `username`\n- `backup_code`\n\nThese values must match the newly created user.\n\n\n### 2. Payment Flow Limitation (TC_6)\n\n- **TC_6 (Payment Flow)** can be executed **only once per user per day as per functionality**.\n- If this test needs to be re-run multiple times:\n  - Update the user details in:\n    ```\n    test_data/mobile_workers.yaml\n    ```\n  - Use a **different user** for each execution.\n\nThis limitation is due to business rules on the backend.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimagi%2Fdimagi-qa-ccc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimagi%2Fdimagi-qa-ccc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimagi%2Fdimagi-qa-ccc/lists"}