various #16

Merged
dan merged 94 commits from various into dev 2023-12-14 14:04:01 +01:00
Showing only changes of commit 4fdca79247 - Show all commits

View file

@ -262,6 +262,42 @@ DIR parent_dir
The test files are written in the same way as any other pytest test file. The only difference is that pytest-abra provides custom fixtures that make it easy to get the configuration by the provided .env files and to deal with URLS etc.
### Step 1) Add new Test
Create a new testfile `new_test.py` in the same directory or a subdirectory of `runner_wordpress.py`.
Register `new_test.py` as a test in the `RunnerWordpress` class.
Set prevent_skip=True, so that you can run your new test over and over again for debugging, without it being skipped
```python
# runner_wordpress.py
from pytest_abra import Runner, Test
class RunnerWordpress(Runner):
env_type = "wordpress"
tests = [
Test(test_file="working_test.py"),
Test(test_file="new_test.py", prevent_skip=True),
]
```
```python
# new_test.py
def test_new():
...
```
### Step 2) Call abratest
Call abratest with `--debug` to enable playwright debug mode and either `--session_id` or `--resume`.
```bash
abratest [required-options] --debug --session_id debug_session
```
This could be done by modifying `main.py`. The first time you run abratest, all tests will be executed as usual. The second time, all tests will be skipped as they have passed already. Only your new test will be run again and again, as the prevent_skip option is enabled. So you can run all tests once and then skip all tests besides your new test you want to debug.
# todo: add example
# Playwright Debug & Codegen