|
2 | 2 |
|
3 | 3 | <a id="syntax_formats"></a>
|
4 | 4 |
|
5 |
| -## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) The 23 Syntax Formats |
| 5 | +## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="40">](https://github.com/seleniumbase/SeleniumBase/) The 23 Syntax Formats / Design Patterns |
6 | 6 |
|
7 |
| -<h3>SeleniumBase supports multiple design patterns for structuring tests:</h3> |
| 7 | +<h3>SeleniumBase supports multiple ways of structuring tests:</h3> |
8 | 8 |
|
9 | 9 | <blockquote>
|
10 | 10 | <p dir="auto"></p>
|
@@ -849,9 +849,9 @@ with DriverContext() as driver:
|
849 | 849 |
|
850 | 850 | with DriverContext(browser="chrome", incognito=True) as driver:
|
851 | 851 | driver.get("https://seleniumbase.io/apps/calculator")
|
852 |
| - page_actions.wait_for_element(driver, "4", by="id").click() |
853 |
| - page_actions.wait_for_element(driver, "2", by="id").click() |
854 |
| - page_actions.wait_for_text(driver, "42", "output", by="id") |
| 852 | + page_actions.wait_for_element(driver, '[id="4"]').click() |
| 853 | + page_actions.wait_for_element(driver, '[id="2"]').click() |
| 854 | + page_actions.wait_for_text(driver, "42", "#output") |
855 | 855 | js_utils.highlight_with_js(driver, "#output", loops=6)
|
856 | 856 |
|
857 | 857 | with DriverContext() as driver:
|
@@ -880,9 +880,9 @@ from seleniumbase import page_actions
|
880 | 880 | driver = Driver(browser="chrome", headless=False)
|
881 | 881 | try:
|
882 | 882 | driver.get("https://seleniumbase.io/apps/calculator")
|
883 |
| - page_actions.wait_for_element(driver, "4", by="id").click() |
884 |
| - page_actions.wait_for_element(driver, "2", by="id").click() |
885 |
| - page_actions.wait_for_text(driver, "42", "output", by="id") |
| 883 | + page_actions.wait_for_element(driver, '[id="4"]').click() |
| 884 | + page_actions.wait_for_element(driver, '[id="2"]').click() |
| 885 | + page_actions.wait_for_text(driver, "42", "#output") |
886 | 886 | js_utils.highlight_with_js(driver, "#output", loops=6)
|
887 | 887 | finally:
|
888 | 888 | driver.quit()
|
|
0 commit comments