Skip to content

Update examples #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class MyTestClass(BaseCase):
self.assert_text('free to copy', 'div center')
self.open("https://xkcd.com/1481/")
title = self.get_attribute("#comic img", "title")
self.assertTrue("86,400 seconds per day" in title)
self.assert_true("86,400 seconds per day" in title)
self.click('link=Blag')
self.assert_text('The blag of the webcomic', 'h2')
self.update_text('input#s', 'Robots!\n')
Expand Down Expand Up @@ -523,9 +523,9 @@ self.assert_text("Tea. Earl Grey. Hot.", "div#trek div.picard div.quotes", timeo
#### Asserting Anything

```python
self.assertTrue(myvar1 == something)
self.assert_true(myvar1 == something)

self.assertEqual(var1, var2)
self.assert_equal(var1, var2)
```

#### Useful Conditional Statements (with creative examples in action)
Expand Down Expand Up @@ -715,7 +715,7 @@ try:
num_email_results = len(html_text)
except EmailException:
num_email_results = 0
self.assertTrue(num_email_results) # true if not zero
self.assert_true(num_email_results) # true if not zero
```

Now you can parse through the email if you're looking for specific text or want to navigate to a link listed there.
Expand Down
2 changes: 1 addition & 1 deletion examples/boilerplates/samples/google_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def test_google_dot_com(self):
self.assert_text('github.com', ResultsPage.search_results)
self.click_link_text('Images')
source = self.get_page_source()
self.assertTrue("Image result for github" in source)
self.assert_true("Image result for github" in source)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class MyTestClass(BaseCase):

def test_proxy_on_bing(self):
def test_get_ip_address_with_bing(self):
self.open('https://www.bing.com/search?q=what+is+my+ip')
ip_address = self.get_text("#b_results li.b_top")
print("\n\n%s\n" % ip_address)
Expand Down
4 changes: 2 additions & 2 deletions examples/my_first_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_basic(self):
self.assert_text('free to copy', 'div center') # Assert text on page
self.open("https://xkcd.com/1481/")
title = self.get_attribute("#comic img", "title") # Get an attribute
self.assertTrue("86,400 seconds per day" in title)
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
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_basic(self):
# Is the same as:
# [
# text = self.get_text("div center")
# self.assertTrue("free to copy" in text)
# self.assert_true("free to copy" in text)
# ]
# Or:
# [
Expand Down
2 changes: 1 addition & 1 deletion integrations/node_js/my_first_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_basic(self):
self.assert_text('free to copy', 'div center')
self.open("http://xkcd.com/1481/")
title = self.get_attribute("#comic img", "title")
self.assertTrue("86,400 seconds per day" in title)
self.assert_true("86,400 seconds per day" in title)
self.click('link=Blag')
self.assert_text('The blag of the webcomic', 'h2')
self.update_text('input#s', 'Robots!\n')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ beautifulsoup4>=4.6.0
colorama==0.4.1
pyotp>=2.2.7
boto>=2.49.0
flake8==3.7.4
flake8==3.7.5
PyVirtualDisplay==0.2.1
-e .
4 changes: 2 additions & 2 deletions seleniumbase/console_scripts/sb_mkdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def main():
data.append(
" title = self.get_attribute(\"#comic img\", \"title\")")
data.append(
" self.assertTrue(\"86,400 seconds per day\" in title)")
" self.assert_true(\"86,400 seconds per day\" in title)")
data.append(" self.click('link=Blag')")
data.append(
" self.assert_text('The blag of the webcomic', 'h2')")
Expand Down Expand Up @@ -230,7 +230,7 @@ def main():
data.append(" self.click_link_text('Images')")
data.append(" source = self.get_page_source()")
data.append(
" self.assertTrue('Image result for github' in source)")
" self.assert_true('Image result for github' in source)")
data.append("")
file_path = "%s/%s" % (dir_name_3, "google_test.py")
file = codecs.open(file_path, "w+", "utf-8")
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name='seleniumbase',
version='1.19.2',
version='1.19.3',
description='Reliable Browser Automation & Testing Framework',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down Expand Up @@ -71,7 +71,7 @@
'colorama==0.4.1',
'pyotp>=2.2.7',
'boto>=2.49.0',
'flake8==3.7.4',
'flake8==3.7.5',
'PyVirtualDisplay==0.2.1',
],
packages=[
Expand Down