GitHub Integration


CloudQA test cases can be run inside your GitHub builds. Below we've provided the example of a simple setup that triggers a suite of test cases.

  1. How to work with GitHub

  2. How to get the inputs for GitHub Badge


1. GitHub
  • Consider a simple GitHub configuration example, we'll be triggering a CloudQA test suite (with default settings) using the shell script, after the build is complete.

  • GitHub configuration for invoking a test suite

env:
     - CLOUDQA_API_KEY="<API Key>"
     - CLOUDQA_SUITE_ID="<Test Suite ID>"

language: bash

before_script:
    - sudo apt-get update && sudo apt-get install -y jq
    - curl -O https://doc.cloudqa.io/files/cloudqa-bash.sh

script: 
    - bash cloudqa-bash.sh

Additional environment variables

  • You can add additional environment variables to specify the Browser, Build Tag, Variables for your test suite and also to run tests in parallel.

Example configuration with all the possible options specified

env:
     - CLOUDQA_API_KEY="<API Key>"
     - CLOUDQA_SUITE_ID="<Test Suite ID>" 
     - CLOUDQA_BASE_URL="https://example.com" 
     - CLOUDQA_BROWSER=Chrome 
     - CLOUDQA_BUILD_TAG="1.0" 
     - CLOUDQA_SEQUENTIAL_EXECUTION="false"
     - CLOUDQA_VARIABLES="var1=val1,var2=val2" 

language: bash

before_script:
    - sudo apt-get update && sudo apt-get install -y jq
    - curl -O https://doc.cloudqa.io/files/cloudqa-bash.sh

script: 
    - bash cloudqa-bash.sh

Note: You can specify one of Chrome, Firefox or IE as the value for CLOUDQA_BROWSER

Status

  • Check your job log in order to verify the status of test suite every 10 seconds.

2. GitHub Badge

Follow below steps to get the inputs for creating a badge in GitHub

  • Get the status Image URL - Go to Test Suite >> Under actions select more options button >> select Status Image. The status image URL will be shown in the green color msg box

  • Get the Test suite id - Go to Test Suite >> Under actions select more options button >> choose details option, you can obtain the test suite ID.

Local Image

Syntax for creating a badge in GitHub


### Test Scheduler : [![](<<Status Image URL>>)](https://app.cloudqa.io/Recoder/TestSuitesSummary/<<test suite id>>)

Example

### Test Scheduler : [![](https://stage.cloudqa.io/Recoder/SuiteBadge/001?token=yH7Bp0v5Zg3e0uZgfFlEtAvq6iUmqcVRjvkhmpsQao0=)(https://stage.cloudqa.io/Recoder/TestSuitesSummary/001)

results matching ""

    No results matching ""