Skip to main content

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.

Installation

pip install robotframework-dependencylibrary

Usage

First, include the library in your tests:

*** Settings ***
Library  DependencyLibrary

Typical usage:

*** 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:

*** 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:

*** 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:

*** 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:

*** 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,

*** 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,

*** 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.

Metadata

Release files for robotframework-dependencylibrary 4.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robotframework-dependencylibrary 4.0.1
File Size Uploaded
robotframework-dependencylibrary-4.0.1.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for robotframework-dependencylibrary 4.0.1
File Interpreter ABI Platform
robotframework_dependencylibrary-4.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 7.3 kB

Release files / robotframework-dependencylibrary-4.0.1.tar.gz

Download URL robotframework-dependencylibrary-4.0.1.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d2382df03b9e47a27b35b417dc053fcde92c0e37d5165bb8a4e2a6b6ee7faa10
BLAKE2b-256 checksum
How to use checksums
8b32faa10aa8d6cb1186d664de062d1f7767f2c0c6148f6a8af1ea5c8f726ea7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release files / robotframework_dependencylibrary-4.0.1-py2.py3-none-any.whl

Download URL robotframework_dependencylibrary-4.0.1-py2.py3-none-any.whl
Size 3.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a57a878476907d2a57e608762f2b4b6c6847b38917d54a59cb5d21ed2ed95f7c
BLAKE2b-256 checksum
How to use checksums
14bd2e2ed7d60abca1ec7e67f866c413f1d87bbcd353ac89fe00c40cd2a644a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 release files

4.0.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page