Questions tagged [pytest-bdd]
86 questions
1
vote
0 answers
I cannot make pytest-bdd work with pytest-asyncio
I am trying to create a test for set some values in a device and then query them from device to assert that they are equal several times with specific time intervals. But for this to work I need to run query and assert things async because I cannot…

FroMoSouOmou
- 11
- 3
1
vote
0 answers
Run a specific pytest-bdd scenario from VSCode UI
I'm looking for a way to run specific Pytest BDD scenarios from VSCode UI. At the moment the UI can run all scenarios in a class, but not specific scenarios.
Project structure:
tests
|-- features
|--sample_tests.feature
|-- step_defs
…

Kamil
- 31
- 5
1
vote
0 answers
Python PyTest : How to read examples from external excel file for Scenarios Outline
Instead of passing data from Examples: I want to pass the data from excel. as in that step I just want to compare expected and actual results for batch automation. I have 100s of test data to be tested for the same scenario.
I could pass the test…

Sara Ananth
- 33
- 3
1
vote
1 answer
Is there a way to use pytest.raises in pytest-bdd "When" steps?
I would like to define a scenario as follows:
Scenario: An erroneous operation
Given some data
And some more data
When I perform an operation
Then an exception is raised
Is there a good way to do this so that the when step isn't actually…

asthasr
- 9,125
- 1
- 29
- 43
1
vote
2 answers
Generate allure report using pytest-bdd not showing anything
I have tried this code : https://github.com/SharifKhan515/Orange_Hr_Automation and everything work well, include with the report. but I need more information how using gherkin style in the report and I change the allure allure-pytest to be…

Dzone
- 11
- 2
1
vote
1 answer
How to run a specific function at the end of a specific scenario test in pytest BDD using fixtures
Background
I need to run some specific method after a scenario run for a specific test scenario
What I tried
Scenario is as below
Scenario: Test Fixture
Given I am a mechanic
When I start a car
Then I should get to know the primitive…

KBNanda
- 595
- 1
- 8
- 25
1
vote
1 answer
Two examples for same scenario outline Gherkin
I need to verify bunch of sites that are using our templates. After login in I need to verify many info which I will put in the second table. How to write the gherkin code so that For each item in table "userinfo" it goes through All the items in…

Rana
- 389
- 5
- 17
1
vote
1 answer
What is the benefit of creating a feature.file in pytest-bdd, as we are still running the tests from steps. Unlike cucumber with Java
I am new to Python, pytest-bdd but have been creating frameworks in Java, TestNG, cucumber for a long time. So here in pytest-bdd I am creating the feature file and then on top of that, we are creating the step definitions and then running the…

Mohit Lohani
- 11
- 6
1
vote
1 answer
How can I change variables for the next step in pytest-bdd?
I want to change the x from one step to the other, without adding another function
Feature: Calculator
Scenario Outline: simple sum
Given the x is 1
And the x is
Examples:
| x |
| 5 |
from pytest_bdd…

goncalo andrade
- 57
- 9
1
vote
0 answers
KeyError in allure-pytest-bdd when executing test with --alluredir and using Examples in feature
I'm using pytest-6.2.4 for test automation with plugins allure-pytest-bdd-2.8.36, bdd-4.0.2. Python version is 3.6.9.
KeyError occurs when running pytest with flag --alluredir=reports.
Test contains feature with Examples:
| empty_answer1 | <-…

SimonovaU
- 11
- 1
1
vote
1 answer
How to get response and use in other steps in pytest-bdd as argument
I tried to make a design for my API Python Project with pytest-bdd. I made "common, features, test" folders.
And in the feature file, I added my post, delete , get, put cases. I also seperated post.feature delete.feature etc.. due to there are lost…

Emily
- 43
- 6
1
vote
1 answer
Pytest Bdd : How to continue execution of steps in BDD even if one failed
I have a scenario like this implemented on pytest-bdd
Scenario: Shopping Cart Verification
Given I am out for shopping shopping and took a cart
Given I added "2" "Tomatoes" to the cart
Given I added "3" "Bread" to the cart
Then there is "3"…

LINTO JOHN
- 125
- 1
- 6
1
vote
1 answer
Step implementation not found pytest-bdd
I've been using pytest and pytest-bdd v3.4 for running UI tests. For some reason the following error is occuring. pytest_bdd.exceptions.StepDefinitionNotFoundError: Step definition is not found.
The function was implemented, but pytest is unable to…

Uribe2304
- 51
- 1
- 8
1
vote
1 answer
Is it possible to use pytest-bdd with SeleniumBase?
This is how I would write a SeleniumBase/pytest-bdd test:
ddg.feature:
Feature: Browse DuckDuckGo
Going to DuckDuckGo webpage.
Scenario: I can see the title
When I go to DuckDuckGo webpage
Then Duck is present in the…

Rafutk
- 196
- 1
- 1
- 15
1
vote
1 answer
Pytest Bdd Getting table value from Gherkin given condition
Scenario Outline: scenario sample
Given the following datasource details are given
| dataSet | startDate | endDate |
| | | |
When the user wants to ""
Then usage count is ""
…

Esra
- 13
- 4