Git Product home page Git Product logo

qase-robotframework's Introduction

THIS REPO IS DEPRECATED. IT WAS MOVED HERE


Qase TMS Robot Framework Listener

License

Installation

pip install qase-robotframework

Usage

You must add Qase case IDs to robot framework tests. They should be added as a tags in form like Q-<case id without project code>. Examples:

*** Test Cases ***
Push button
    [Tags]  Q-2
    Push button    1
    Result should be    1

Push multiple buttons
    [Tags]  Q-3
    Push button    1
    Push button    2
    Result should be    12
*** Test Cases ***    Expression    Expected
Addition              12 + 2 + 2    16
                      2 + -3        -1
    [Tags]   Q-7

Subtraction           12 - 2 - 2    8
                      2 - -3        5
    [Tags]   Q-8

After adding new tags and configuring listener - you could simply use it like this:

robot --listener qaseio.robotframework.Listener keyword_driven.robot data_driven.robot

Configuration

Listener supports loading configuration both from environment variables and from tox.ini file.

ENV variables:

  • QASE_API_TOKEN - API token to access Qase TMS
  • QASE_PROJECT - Project code from Qase TMS
  • QASE_RUN_ID - Run ID if you want to add results to existing run
  • QASE_RUN_NAME - Set custom run name when no run ID is provided
  • QASE_DEBUG - If passed something - will enable debug logging for listener

Usage:

QASE_API_TOKEN=<API TOKEN> QASE_PROJECT=PRJCODE robot --listener qaseio.robotframework.Listener keyword_driven.robot data_driven.robot

tox.ini configuration:

[qase]
qase_api_token=<API TOKEN>
qase_project=PROJECTCODE
qase_run_id=14
qase_run_name=New Robot Framework Run
qase_debug=True

Working with steps

Listener supports reporting steps results: But in order to use it, you should follow some rules:

  • Steps name in Qase TMS should match to the steps in Robot Framework
  • If step in RF has some parameters (e.g. Push Button 12) parameter would be ignored and the comparison to step in TMS will be made like: step in TMS should start with step name in RF. So if your step in RF is Open page it will be matched to step Open page https://qase.io in TMS.
  • You should preserve the order of steps. You can skip steps in RF, but you shouldn't mix them or so on - Qase does not support creating steps on the fly yet.

Contribution

Install project locally:

python3 -m venv .venv
source .venv/bin/activate
pip install -e .[testing]

Install dev requirements:

pip install pre-commit
pre-commit install

Test project:

tox

qase-robotframework's People

Contributors

zeburek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

zeburek

qase-robotframework's Issues

For each test suite with a common parameter QASE_RUN_NAME creates a separate test run.

Preconditions:
All tests suite are run in Gitlab Ci.

Reproduce
All tests are run with qase listener. For each test suite, the "qase_run_name" parameter is "test_registration_x". When pipeline finished In the test runs section (https://app.qase.io/run/[project_name]), we get a list of test runs named "test_registration_x", each of them containing one test suite.

An example of a test run file in gitlab ci:

Test-suite-1:
  extends:
    - .of
    - .customer-facing-tests-settings
  script: >
    python -m robot.run QASE_API_TOKEN=98f646604b, QASE_RUN_NAME=TestQase_registration_x, QASE_PROJECT=VS, QASE_DEBUG=True
    --listener qaseio.robotframework.Listener Tests/tests_1.robot

Test-suite-2:
  extends:
    - .ofx
    - .customer-facing-tests-settings
  script: >
    python -m robot.run QASE_API_TOKEN=98f646604b, QASE_RUN_NAME=TestQase_registration_x, QASE_PROJECT=VS, QASE_DEBUG=True
    --listener qaseio.robotframework.Listener Tests/tests_2.robot

Test-suite-3:
  extends:
    - .ofx
    - .customer-facing-tests-settings
  script: >
    python -m robot.run QASE_API_TOKEN=98f646604b, QASE_RUN_NAME=TestQase_registration_x, QASE_PROJECT=VS, QASE_DEBUG=True
    --listener qaseio.robotframework.Listener Tests/tests_3.robot

Example of result:
image

Expected result:
After the pipeline ends In the test runs section, we get one test run named "test_registration_x" that contains the entire test suite.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.