-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestCase.py
More file actions
44 lines (39 loc) · 1.66 KB
/
TestCase.py
File metadata and controls
44 lines (39 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from gcwebapp.BaseTestCase import BaseTestCase
from gcwebapp.Constants import TT_Constants
from gcwebapp.Common import Common
class TestCase(BaseTestCase):
def setUp(self):
super(TestCase, self).setUp()
productPageURL = TT_Constants['Base_URL']+"store/p1/Leatherback_Turtle_Picture.html"
self.navigate_to_page(productPageURL)
common_obj = Common(self.driver)
common_obj.wait_for_element_visibility(10,
"id",
"wsite-com-product-option-Quantity"
)
mainWindowHandle = self.driver.window_handles
common_obj.click(10, "xpath", "//a[@title='Share on Facebook']")
allWindowsHandles = self.driver.window_handles
for handle in allWindowsHandles:
if handle != mainWindowHandle[0]:
common_obj.switch_to_window(handle)
break
common_obj.wait_for_element_visibility(10,
"id",
"email"
)
common_obj.fill_out_field("id",
"email",
TT_Constants['Facebook_Username']
)
common_obj.fill_out_field("id",
"pass",
TT_Constants['Facebook_Password']
)
common_obj.click(10, "name", "login")
common_obj.wait_for_element_visibility(10,
"name",
"share"
)
def tearDown(self):
super(TestCase, self).tearDown()