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 of cases.
And then I generated my post_steps.py from the feature files. And There are some common steps in all steps pages. and so I decided to put them to commonsteps.py under the common folder.
Then,in the common.py, There some common methods as in the below asserts status code:
@then('Status code of response should be 200')
def status_code_of_response_should_be_200():
assert status_code == 200
My tests starts with mypost.py and then starts to use this common methods but How can I pass response,status code to this page ? because I need to verify . In a nutshell, How Can I get response as a parameter from different steps page?enter image description here