You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: help_docs/syntax_formats.md
+43-30Lines changed: 43 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
<aid="syntax_formats"></a>
4
4
5
-
## [<imgsrc="https://seleniumbase.github.io/img/logo6.png"title="SeleniumBase"width="40">](https://github.com/seleniumbase/SeleniumBase/) The 23 Syntax Formats / Design Patterns
5
+
<h2><imgsrc="https://seleniumbase.github.io/img/logo6.png"title="SeleniumBase"width="40"> The 23 Syntax Formats / Design Patterns</h2>
6
6
7
-
<h3>SeleniumBase supports multiple ways of structuring tests:</h3>
7
+
<h3>🔡 SeleniumBase supports multiple ways of structuring tests:</h3>
8
8
9
9
<blockquote>
10
10
<pdir="auto"></p>
@@ -873,30 +873,26 @@ with SB(test=True, rtf=True, demo=True) as sb:
873
873
This pure Python format gives you a raw <codetranslate="no">webdriver</code> instance in a <codetranslate="no">with</code> block. The SeleniumBase Driver Manager will automatically make sure that your driver is compatible with your browser version. It gives you full access to customize driver options via method args or via the command-line. The driver will automatically call <codetranslate="no">quit()</code> after the code leaves the <codetranslate="no">with</code> block. Here are some examples:
874
874
875
875
```python
876
-
"""This script can be run with pure "python". (pytest not needed)."""
(See <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_driver_context.py">examples/raw_driver_context.py</a> for an example.)
@@ -907,31 +903,48 @@ with DriverContext() as driver:
907
903
Another way of running Selenium tests with pure ``python`` (as opposed to using ``pytest`` or ``pynose``) is by using this format, which bypasses [BaseCase](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py) methods while still giving you a flexible driver with a manager. SeleniumBase includes helper files such as [page_actions.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/page_actions.py), which may help you get around some of the limitations of bypassing ``BaseCase``. Here's an example:
908
904
909
905
```python
910
-
"""This script can be run with pure "python". (pytest not needed)."""
906
+
"""Driver() test. Runs with "python". (pytest not needed)."""
911
907
from seleniumbase import Driver
912
-
from seleniumbase import js_utils
913
-
from seleniumbase import page_actions
914
908
915
-
# Example with options. (Also accepts command-line options.)
0 commit comments