Skip to content

Commit d3b4e97

Browse files
committed
Update report_helper to include Edge browser
1 parent b12b64a commit d3b4e97

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

seleniumbase/core/report_helper.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
if "darwin" in PLATFORM or "linux" in PLATFORM:
2020
LOCAL_CHROMEDRIVER = DRIVER_DIR + '/chromedriver'
2121
LOCAL_GECKODRIVER = DRIVER_DIR + '/geckodriver'
22+
LOCAL_EDGEDRIVER = DRIVER_DIR + '/msedgedriver'
2223
elif "win32" in PLATFORM or "win64" in PLATFORM or "x64" in PLATFORM:
2324
LOCAL_CHROMEDRIVER = DRIVER_DIR + '/chromedriver.exe'
2425
LOCAL_GECKODRIVER = DRIVER_DIR + '/geckodriver.exe'
26+
LOCAL_EDGEDRIVER = DRIVER_DIR + '/msedgedriver.exe'
2527

2628

2729
def get_timestamp():
@@ -245,8 +247,22 @@ def build_report(report_log_path, page_results_list,
245247
firefox_profile=profile, executable_path=LOCAL_GECKODRIVER)
246248
else:
247249
browser = webdriver.Firefox(firefox_profile=profile)
250+
elif browser_type == 'edge':
251+
edge_options = webdriver.ChromeOptions()
252+
edge_options.add_experimental_option(
253+
"excludeSwitches", ["enable-automation", "enable-logging"])
254+
edge_options.add_argument("--test-type")
255+
edge_options.add_argument("--disable-infobars")
256+
if LOCAL_CHROMEDRIVER and os.path.exists(LOCAL_EDGEDRIVER):
257+
browser = webdriver.Chrome(
258+
executable_path=LOCAL_EDGEDRIVER, options=edge_options)
259+
else:
260+
browser = webdriver.Chrome(options=edge_options)
248261
else:
249262
chrome_options = webdriver.ChromeOptions()
263+
chrome_options.add_experimental_option(
264+
"excludeSwitches", ["enable-automation", "enable-logging"])
265+
chrome_options.add_argument("--test-type")
250266
chrome_options.add_argument("--disable-infobars")
251267
if LOCAL_CHROMEDRIVER and os.path.exists(LOCAL_CHROMEDRIVER):
252268
browser = webdriver.Chrome(

0 commit comments

Comments
 (0)