Skip to content

Commit 405c2fb

Browse files
committed
Update boilerplates structure
1 parent 597e61b commit 405c2fb

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

examples/boilerplates/file_parsing/parse_files.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
'''
2+
Demonstration of parsing data from files.
3+
In this example, login information is pulled for tests.
4+
'''
5+
16
from seleniumbase import BaseCase
27

38

examples/boilerplates/page_object_model/page_objects.py renamed to examples/boilerplates/page_objects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class HomePage(object):
99
ok_button = "#ok"
1010
cancel_button = "#cancel"
11-
see_items = "button.items"
11+
see_items_button = "button.items"
1212

1313

1414
class ShoppingPage(object):
@@ -19,7 +19,7 @@ class ShoppingPage(object):
1919

2020
class CheckoutPage(object):
2121
remove_from_cart = "button.remove"
22-
pay_now = "#pay-now"
22+
buy_now = "#buy-now"
2323
shop_more = "#shop-more"
2424

2525

@@ -33,10 +33,10 @@ class MyTests(MasterTestCase):
3333
3434
def test_example(self):
3535
self.open(RANDOM_SHOPPING_WEBSITE)
36-
self.click(HomePage.see_items)
36+
self.click(HomePage.see_items_button)
3737
self.click(ShoppingPage.buyable_item)
3838
self.click(ShoppingPage.add_to_cart)
39-
self.click(CheckoutPage.pay_now)
39+
self.click(CheckoutPage.buy_now)
4040
self.assert_element("#success")
4141
self.assert_text("Order Received!", "#h2")
4242
'''

examples/boilerplates/page_object_model/google_objects.py renamed to examples/boilerplates/samples/google_objects.py

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

55

66
class HomePage(object):
7-
google_logo = 'img[alt="Google"]'
87
search_box = 'input[title="Search"]'
98
search_button = 'input[value="Google Search"]'
109
feeling_lucky_button = '''input[value="I'm Feeling Lucky"]'''
1110

1211

1312
class ResultsPage(object):
13+
google_logo = 'img[alt="Google"]'
1414
search_results = 'div#center_col'

examples/boilerplates/page_object_model/google_test.py renamed to examples/boilerplates/samples/google_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ class GoogleTests(BaseCase):
1010

1111
def test_google_dot_com(self):
1212
self.open('http://www.google.com')
13-
self.assert_element_present(HomePage.google_logo)
13+
self.assert_element(HomePage.search_button)
14+
self.assert_element(HomePage.feeling_lucky_button)
1415
self.update_text(HomePage.search_box, "github\n")
1516
self.assert_text("github.com", ResultsPage.search_results)
17+
self.assert_element(ResultsPage.google_logo)
1618
self.click_link_text("Images")
1719
self.assert_element('img[alt="Image result for github"]')

0 commit comments

Comments
 (0)