Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

robotframework-dependencylibrary

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robotframework-dependencylibrary

Declare dependencies between Robot Framework tests

  • 4.0.1
  • PyPI
  • Socket score

Maintainers
1

Robot Framework Dependency Library

Declare dependencies between tests.

Ideally tests are independent, but when tests depend on earlier tests, DependencyLibrary makes it easy to explicitly declare these dependencies and have tests that depend on each other do the right thing.

Versioning

This library's version numbers follow the SemVer 2.0.0 specification <https://semver.org/spec/v2.0.0.html>_.

Installation

::

pip install robotframework-dependencylibrary

Usage

First, include the library in your tests:

.. code:: robotframework

*** Settings ***
Library  DependencyLibrary

Typical usage:

.. code:: robotframework

*** Test cases ***
Passing Test
    No operation

A Test that Depends on "Passing Test"
    Depends on test  Passing Test
    Log  The rest of the keywords in this test will run as normal.

When you need to declare multiple dependencies, just repeat the keyword:

.. code:: robotframework

*** Test cases ***
Another Passing Test
    No operation

A Test that Depends on Both "Passing Test" and "Another Passing Test"
    Depends on test  Passing Test
    Depends on test  Another Passing Test
    Log  The rest of the keywords in this test will run as normal.

You can also depend on the statuses of entire test suites:

.. code:: robotframework

*** Test cases ***
A Test that Depends on an Entire Test Suite Passing
    Depends on suite  Some Test Suite Name
    Log  The rest of the keywords will run if that whole suite passed.

Note that to depend on a suite or a test from another suite, you must either run Robot Framework with --listener DependencyLibrary, or that suite must also include DependencyLibrary in its *** Settings ***.

Skipped Dependencies

If a dependency was skipped, the depending test is also skipped:

.. code:: robotframework

*** Test cases ***
Skipped Test
    Skip  This test is skipped for some reason.

A Test that Depends on "Skipped Test"
    Depends on test  Skipped Test
    Log  The rest of the keywords (including this log) will NOT run!

The skip message follows this format::

Dependency not met: test case 'Skipped Test' was skipped.

Failing Dependencies

If a dependency failed, the depending test is skipped instead of redundantly failing as well:

.. code:: robotframework

*** Test cases ***
Failing Test
    Fail  This test failed for some reason.

A Test that Depends on "Failing Test"
    Depends on test  Failing Test
    Log  The rest of the keywords (including this log) will NOT run!

The skip message follows this format::

Dependency not met: test case 'Failing Test' failed.

Mistake Warnings

If you depend on a test or suite that does not exist or has not run yet,

.. code:: robotframework

*** Test cases ***
A Test that Depends on "Missing Test"
    Depends on test  Missing Test

the test will warn and the warning message follows this format::

Dependency not met: test case 'Missing Test' not found.

If you make a test depend on itself or on the suite that contains it,

.. code:: robotframework

*** Test cases ***
Depends on Self
    Depends on test  Depends on Self

the test will warn and the warning message follows this format::

Dependency not met: test case 'Depends on Self' mid-execution.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc