Skip to main content

What's New in Vedro v1.11

· 3 min read

Vedro v1.11 brings exciting new features and improvements to streamline your testing process and enhance functionality. Let's take a look at what's new.

Automated Artifact Saving

Vedro now allows you to automatically save artifacts directly to the file system. This feature is particularly useful for preserving logs, screenshots, or any other data generated during tests.

$ vedro run --save-artifacts

By default, artifacts are saved in the .vedro/artifacts directory. However, you can specify a different location using the --artifacts-dir argument.

Temp Keeper Plugin

Introducing the Temp Keeper plugin — a convenient tool for managing temporary directories and files. This feature simplifies the process of creating and handling temporary files and directories, essential for tests that require isolated environments.

import vedro
from vedro import create_tmp_file, create_tmp_dir
from pathlib import Path

class Scenario(vedro.Scenario):

def given_tmp_file(self):
self.tmp_file: Path = create_tmp_file()
self.tmp_file.write_text("Hello, World!")

Bell Notification

Enhance your testing experience with the 'bell' feature, which triggers a sound at the end of the test execution to provide an audible notification of test completion.

$ vedro run --bell

Additionally, some terminals (like iTerm2) might display a notification when not in focus, alerting you to the test completion even if you're not currently looking at the terminal.

Forbid Only Parameter

The forbid_only parameter ensures that no scenarios are inadvertently left in an exclusive testing state, which is especially useful in continuous integration environments.

import vedro
import vedro.plugins.skipper as skipper
from cabina import env

class Config(vedro.Config):

class Plugins(vedro.Config.Plugins):

class Skipper(skipper.Skipper):
enabled = True
forbid_only = env.get("CI", False)

If @vedro.only is left in the code, it will trigger an exception, preventing accidental exclusions in your test suite.

Fixed Seed Option

Vedro now supports a --fixed-seed option. By default, Vedro generates a unique seed for each rescheduled scenario (e.g., repeated via --repeats arg). With --fixed-seed, the same seed will be used when a scenario is run multiple times in the same execution.

$ vedro run --repeats 3 --fixed-seed

Repeats Delay Control

Control the pacing of your tests with the new --repeats-delay option, which introduces a delay (in seconds) between repeated scenario executions.

$ vedro run --repeats 3 --repeats-delay 1.0

Fail Fast On Repeat

The --fail-fast-on-repeat feature complements the existing fail-fast functionality. This new option halts test executions at the first failure of a rescheduled scenario.

$ vedro run --repeats 3 --fail-fast-on-repeat
Scenarios
* register
✗ register user via email

├─[1/2] ✔ register user via email

├─[2/2] ✗ register user via email

!!! !!!
!!! Interrupted by “RepeaterExecutionInterrupted('Stop repeating scenarios after the first failure')“ !!!
!!! !!!

# 1 scenario, 0 passed, 1 failed, 0 skipped (0.12s)

No Scenarios Ok

By default, Vedro returns an exit code of 0 even if no scenarios are run. The new --no-scenarios-ok argument changes this behavior, allowing you to determine if a successful exit code should be returned when no scenarios have been executed.

$ vedro run --ignore scenarios/ --no-scenarios-ok
$ echo $?
0

These updates in Vedro v1.11 are designed to enhance your testing capabilities, making it more efficient, flexible, and user-friendly. Enjoy the improved testing experience!

tip

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