Skip to content

Commit 74aaa4b

Browse files
committed
Refactoring
1 parent 1fc2204 commit 74aaa4b

16 files changed

+30
-48
lines changed

examples/behave_bdd/features/steps/swag_labs.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def click_continue(context):
8686
def verify_item_in_cart(context, quantity, item):
8787
sb = context.sb
8888
sb.assert_exact_text(
89-
quantity,
90-
'div.cart_item:contains("%s") div.cart_quantity' % item
89+
quantity, 'div.cart_item:contains("%s") div.cart_quantity' % item
9190
)
9291

9392

@@ -97,37 +96,31 @@ def verify_cost_of_item(context, item, var):
9796
earlier_price = sb.variables[var]
9897
sb.assert_exact_text(
9998
earlier_price,
100-
'div.cart_item_label:contains("%s") .inventory_item_price' % item
99+
'div.cart_item_label:contains("%s") .inventory_item_price' % item,
101100
)
102101

103102

104103
@step("Verify item total is {item_total}")
105104
def verify_item_total(context, item_total):
106105
sb = context.sb
107106
sb.assert_exact_text(
108-
"Item total: %s" % item_total,
109-
"div.summary_subtotal_label",
110-
timeout=1
107+
"Item total: %s" % item_total, "div.summary_subtotal_label", timeout=1
111108
)
112109

113110

114111
@step("Verify tax amount is {tax_amount}")
115112
def verify_tax_amount(context, tax_amount):
116113
sb = context.sb
117114
sb.assert_exact_text(
118-
"Tax: %s" % tax_amount,
119-
"div.summary_tax_label",
120-
timeout=1
115+
"Tax: %s" % tax_amount, "div.summary_tax_label", timeout=1
121116
)
122117

123118

124119
@step("Verify total cost is {total_cost}")
125120
def verify_total_cost(context, total_cost):
126121
sb = context.sb
127122
sb.assert_exact_text(
128-
"Total: %s" % total_cost,
129-
"div.summary_total_label",
130-
timeout=1
123+
"Total: %s" % total_cost, "div.summary_total_label", timeout=1
131124
)
132125

133126

examples/hack_the_planet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_all_your_base_are_belong_to_us(self):
6969
self.highlight("h2", loops=9, scroll=False)
7070

7171
self.open("https://google.com/ncr")
72-
self.hide_elements('iframe')
72+
self.hide_elements("iframe")
7373
self.set_text_content('a[href*="about.google"]', ayb)
7474
self.set_text_content('a[href*="store.google"]', abtu)
7575
self.set_text_content('a[href*="mail.google.com"]', ayb)

examples/parameterized_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GoogleTests(BaseCase):
1212
)
1313
def test_parameterized_google_search(self, search_key, expected_text, img):
1414
self.open("https://google.com/ncr")
15-
self.hide_elements('iframe')
15+
self.hide_elements("iframe")
1616
self.type('input[title="Search"]', search_key + "\n")
1717
self.assert_text(expected_text, "#search")
1818
self.click('a:contains("%s")' % expected_text)

examples/test_hack_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_hack_search(self):
1313
print("\n This test is not for Headless Mode.")
1414
self.skip('Do not use "--headless" with this test.')
1515
self.open("https://google.com/ncr")
16-
self.hide_elements('iframe')
16+
self.hide_elements("iframe")
1717
self.assert_element('input[title="Search"]')
1818
self.set_attribute('[action="/search"]', "action", "//bing.com/search")
1919
self.set_attributes('[value="Google Search"]', "value", "Bing Search")

examples/tour_examples/bootstrap_google_tour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MyTourClass(BaseCase):
55
def test_google_tour(self):
66
self.open("https://google.com/ncr")
77
self.wait_for_element('input[title="Search"]')
8-
self.hide_elements('iframe')
8+
self.hide_elements("iframe")
99

1010
self.create_bootstrap_tour() # OR self.create_tour(theme="bootstrap")
1111
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")

examples/tour_examples/google_tour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MyTourClass(BaseCase):
55
def test_google_tour(self):
66
self.open("https://google.com/ncr")
77
self.wait_for_element('input[title="Search"]')
8-
self.hide_elements('iframe')
8+
self.hide_elements("iframe")
99

1010
# Create a website tour using the ShepherdJS library with "dark" theme
1111
# Same as: self.create_shepherd_tour(theme="dark")

examples/tour_examples/hopscotch_google_tour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MyTourClass(BaseCase):
55
def test_google_tour(self):
66
self.open("https://google.com/ncr")
77
self.wait_for_element('input[title="Search"]')
8-
self.hide_elements('iframe')
8+
self.hide_elements("iframe")
99

1010
self.create_hopscotch_tour() # OR self.create_tour(theme="hopscotch")
1111
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")

examples/tour_examples/introjs_google_tour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MyTourClass(BaseCase):
55
def test_google_tour(self):
66
self.open("https://google.com/ncr")
77
self.wait_for_element('input[title="Search"]')
8-
self.hide_elements('iframe')
8+
self.hide_elements("iframe")
99

1010
self.create_introjs_tour() # OR self.create_tour(theme="introjs")
1111
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")

examples/tour_examples/maps_introjs_tour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_google_maps_tour(self):
4949
)
5050
self.add_tour_step(
5151
"Thanks for using SeleniumBase Tours!",
52-
title="🚃 End of Guided Tour 🚃"
52+
title="🚃 End of Guided Tour 🚃",
5353
)
5454
self.export_tour(filename="maps_introjs_tour.js")
5555
self.play_tour()

examples/tour_examples/shepherd_google_tour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MyTourClass(BaseCase):
55
def test_google_tour(self):
66
self.open("https://google.com/ncr")
77
self.wait_for_element('input[title="Search"]')
8-
self.hide_elements('iframe')
8+
self.hide_elements("iframe")
99

1010
self.create_shepherd_tour(theme="dark")
1111
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")

0 commit comments

Comments
 (0)