Skip to main content

What's New in Vedro v1.8

· 4 min read

We are thrilled to announce the release of Vedro v1.8! This update brings a host of new features and improvements to the framework, enhancing its capabilities and making it even more flexible and user-friendly. Let's delve into the latest features and see how they can improve your testing workflow.

Introducing the Orderer Plugin

The Orderer plugin offers a new way to customize the execution order of scenarios. You can now run your scenarios in a stable (default), reversed, or random order. Each order type is easily set with a command-line argument.

Stable order (default)

$ vedro run --order-stable
Scenarios
* sign in
✔ sign in via email
✔ sign in via social
* sign out
✔ sign out

# --seed 3b5eddda-928d-49fc-b76a-66a9c1a08b7e
# 3 scenarios, 3 passed, 0 failed, 0 skipped (0.00s)

By providing these different ordering options, the plugin adds an extra layer of flexibility to your testing workflow.

DryRunner: Test Without Running

The DryRunner plugin allows for scenario execution without actually running them. This feature is useful when you want to validate complex selections or simply count the number of tests.

$ vedro run scenarios/sign_up/ \
--tags SMOKE \
--slicer-total 2 \
--slicer-index 0 \
--dry-run

Conditional Scenario Skip with Skipper

Skipper introduces the @skip_if decorator, enabling you to skip scenarios based on certain conditions. This is useful when you have scenarios that only apply to specific environments or versions.

import base64
import vedro
from sys import version_info


@vedro.skip_if(lambda: version_info < (3, 10))
class Scenario(vedro.Scenario):
subject = "decode base32 encoded string"

def given(self):
self.encoded = b"EHINGT0="

def when(self):
self.original = base64.b32hexdecode(self.encoded)

def then(self):
assert self.original == b"text"

Rich Reporter: Hiding Namespaces

The RichReporter now offers a --hide-namespaces parameter, allowing you to hide directory names in the output. This feature is particularly valuable when running scenarios in random order or across different directories. By hiding directory names, the output becomes cleaner and more focused, eliminating unnecessary clutter and enhancing readability.

$ vedro run
Scenarios
* sign in
✔ sign in via email
✔ sign in via social
* sign out
✔ sign out

# --seed 644049b5-68b8-48c1-a083-b3d129fb6151
# 3 scenarios, 3 passed, 0 failed, 0 skipped (0.00s)

PyCharm Reporter: Silent Mode

The PyCharm Reporter now includes a --pycharm-no-output parameter, which suppresses console output. This is helpful when you're using the PyCharm plugin with another reporter:

$ vedro run -r rich pycharm --pycharm-no-output --hide-namespaces

Interrupter: Fail Fast

With v1.8, a short alias (-f) has been added for --fail-fast, making it quicker and easier to use this option.

$ vedro run -f

Graceful Interruptions

Vedro now handles interruptions more gracefully. For example, if you hit ctrl+c, the interruption will be neatly displayed:

Scenarios
* sign in
✔ sign in via email
✔ sign in via social
* sign out
✗ sign out
✗ when
╭──────────────── Traceback (most recent call last) ─────────────────╮
/e2e/scenarios/sign_out/sign_out.py:11 in when

8 │ subject = "sign out"
9 │
10 │ def when(self):
11 │ │ self.response = send_request()
12
╰────────────────────────────────────────────────────────────────────╯
KeyboardInterrupt


!!! !!!
!!! Interrupted by “KeyboardInterrupt()“ !!!
!!! !!!

# --seed 2ce013fe-4ea4-40ac-ad9a-ecc73a142cb2
# 3 scenarios, 2 passed, 1 failed, 0 skipped (1.23s)

tip

For the latest news and updates, subscribe to our Telegram or Twitter