python-behave

Selenium Firefox Python: Can we use relative path for downloads folder?

Selenium Firefox Python: Can we use relative path for downloads folder? Question: Hello 🙂 This is related to my question here Selenium Firefox Python: How to change download directory thank you so much @Thamognya for the assistance. Can we use a relative path for this? We’re using Docker in CircleCI and it will be much …

Total answers: 1

Python behave fixture on feature level not loaded

Python behave fixture on feature level not loaded Question: This is somewhat related to this question, but I have some further problems in this minimal example below. For a feature test I prepared a fixture which backs up a file which shall be modified during the test run (e.g. a line is appended). After the …

Total answers: 2

Python Behave optional argument

Python Behave optional argument Question: I am trying to write a test using Cucumber (Behave). The ‘given’ statement needs to be able to take an optional parameter, it is for verifying the contents in a string. An example feature syntax for both scenarios would be: Given Verify text "this is a test string" When String …

Total answers: 3

Mocking in Behave and Flask

Mocking in Behave and Flask Question: I am trying to mock an HTTP request call using mock because I don’t want to Behave to call it actually. So I have this code scenario in matches.py file: import request def get_match(): response = request.get(“https://example.com”) return response And in my step definition match_steps.py for behave I have …

Total answers: 1

Is there an easy way to define a step as being both a Given and a When

Is there an easy way to define a step as being both a Given and a When Question: I am building a Py Behave test framework and have a number of scenarios where what was previously a When step becomes a Given E.G in one scenario Given a user has is on the logon page …

Total answers: 2

Can I put step definitions in a folder which is not "steps" with behave?

Can I put step definitions in a folder which is not "steps" with behave? Question: I am trying to work with Behave on Python. I was wondering if there would be a way to put my .py files somewhere else instead of being forced to put them all inside the “steps” folder. My current structure …

Total answers: 4

Debugging python-behave steps with Pycharm

Debugging python-behave steps with Pycharm Question: I’m using Pycharm to write tests and running them with behave. I’m running the behave commands with cli. To write the features and scenarios i’m using Pycharm. How can i debug each step? Asked By: Shizzle || Source Answers: You need Pycharm Professional to easily setup debuging. Just create …

Total answers: 3

How can I see print() statements in behave (BDD)

How can I see print() statements in behave (BDD) Question: Context: I am using Python with Behave (BDD). Whether I run my tests from the command line (behave) or from a custom main(), the behavior is the same: the test runs and the only output that I see in the console is the standard BDD …

Total answers: 8