-
Notifications
You must be signed in to change notification settings - Fork 20
/
test_cross_platform_drivers.py
52 lines (39 loc) · 1.84 KB
/
test_cross_platform_drivers.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
43
44
45
46
47
48
49
50
51
52
import os
from test_shared import create_test_cases, run_test_case, determine_path_slash
formatted_pip = 'pip' if determine_path_slash() == '\\' else 'pip'
os.system(f'{formatted_pip} install .')
from yt_videos_list.download.windows_info import get_drive_letter
from yt_videos_list.download.user_os_info import determine_user_os
def remove_dependencies():
if determine_user_os() == 'windows':
drive = get_drive_letter()
geckodriver_path = rf'{drive}:\Windows\geckodriver.exe'
operadriver_path = rf'{drive}:\Windows\operadriver.exe'
chromedriver_path = rf'{drive}:\Windows\chromedriver.exe'
bravedriver_path = rf'{drive}:\Windows\bravedriver.exe'
msedgedriver_path = rf'{drive}:\Windows\msedgedriver.exe'
else:
geckodriver_path = r'/usr/local/bin/geckodriver'
operadriver_path = r'/usr/local/bin/operadriver'
chromedriver_path = r'/usr/local/bin/chromedriver'
bravedriver_path = r'/usr/local/bin/bravedriver'
msedgedriver_path = r'/usr/local/bin/msedgedriver'
if os.path.exists(geckodriver_path): os.remove(geckodriver_path)
if os.path.exists(operadriver_path): os.remove(operadriver_path)
if os.path.exists(chromedriver_path): os.remove(chromedriver_path)
if os.path.exists(bravedriver_path): os.remove(bravedriver_path)
if os.path.exists(msedgedriver_path): os.remove(msedgedriver_path)
def main():
browsers = ['firefox', 'opera', 'chrome', 'brave']
test_cases = create_test_cases(browsers)
remove_dependencies()
for test_case in test_cases:
run_test_case(test_case)
print('Moving on to the next driver...\n' + '⏬ '*11)
# add these later
# lc_firefox.headless = True
# lc_opera.headless = True
# lc_safari.headless = True
# lc_chrome.headless = True
if __name__ == '__main__':
main()