-
Notifications
You must be signed in to change notification settings - Fork 2
/
webconf.py
37 lines (27 loc) · 1.06 KB
/
webconf.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
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FOptions
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from Features.helper import values
class Driver:
"""
This class can, and will be modified soon to allow different web driver
options like Firefox, Safari, or Edge
"""
def __init__(self, browser_type=None):
if not browser_type:
self.driver = webdriver.Chrome()
elif browser_type.lower() == 'firefox':
cap = DesiredCapabilities().FIREFOX
cap["marionette"] = False
firefox_options = FOptions()
firefox_options.add_argument("--headless")
self.driver = webdriver.Firefox(capabilities=cap, options=firefox_options)
# self.driver = webdriver.Firefox()
else:
raise NameError(f'{browser_type} is not accepted.')
def nav_browser(self):
"""
This navigates to the e-commerce site
:return:
"""
self.driver.get(values.parent_url)