Here is a comprehensive README.md file that you can add to your repository to document the BrowserStack App Low Code Automation (LCA) test execution workflow.
This repository contains a GitHub Actions workflow designed to automatically trigger and monitor mobile test suites on the BrowserStack App Low Code Automation (LCA) platform.
The pipeline automates the entire testing lifecycle by initiating test suites via REST APIs and polling for real-time execution results before completing the CI/CD build.
The workflow consists of two main execution blocks operating in a single job:
- Test Suite Execution: It targets the
POST /api/v1/test-suite/{test_suite_id}/runendpoint to kick off a cloud replay of your designated test suite. It securely captures the uniquebuild_idgenerated by BrowserStack. - Build Status Polling: It enters an automated loop hitting the
GET /api/v1/builds/{build_id}/statusendpoint every 30 seconds. The workflow dynamically evaluates the status:
passed: The step completes successfully (exit 0), and outputs the dashboard URL.- **
failed/stopped**: The step outputs the error logs along with a test execution summary and fails the GitHub runner (exit 1).
To communicate securely with the BrowserStack API, you must configure your account credentials as repository secrets.
- In your GitHub repository, navigate to Settings
$\rightarrow$ Secrets and variables$\rightarrow$ Actions. - Click on New repository secret and add the following two secrets:
BROWSERSTACK_USERNAME: Your BrowserStack account username.BROWSERSTACK_ACCESS_KEY: Your BrowserStack account access key.
Open the workflow file (.github/workflows/browserstack-lca.yml) and replace the placeholder value in the env block with your actual test suite ID:
env:
BS_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BS_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
TEST_SUITE_ID: "your_actual_test_suite_id_here" # <--- Update this
This workflow is highly flexible and can be executed in two ways:
The pipeline runs automatically on every code push to the main branch:
on:
push:
branches: [ "main" ]
If you want to test a newly compiled application build without modifying your core test suite configuration on BrowserStack, you can trigger the workflow manually from the Actions tab.
You can optionally provide:
- Hashed Android App ID: The unique identifier received after running an App Upload.
- Hashed iOS App ID: The unique identifier received after running an App Upload.
💡 Note: If these inputs are left empty, BrowserStack defaults to utilizing the pre-configured application binaries already linked to your test suite on the App LCA platform.
When a build completes or fails, the workflow prints critical metadata directly into the GitHub Actions console logs:
- Dashboard URL: A direct link (
app_lca_build_url) to view the interactive test execution screenshots and video replays on BrowserStack. - Execution Summary: A JSON block summarizing performance metrics, ensuring visibility over your pipeline status at a glance:
{
"total": 12,
"passed": 8,
"failed": 4,
"running": 0,
"queued": 0,
"duration": 1200
}