Skip to content

Commit 98a3e2c

Browse files
committed
Update ReadMe for retrying failing tests automatically
1 parent 91b7362 commit 98a3e2c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,15 @@ self.driver.find_elements_by_partial_link_text("GitHub")
685685
```
686686
(In general, you'll want to use the SeleniumBase versions of methods when available.)
687687

688+
#### Retry Failing Tests Automatically
689+
690+
You can use ``--reruns #`` to retry failing tests that many times. Use ``--reruns-delay #`` to wait that many seconds between retries. Example:
691+
```
692+
pytest --reruns 5 --reruns-delay 1
693+
```
694+
695+
Additionally, you can use the ``@retry_on_exception()`` decorator to specifically retry failing methods. (First import: ``from seleniumbase import decorators``) To learn more about SeleniumBase decorators, [click here](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/common).
696+
688697
#### Checking Email:
689698
Let's say you have a test that sends an email, and now you want to check that the email was received:
690699

0 commit comments

Comments
 (0)