Questions tagged [pytest-bdd]

86 questions
0
votes
0 answers

Pytest BDD: "TypeError: 'NoneType' object is not callable" when trying to use scenarios decorator

I have a number of tests that have the same feature file format, but pass across different arguments and assert different json responses so I want to use the scenarios decorator over scenario. The decorator I am trying to use…
berimbolo
  • 3,319
  • 8
  • 43
  • 78
0
votes
2 answers

Unable to utilise the steps of feature file 1 to another feature file 2 in Pytest-bdd

I have two feature files in features folder features login.feature dashboard.feature #feature1 feature: testing a new page scenario: I want to test login screen Given User is in home page Then clicked on login button #feature2 @login scenario: I…
0
votes
1 answer

test is failing because flask is returning stream insted of json

I'm my flask app, I have an route/controller that creates something I call an entity: @api.route('/entities', methods=['POST']) def create_entity(): label = request.get_json()['label'] entity = entity_context.create(label) print('the…
David J.
  • 1,753
  • 13
  • 47
  • 96
0
votes
1 answer

key error in requests object, even though key is present (pytest-bdd)

I have the following feature in tests/features/Admin.feature Feature: Admin Scenario Outline: register a new user Given I'm logged in as an admin at "" with email "" and password "" When I call the…
David J.
  • 1,753
  • 13
  • 47
  • 96
0
votes
1 answer

How to pass different values for same parameter in Example using pytest bdd for scenario statement

Here is my feature file Scenario Outline: Test different value for same parameter Examples: | app | app1 | | instagram| facebook | Given is installed on my device And is installed on my device @given(" is installed on…
Raj
  • 165
  • 1
  • 2
  • 11
0
votes
1 answer

Pytest-bdd - Fixture 'self' not found

i am using pytest-bdd Here is my feature file #recon_test.feature Feature: This is used to run recon Scenarios:Run Recon Test File '''python #recon_test.py Class Recon_Tests(): @scenario('recon_test.feature','Run Recon') def…
Testing
  • 1
  • 3
0
votes
0 answers

python bdd framwork. how do we create same steps in multiple feature file

I would like to use steps from one feature file in another feature file with additional steps feature file 1 secenario outline: sample test Given step 1 with id then step 2 with name and step 3 with address |id | name | address| |1 | rahul |…
satishsrip
  • 125
  • 3
  • 12
0
votes
1 answer

python bdd framework: How to execute a code before and after step

I am tyring to implement funtionality before a step and after a step in python Scenario: Addition Given Calculator app is run When I input "2+3" to calculator Then I get result "5" i wish to execute a funtionality before…
satishsrip
  • 125
  • 3
  • 12
0
votes
2 answers

Python Community : Can we use BDD framework in community version?

I am self learning automation testing using Python. When going through few blogs they mentioned they have used Pycharm Professional version for Behave or Py-test BDD framework. Can we use Pycharm community version for BDD frameworks? Any advice is…
user29496
  • 187
  • 1
  • 3
  • 10
0
votes
2 answers

Pytest-bdd giving an name error for variables defined in scenario outline

I am trying to run a test with ptest-bdd. I've used the scenario outline but the variable username is returning a name error saying that username is not defined. I would greatly appreciate a second pair of eyes on my code. Here is the feature file:…
Jamie Kook
  • 81
  • 5
-2
votes
2 answers

Pytest bdd, the features aren't recognized anymore

I have a strange case. I can't run my pytest anymore because he doesn't found the features (who are there btw). Here is the error message and the proof that the files are there . Thx
1 2 3 4 5
6