diff --git a/docs/documentation.md b/docs/documentation.md index 8b3d30b..560ce6e 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -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