Skip to content

Nepitwin/ci-robotframework

Repository files navigation

CI-Robotframework

System Badge
Appveyor Build Build status
Appveyor Badge
Testspace Badge

Robotframework example for build system usage by ui test automation by appveyor.

Check by Python table from appveyor which test worker supports your python version.

Appveyor setup by yaml file

For github configuration create a appveyor.yaml file.

version: 1.0.{build}
image: Visual Studio 2017
install:
- cmd: >-
    set PATH=C:\Python37;C:\Python37\\Scripts;%PATH%

    python -m pip install --upgrade pip

    pip install wheel

    pip install robotframework

    pip install robotframework-whitelibrary
build: off
test_script:
- ps: robot -x xunit-result.xml -d result --nostatusrc Automation.robot
artifacts:
- path: result/
  name: results
on_finish:
- ps: >-
    $wc = New-Object 'System.Net.WebClient'

    $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\result\xunit-result.xml))

Appveyor setup by web interface

Login to your appveyor account and establish a github project to build.

Environment setup

  • Setup build worker image to Visual Studio 2017 for python 3.7.5 usage.
  • Setup a install script by powershell script
set PATH=C:\Python37;C:\Python37\\Scripts;%PATH%
python -m pip install --upgrade pip
pip install wheel
pip install robotframework
pip install robotframework-whitelibrary

Configuration

Test Setup

Execute robot framework files by a simple bat file or ps cmd. Most important argument is '--nostatusrc' to avoid Exit command -1 return from robot framework execution.

robot -x xunit.xml -d result --nostatusrc Automation.robot

Tests

Artifacts

Artifacts deployment can store results as zip.

Artifacts

Xunit Testing

To upload xunit files from robot to appveyor use web api. Importand don't use xunit parser from appveyor because xunit file from robotframework is junit xml file.

$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\result\xunit-result.xml))

XUnit

Robot Results

Download artifact files and see robot files.

Results