Skip to content

Commit a7e8bd0

Browse files
authored
Merge pull request #275 from seleniumbase/update-examples
Update examples
2 parents 2a6b0e1 + 52881ba commit a7e8bd0

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class MyTestClass(BaseCase):
187187
self.assert_text('free to copy', 'div center')
188188
self.open("https://xkcd.com/1481/")
189189
title = self.get_attribute("#comic img", "title")
190-
self.assertTrue("86,400 seconds per day" in title)
190+
self.assert_true("86,400 seconds per day" in title)
191191
self.click('link=Blag')
192192
self.assert_text('The blag of the webcomic', 'h2')
193193
self.update_text('input#s', 'Robots!\n')
@@ -523,9 +523,9 @@ self.assert_text("Tea. Earl Grey. Hot.", "div#trek div.picard div.quotes", timeo
523523
#### Asserting Anything
524524

525525
```python
526-
self.assertTrue(myvar1 == something)
526+
self.assert_true(myvar1 == something)
527527

528-
self.assertEqual(var1, var2)
528+
self.assert_equal(var1, var2)
529529
```
530530

531531
#### Useful Conditional Statements (with creative examples in action)
@@ -715,7 +715,7 @@ try:
715715
num_email_results = len(html_text)
716716
except EmailException:
717717
num_email_results = 0
718-
self.assertTrue(num_email_results) # true if not zero
718+
self.assert_true(num_email_results) # true if not zero
719719
```
720720

721721
Now you can parse through the email if you're looking for specific text or want to navigate to a link listed there.

examples/boilerplates/samples/google_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def test_google_dot_com(self):
1818
self.assert_text('github.com', ResultsPage.search_results)
1919
self.click_link_text('Images')
2020
source = self.get_page_source()
21-
self.assertTrue("Image result for github" in source)
21+
self.assert_true("Image result for github" in source)

examples/proxy_bing_test.py renamed to examples/get_ip_with_bing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class MyTestClass(BaseCase):
66

7-
def test_proxy_on_bing(self):
7+
def test_get_ip_address_with_bing(self):
88
self.open('https://www.bing.com/search?q=what+is+my+ip')
99
ip_address = self.get_text("#b_results li.b_top")
1010
print("\n\n%s\n" % ip_address)

examples/my_first_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_basic(self):
1010
self.assert_text('free to copy', 'div center') # Assert text on page
1111
self.open("https://xkcd.com/1481/")
1212
title = self.get_attribute("#comic img", "title") # Get an attribute
13-
self.assertTrue("86,400 seconds per day" in title)
13+
self.assert_true("86,400 seconds per day" in title)
1414
self.click('link=Blag') # Click on link
1515
self.assert_text('The blag of the webcomic', 'h2')
1616
self.update_text('input#s', 'Robots!\n') # Type text
@@ -58,7 +58,7 @@ def test_basic(self):
5858
# Is the same as:
5959
# [
6060
# text = self.get_text("div center")
61-
# self.assertTrue("free to copy" in text)
61+
# self.assert_true("free to copy" in text)
6262
# ]
6363
# Or:
6464
# [

integrations/node_js/my_first_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_basic(self):
1010
self.assert_text('free to copy', 'div center')
1111
self.open("http://xkcd.com/1481/")
1212
title = self.get_attribute("#comic img", "title")
13-
self.assertTrue("86,400 seconds per day" in title)
13+
self.assert_true("86,400 seconds per day" in title)
1414
self.click('link=Blag')
1515
self.assert_text('The blag of the webcomic', 'h2')
1616
self.update_text('input#s', 'Robots!\n')

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ beautifulsoup4>=4.6.0
1818
colorama==0.4.1
1919
pyotp>=2.2.7
2020
boto>=2.49.0
21-
flake8==3.7.4
21+
flake8==3.7.5
2222
PyVirtualDisplay==0.2.1
2323
-e .

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def main():
8686
data.append(
8787
" title = self.get_attribute(\"#comic img\", \"title\")")
8888
data.append(
89-
" self.assertTrue(\"86,400 seconds per day\" in title)")
89+
" self.assert_true(\"86,400 seconds per day\" in title)")
9090
data.append(" self.click('link=Blag')")
9191
data.append(
9292
" self.assert_text('The blag of the webcomic', 'h2')")
@@ -230,7 +230,7 @@ def main():
230230
data.append(" self.click_link_text('Images')")
231231
data.append(" source = self.get_page_source()")
232232
data.append(
233-
" self.assertTrue('Image result for github' in source)")
233+
" self.assert_true('Image result for github' in source)")
234234
data.append("")
235235
file_path = "%s/%s" % (dir_name_3, "google_test.py")
236236
file = codecs.open(file_path, "w+", "utf-8")

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.19.2',
20+
version='1.19.3',
2121
description='Reliable Browser Automation & Testing Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',
@@ -71,7 +71,7 @@
7171
'colorama==0.4.1',
7272
'pyotp>=2.2.7',
7373
'boto>=2.49.0',
74-
'flake8==3.7.4',
74+
'flake8==3.7.5',
7575
'PyVirtualDisplay==0.2.1',
7676
],
7777
packages=[

0 commit comments

Comments
 (0)