I'm using Python & Pytest to write Playwrite tests. PyCharm is the my IDE.
When I'm debugging a test - I run it from the IDE (by pressing the play icon next to the test). I would like to be able to view the browser during the run in order to debug.
The problem is that when using the 'page' fixture - the default mode is headless.
I know that I can run the test from the CLI and add the flag '--headed', but I want to run headed also by running from the IDE.
Is that possible?
Yes, this is possible! Just create or add to your pytest.ini file which should go in the root of the working directory.
Here is what the pytest.ini file could look like:
# content of pytest.ini
[pytest]
addopts = -v --browser chromium --headed --slowmo 2000
Having --headed in there is what gives you what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With