Skip to content

Commit 45e47c6

Browse files
committed
Update an example test
1 parent 2ce0391 commit 45e47c6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

integrations/node_js/test_demo_site.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
from seleniumbase import BaseCase
2+
from seleniumbase import version_tuple
23

34

45
class DemoSiteTests(BaseCase):
56
def test_demo_site(self):
67
self.open("https://seleniumbase.io/demo_page")
78

9+
# Fail if the seleniumbase version is less than 4.0.0
10+
if version_tuple < (4, 0, 0):
11+
self.fail("This test requires seleniumbase>=4.0.0")
12+
813
# Assert the title of the current web page
914
self.assert_title("Web Testing Page")
1015

11-
# Assert that the element is visible on the page
16+
# Assert that an element is visible on the page
1217
self.assert_element("tbody#tbodyId")
1318

14-
# Assert that the text appears within a given element
19+
# Assert that a text substring appears in an element
1520
self.assert_text("Demo Page", "h1")
1621

17-
# Type/update text in text fields on the page
22+
# Type text into various text fields and then verify
1823
self.type("#myTextInput", "This is Automated")
1924
self.type("textarea.area1", "Testing Time!\n")
2025
self.type('[name="preText2"]', "Typing Text!")
26+
self.assert_text("This is Automated", "#myTextInput")
27+
self.assert_text("Testing Time!\n", "textarea.area1")
28+
self.assert_text("Typing Text!", '[name="preText2"]')
2129

2230
# Verify that a hover dropdown link changes page text
2331
self.assert_text("Automation Practice", "h3")

0 commit comments

Comments
 (0)