What's New in Vedro v1.8
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
- Reversed
- Random
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)
Reversed order
$ vedro run --order-reversed
Scenarios
* sign out
✔ sign out
* sign in
✔ sign in via social
✔ sign in via email
# --seed b0b9be51-54bb-4365-9b24-f326fcf9aa43
# 3 scenarios, 3 passed, 0 failed, 0 skipped (0.00s)
Random order
$ vedro run --order-random
Scenarios
* sign in
✔ sign in via email
* sign out
✔ sign out
* sign in
✔ sign in via social
# --seed 9b1da7f5-579f-4add-abda-5a8342ca5a33
# 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.
- Show Namespaces
- Hide Namespaces
$ 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)
$ vedro run --hide-namespaces
Scenarios
✔ sign in via email
✔ sign in via social
✔ sign out
# --seed eee3dc4f-9b3c-4729-9c2b-085139b4a1a0
# 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)
For the latest news and updates, subscribe to our Telegram or X (Twitter)