diff --git a/examples/my_first_test.py b/examples/my_first_test.py index 4ad4b7b3..aa0d4a2f 100755 --- a/examples/my_first_test.py +++ b/examples/my_first_test.py @@ -4,19 +4,19 @@ from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_basic(self): - self.open('https://xkcd.com/353/') # Navigate to the web page + self.open("https://xkcd.com/353/") # Navigate browser to page self.assert_element('img[alt="Python"]') # Assert element on page self.click('a[rel="license"]') # Click element on page - self.assert_text('free to copy', 'div center') # Assert text on page + self.assert_text("free to copy", "div center") # Assert text in area self.open("https://xkcd.com/1481/") title = self.get_attribute("#comic img", "title") # Get an attribute self.assert_true("86,400 seconds per day" in title) - self.click('link=Blag') # Click on link - self.assert_text('The blag of the webcomic', 'h2') - self.update_text('input#s', 'Robots!\n') # Type text - self.assert_text('Hooray robots!', '#content') - self.open('https://xkcd.com/1319/') - self.assert_text('Automation', 'div#ctitle') + self.click("link=Blag") # Click on link + self.assert_text("The blag of the webcomic", "h2") + self.update_text("input#s", "Robots!\n") # Type text + self.assert_text("Hooray robots!", "#content") + self.open("https://xkcd.com/1319/") + self.assert_exact_text("Automation", "#ctitle") #### diff --git a/integrations/node_js/my_first_test.py b/integrations/node_js/my_first_test.py index 8ec4d308..c3e14e1a 100755 --- a/integrations/node_js/my_first_test.py +++ b/integrations/node_js/my_first_test.py @@ -16,4 +16,4 @@ class MyTestClass(BaseCase): self.update_text('input#s', 'Robots!\n') self.assert_text('Hooray robots!', '#content') self.open('http://xkcd.com/1319/') - self.assert_text('Automation', 'div#ctitle') + self.assert_exact_text('Automation', '#ctitle') diff --git a/seleniumbase/console_scripts/sb_mkdir.py b/seleniumbase/console_scripts/sb_mkdir.py index b277ff83..da5743b9 100755 --- a/seleniumbase/console_scripts/sb_mkdir.py +++ b/seleniumbase/console_scripts/sb_mkdir.py @@ -93,7 +93,7 @@ def main(): data.append(" self.update_text('input#s', 'Robots!\\n')") data.append(" self.assert_text('Hooray robots!', '#content')") data.append(" self.open('https://xkcd.com/1319/')") - data.append(" self.assert_text('Automation', 'div#ctitle')") + data.append(" self.assert_exact_text('Automation', '#ctitle')") data.append("") file_path = "%s/%s" % (dir_name, "my_first_test.py") file = codecs.open(file_path, "w+", "utf-8")