Documentation

Looking for something in particular?

Parallel Execution in GitHub Actions using Test Plan

You can build multiple test plans, run a repeatable collection of tests per each release cycle, and make global changes to the environment settings, such as browser settings, build number, and build server. Additionally, you can get consolidated reports of your results.

You can execute your test cases in parallel using a test plan with GitHub Actions.

Once you have the build.xml exported using a test plan, you can parameterize the test plan in the build.xml file.

In the example below, we have 2 test plans, i.e., Smoke and Regression. We will provide the test plan to be executed in the yml file.

Using a test plan, you can create different jobs to run in GitHub actions. Given below is an example.

# This is a basic workflow to help you get started with Actions

name: WF

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  workflow_dispatch:  
   

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
   
  # This workflow contains a single job called "build"
  build_Smoke:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
      
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
    - name: Run build
      env:
       PLAN: Smoke
        
      run: |
        
        mkdir $GITHUB_WORKSPACE/ProvarHome
        curl -O https://download.provartesting.com/latest/Provar_ANT_latest.zip
        unzip -o Provar_ANT_latest.zip -d ProvarHome
        rm Provar_ANT_latest.zip
        sudo apt-get update && sudo apt-get upgrade       
        wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -        
        sudo echo "deb [arch=amd64]  http://dl.google.com/linux/chrome/deb/ stable main" >>sudo tee -a /etc/apt/sources.list.d/google-chrome.list
        sudo apt-get -y install google-chrome-stable
        sudo add-apt-repository ppa:mozillateam/firefox-next && sudo apt install firefox
        echo $PROVAR_HOM
        cd $GITHUB_WORKSPACE/test/AN

        xvfb-run ant -f build_testPlan.xml
         
    - uses: actions/upload-artifact@v2
      with:
        name: Execution Report1
        path:${{ github.workspace }}/test/ANT/Results/*
    - uses: actions/upload-artifact@v2
      if: failure()
      with:
        name: Execution Report1
        path:${{ github.workspace }}/test/ANT/Results/*
        
  build_Regression:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
      
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
    - name: Run build
      env:
       PLAN: Regression
        
      run: |
        
        mkdir $GITHUB_WORKSPACE/ProvarHome
        curl -O https://download.provartesting.com/latest/Provar_ANT_latest.zip
        unzip -o Provar_ANT_latest.zip -d ProvarHome
        rm Provar_ANT_latest.zip
        sudo apt-get update && sudo apt-get upgrade       
        wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -        
        sudo echo "deb [arch=amd64]  http://dl.google.com/linux/chrome/deb/ stable main" >>sudo tee -a /etc/apt/sources.list.d/google-chrome.list
        sudo apt-get -y install google-chrome-stable
        sudo add-apt-repository ppa:mozillateam/firefox-next && sudo apt install firefox
        echo $PROVAR_HOM
        cd $GITHUB_WORKSPACE/test/AN
        xvfb-run ant -f build_testPlan.xml
         
    - uses: actions/upload-artifact@v2
      with:
        name: Execution Report2
        path:${{ github.workspace }}/test/ANT/Results/*
    - uses: actions/upload-artifact@v2
      if: failure()
      with:
        name: Execution Report2
        path:${{ github.workspace }}/test/ANT/Results/*


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top