diff --git a/examples/my_first_test.py b/examples/my_first_test.py index 7a585df7..7ce9348e 100755 --- a/examples/my_first_test.py +++ b/examples/my_first_test.py @@ -5,8 +5,8 @@ class MyTestClass(BaseCase): def test_basic(self): self.open("https://xkcd.com/353/") - self.assert_element('img[alt="Python"]') self.assert_title("xkcd: Python") + self.assert_element('img[alt="Python"]') self.click('a[rel="license"]') self.assert_text("free to copy and reuse") self.go_back() diff --git a/examples/parameterized_test.py b/examples/parameterized_test.py index bace7b8e..0e222a80 100644 --- a/examples/parameterized_test.py +++ b/examples/parameterized_test.py @@ -5,11 +5,12 @@ from parameterized import parameterized class GoogleTestClass(BaseCase): @parameterized.expand([ - ["pypi", "https://pypi.org"], - ["wikipedia", "https://www.wikipedia.org"], - ["seleniumbase", "https://github.com/seleniumbase/SeleniumBase"], + ["pypi", "pypi.org"], + ["wikipedia", "wikipedia.org"], + ["seleniumbase", "seleniumbase/SeleniumBase"], ]) - def test_parameterized_google_search(self, search_term, expected_url): + def test_parameterized_google_search(self, search_term, expected_text): self.open('https://google.com/ncr') self.update_text('input[title="Search"]', search_term + '\n') - self.assert_text(expected_url, '#search') + self.assert_element('#resultStats') + self.assert_text(expected_text, '#search') diff --git a/integrations/node_js/my_first_test.py b/integrations/node_js/my_first_test.py index ca77965e..09190c61 100755 --- a/integrations/node_js/my_first_test.py +++ b/integrations/node_js/my_first_test.py @@ -5,8 +5,8 @@ class MyTestClass(BaseCase): def test_basic(self): self.open("https://xkcd.com/353/") - self.assert_element('img[alt="Python"]') self.assert_title("xkcd: Python") + self.assert_element('img[alt="Python"]') self.click('a[rel="license"]') self.assert_text("free to copy and reuse") self.go_back() diff --git a/seleniumbase/console_scripts/sb_mkdir.py b/seleniumbase/console_scripts/sb_mkdir.py index facd4ca7..58eb959d 100755 --- a/seleniumbase/console_scripts/sb_mkdir.py +++ b/seleniumbase/console_scripts/sb_mkdir.py @@ -80,8 +80,8 @@ def main(): data.append("") data.append(" def test_basic(self):") data.append(' self.open("https://xkcd.com/353/")') - data.append(" self.assert_element('img[alt=\"Python\"]')") data.append(' self.assert_title("xkcd: Python")') + data.append(" self.assert_element('img[alt=\"Python\"]')") data.append(" self.click('a[rel=\"license\"]')") data.append(' self.assert_text("free to copy and reuse")') data.append(' self.go_back()') @@ -106,17 +106,17 @@ def main(): data.append("class GoogleTestClass(BaseCase):") data.append("") data.append(" @parameterized.expand([") - data.append(' ["pypi", "https://pypi.org"],') - data.append(' ["wikipedia", "https://www.wikipedia.org"],') - data.append(' ["seleniumbase", ' - '"https://github.com/seleniumbase/SeleniumBase"],') + data.append(' ["pypi", "pypi.org"],') + data.append(' ["wikipedia", "wikipedia.org"],') + data.append(' ["seleniumbase", "seleniumbase/SeleniumBase"],') data.append(" ])") data.append(" def test_parameterized_google_search(" - "self, search_term, expected_url):") + "self, search_term, expected_text):") data.append(" self.open('https://google.com/ncr')") data.append(" self.update_text('input[title=\"Search\"]', " "search_term + '\\n')") - data.append(" self.assert_text(expected_url, '#search')") + data.append(" self.assert_element('#resultStats')") + data.append(" self.assert_text(expected_text, '#search')") data.append("") file_path = "%s/%s" % (dir_name, "parameterized_test.py") file = codecs.open(file_path, "w+", "utf-8")