Questions tagged [pytest-bdd]

86 questions
1
vote
0 answers

500 Internal Server error when trying to post using (requests.post()) in python

I am new to python and I am trying to automate post API in which I am using post method as follows:- headers = {'Content-Type': 'application/json', 'Authorization': 'Basic xxxx=='} response = requests.post(url=urlsales, data=payload, …
zzz
  • 497
  • 3
  • 14
  • 32
1
vote
3 answers

Pytest BDD : E fixture 'test_login' not found

Hi need some help on how to fixed the error messages E fixture 'test_login' not found > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, metadata, monkeypatch, pytestbdd_given_User logged…
rkevx21
  • 2,441
  • 5
  • 19
  • 40
1
vote
0 answers

Attach web-page screenshot to all "then" allure steps (pytest-bdd, selenium, allure)

I'm writing pytest-bdd + selenium + allure tests. And i need to attach screenshot to each verification step - @then("..."). Pytest bdd have "after step" hook which i implemented like this: def pytest_bdd_after_step(request, feature, scenario, step,…
1
vote
2 answers

How to uninstall a python package installed using .tar.gz?

I am new to python. I recently installed a package using the source file .tar.gz in my conda environment using pip install . Upon trying to uninstall the package I am getting below error - (3point7) wkmca9711659:~…
Richa
  • 11
  • 3
0
votes
1 answer

The feature steps are highlighted with yellow lines [warning] saying "Cannot find declaration to go"

I'm using pytest-bdd framework and I have created the feature file but the steps are highlighted with yellow lines [warning] saying "Cannot find declaration to go". I'm using Pycharm community edition. installed Gherkins plugin too. Is there a way…
0
votes
0 answers

pytest-bdd collects the same scenario twice

I have started to refactor a project at the company I work with. The structure looks like this: root |---features | |-masks.feature | |---steps_def | |-test_article.py | |-test_author.py | |-conftest.py I am fairly new to…
Saidden
  • 111
  • 4
0
votes
0 answers

How can I load data from an external file for pytest-bdd example data?

I'm trying to load Examples data from an external file using pytest-bdd. My approach was to simply hook into the pytest_bdd_before_scenario event and rewrite the Examples data in the scenario object. Here's my code attempt to do that: def…
Chris B. Behrens
  • 6,255
  • 8
  • 45
  • 71
0
votes
0 answers

Pytest BDD - StepDefinitionNotFoundError: Step definition is not found

I am learning automated testing, and when testing login scenarios, it shows me this error: pytest_bdd.exceptions.StepDefinitionNotFoundError: Step definition is not found: Given "I am on the login page". Line 5 in scenario "OK Login" in the feature…
0
votes
1 answer

pytest-bdd Retrieve entire unique row based on particular value of outline table

I am looking to get the entire unique row based on test_type_to_run value, for example I want to only retrieve the rows having test_type_to_run==regression and skip the rows with 'smoke' Feature: Add a new module using API Scenario Outline: the…
Automation Engr
  • 444
  • 2
  • 4
  • 26
0
votes
0 answers

Pytest BDD feature file organization

I'm currently implementing a behavior driven API test automation using Pytest with Pytest-bdd. My folder structure looks likes this C:. │ config.json │ geckodriver.log │ __init__.py ├───.vscode │ settings.json │ ├───features │ | …
s kop
  • 196
  • 4
  • 18
0
votes
0 answers

I cannot parametrize and also make it a given statement in pytest/pytest-bdd

I want to make a test in pytest and I am also using pytest-bdd. The idea is I have an id and from this id, I calculate a destination. But in the next steps, this destination may change, it can be a broadcast or to a specific group or an individual.…
0
votes
1 answer

Pytest BDD - Problem with Fixtures and Conftest

I'm trying to automatize API testing with pytest-bdd and gherkin feature files. My folder structur looks like this C:. │ config.json │ conftest.py │ geckodriver.log │ __init__.py ├───.vscode │ settings.json │ ├───features │ …
s kop
  • 196
  • 4
  • 18
0
votes
2 answers

How to use Parameterized fixtures in pytest-bdd

I am trying to use parameterized fixture in my pytest-bdd framework. Normal fixture works fine. But If I am passing parameters, it gives below error The requested fixture has no parameter defined for test: Below is my code(Sample). Waht is the…
S_G
  • 67
  • 6
0
votes
0 answers

How to capture screenshot for failed test when using Pytest-bdd and Playwright-Python with non default context

I am using pytest-bdd, Playwright Python, Allure report for my project. Everything works great but the screenshot for failed tests. Playwright-pytest has screenshot option --screenshot but it does not work when using non default…
Soprano86
  • 73
  • 2
  • 10
0
votes
0 answers

pytest-bdd need to use data table format in feature file a

I am new to pytest-bdd framework. Below is sample feature file Content: Scenario: Sample scenario Given The following details: no | details1 | detail2 | 1 | something1 | a1 | 2 |…
Togad
  • 1
  • 1
  • 6