Skip to content

Commit 8a528fb

Browse files
authored
Merge pull request #1929 from seleniumbase/a-variety-of-updates
A variety of updates
2 parents 0cee731 + a35d9f8 commit 8a528fb

File tree

15 files changed

+42
-22
lines changed

15 files changed

+42
-22
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,27 +312,29 @@ pytest my_first_test.py
312312
313313
```python
314314
from seleniumbase import BaseCase
315+
BaseCase.main(__name__, __file__)
315316
316317
class MyTestClass(BaseCase):
317318
def test_swag_labs(self):
318319
self.open("https://www.saucedemo.com")
319320
self.type("#user-name", "standard_user")
320321
self.type("#password", "secret_sauce\n")
321322
self.assert_element("div.inventory_list")
322-
self.assert_text("PRODUCTS", "span.title")
323+
self.assert_exact_text("Products", "span.title")
323324
self.click('button[name*="backpack"]')
324325
self.click("#shopping_cart_container a")
325-
self.assert_text("YOUR CART", "span.title")
326+
self.assert_exact_text("Your Cart", "span.title")
326327
self.assert_text("Backpack", "div.cart_item")
327328
self.click("button#checkout")
328329
self.type("#first-name", "SeleniumBase")
329330
self.type("#last-name", "Automation")
330331
self.type("#postal-code", "77123")
331332
self.click("input#continue")
332-
self.assert_text("CHECKOUT: OVERVIEW")
333+
self.assert_text("Checkout: Overview")
333334
self.assert_text("Backpack", "div.cart_item")
335+
self.assert_text("29.99", "div.inventory_item_price")
334336
self.click("button#finish")
335-
self.assert_exact_text("THANK YOU FOR YOUR ORDER", "h2")
337+
self.assert_exact_text("Thank you for your order!", "h2")
336338
self.assert_element('img[alt="Pony Express"]')
337339
self.js_click("a#logout_sidebar_link")
338340
self.assert_element("div#login_button_container")
@@ -698,7 +700,7 @@ pytest --dashboard --rs --headless
698700
python -m http.server 1948
699701
```
700702
701-
🔵 Now you can navigate to ``http://localhost:1948/dashboard.html`` in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory. (Use ``CTRL+C`` to stop the http server.)
703+
🔵 Now you can navigate to ``http://localhost:1948/dashboard.html`` in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory. (Use <kbd>Ctrl+C</kbd> to stop the http server.)
702704
703705
🔵 Here's a full example of what the SeleniumBase Dashboard may look like:
704706

examples/example_logs/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pytest --dashboard --rs --headless
4040
python -m http.server 1948
4141
```
4242

43-
🔵 Now you can navigate to ``http://localhost:1948/dashboard.html`` in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory. (Use ``CTRL+C`` to stop the http server.)
43+
🔵 Now you can navigate to ``http://localhost:1948/dashboard.html`` in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory. (Use <kbd>Ctrl+C</kbd> to stop the http server.)
4444

4545
🔵 Here's a full example of what the SeleniumBase Dashboard may look like:
4646

help_docs/customizing_test_runs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ pytest --dashboard --rs --headless
331331
python -m http.server 1948
332332
```
333333

334-
🔵 Now you can navigate to ``http://localhost:1948/dashboard.html`` in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory. (Use ``CTRL+C`` to stop the http server.)
334+
🔵 Now you can navigate to ``http://localhost:1948/dashboard.html`` in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory. (Use <kbd>Ctrl+C</kbd> to stop the http server.)
335335

336336
🔵 Here's a full example of what the SeleniumBase Dashboard may look like:
337337

integrations/brython/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pip install brython
2121
python -m http.server
2222
```
2323

24-
You can always stop the server by using ``CTRL+C``.
24+
(You can stop the server by using <kbd>Ctrl+C</kbd>)
2525

2626
### 2. Navigate to [http://localhost:8000/](http://localhost:8000/)
2727

integrations/node_js/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ npm ci
3333
node server.js
3434
```
3535

36-
(You can always stop the server by using ``CTRL+C``.)
36+
(You can stop the server by using <kbd>Ctrl+C</kbd>)
3737

3838
#### 5. Open the SeleniumBase Test Runner web app
3939

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edit_uri: ""
1010
site_dir: "site"
1111
docs_dir: "mkdocs_build"
1212
# Copyright
13-
copyright: Copyright &copy; 2014 - 2022 Michael Mintz
13+
copyright: Copyright &copy; 2014 - 2023 Michael Mintz
1414
# Extensions
1515
markdown_extensions:
1616
- admonition

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pipdeptree>=2.9.3
1010
docutils==0.20.1
1111
python-dateutil==2.8.2
1212
livereload==2.6.3
13-
joblib==1.2.0
13+
joblib==1.3.1
1414
Markdown==3.3.7
1515
MarkupSafe==2.1.3
1616
Jinja2==3.1.2

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pygments==2.14.0;python_version<"3.7"
8585
pygments==2.15.1;python_version>="3.7"
8686
pyreadline3==3.4.1;platform_system=="Windows"
8787
tabcompleter==1.2.1
88-
pdbp==1.4.1
88+
pdbp==1.4.2
8989
colorama==0.4.5;python_version<"3.7"
9090
colorama==0.4.6;python_version>="3.7"
9191
exceptiongroup==1.1.1;python_version>="3.7"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.15.5"
2+
__version__ = "4.15.6"

seleniumbase/fixtures/base_case.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# --------------------------------------------------------------
1717
from seleniumbase import BaseCase
18+
BaseCase.main(__name__, __file__)
1819
class MyTestClass(BaseCase):
1920
def test_anything(self):
2021
# Write your code here. Example:
@@ -8061,7 +8062,7 @@ def wait_for_element_visible(
80618062
original_selector = selector
80628063
selector, by = self.__recalculate_selector(selector, by)
80638064
if self.__is_shadow_selector(selector):
8064-
return self.__wait_for_shadow_element_visible(selector, timeout)
8065+
return self.__get_shadow_element(selector, timeout)
80658066
return page_actions.wait_for_element_visible(
80668067
self.driver,
80678068
selector,
@@ -8478,7 +8479,7 @@ def wait_for_element(self, selector, by="css selector", timeout=None):
84788479
action = ["wf_el", selector, origin, time_stamp]
84798480
self.__extra_actions.append(action)
84808481
if self.__is_shadow_selector(selector):
8481-
return self.__wait_for_shadow_element_visible(selector, timeout)
8482+
return self.__get_shadow_element(selector, timeout)
84828483
return page_actions.wait_for_element_visible(
84838484
self.driver, selector, by, timeout
84848485
)
@@ -12995,7 +12996,10 @@ def __get_shadow_element(
1299512996
By.CSS_SELECTOR, value=selector_part
1299612997
)
1299712998
is_present = True
12998-
if must_be_visible:
12999+
if (
13000+
selector_part == selectors[-1]
13001+
and must_be_visible
13002+
):
1299913003
if not element.is_displayed():
1300013004
raise Exception(
1300113005
"Shadow Root element not visible!"
@@ -13010,7 +13014,11 @@ def __get_shadow_element(
1301013014
By.CSS_SELECTOR, value=selector_part
1301113015
)
1301213016
is_present = True
13013-
if must_be_visible and not element.is_displayed():
13017+
if (
13018+
selector_part == selectors[-1]
13019+
and must_be_visible
13020+
and not element.is_displayed()
13021+
):
1301413022
raise Exception(
1301513023
"Shadow Root element not visible!"
1301613024
)

0 commit comments

Comments
 (0)