-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebDriverSetup.py
42 lines (32 loc) · 1.07 KB
/
WebDriverSetup.py
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
#Base web driver setup
from selenium import webdriver
import unittest
class WebDriverSetup(unittest.TestCase):
#Before every test start a new driver instance
@classmethod
def setUp (self):
#local testing
self.driver = webdriver.Chrome()
#cloud based testing on Lambda test
self.driver = webdriver.Remote(command_executor = SECRET,
desired_capabilities=capabilities)
self.driver.implicitly_wait(5)
#Print test complete and quit the driver after every test ends
@classmethod
def tearDown (self):
if (self.driver != None):
print('test complete')
self.driver.quit()
capabilities = {
'LT:Options' : {
"user" : "melkorinos",
"accessKey" : "xZ5M4PjFxtLBvLXaaNo3AKbT56YdXYE1PbyilYrUfJYCcUg6wx",
"build" : "Python POM",
"name" : "Sample search bar tests",
"platformName" : "Windows 10",
"browserName" : "Chrome",
"browserVersion" : "95.0"
},
"browserName" : "Chrome",
"browserVersion" : "95.0",
}