Skip to content

Commit e105cdc

Browse files
authored
$_WD_SupportedBrowsers should be const (#379)
1 parent 9509539 commit e105cdc

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

wd_core.au3

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,9 @@ Global Enum _
115115
$_WD_ERROR_NotSupported, _ ; When user try to use unsupported browser or capability
116116
$_WD_ERROR_AlreadyDefined, _ ; Capability previously defined
117117
$_WD_ERROR_Javascript, _ ; Javascript error
118-
$_WD_ERROR_COUNTER ; Defines row count for $aWD_ERROR_DESC
118+
$_WD_ERROR__COUNTER ; Defines row count for $aWD_ERROR_DESC
119119

120-
Global Enum _ ; Column positions of $_WD_SupportedBrowsers
121-
$_WD_BROWSER_Name, _
122-
$_WD_BROWSER_ExeName, _
123-
$_WD_BROWSER_DriverName, _
124-
$_WD_BROWSER_64Bit, _
125-
$_WD_BROWSER_OptionsKey, _
126-
$_WD_BROWSER_LatestReleaseURL, _
127-
$_WD_BROWSER_LatestReleaseRegex, _
128-
$_WD_BROWSER_NewDriverURL, _
129-
$_WD_BROWSER__COUNTER
130-
131-
Global Const $aWD_ERROR_DESC[$_WD_ERROR_COUNTER] = [ _
120+
Global Const $aWD_ERROR_DESC[$_WD_ERROR__COUNTER] = [ _
132121
"Success", _
133122
"General Error", _
134123
"Socket Error", _
@@ -166,6 +155,26 @@ Global Const $_WD_ErrorElementIntercept = "element click intercepted"
166155
Global Const $_WD_ErrorElementNotInteract = "element not interactable"
167156

168157
Global Const $_WD_WinHTTPTimeoutMsg = "WinHTTP request timed out before Webdriver"
158+
159+
Global Enum _ ; Column positions of $_WD_SupportedBrowsers
160+
$_WD_BROWSER_Name, _
161+
$_WD_BROWSER_ExeName, _
162+
$_WD_BROWSER_DriverName, _
163+
$_WD_BROWSER_64Bit, _
164+
$_WD_BROWSER_OptionsKey, _
165+
$_WD_BROWSER_LatestReleaseURL, _
166+
$_WD_BROWSER_LatestReleaseRegex, _
167+
$_WD_BROWSER_NewDriverURL, _
168+
$_WD_BROWSER__COUNTER
169+
170+
Global Const $_WD_SupportedBrowsers[][$_WD_BROWSER__COUNTER] = _
171+
[ _
172+
["chrome", "chrome.exe", "chromedriver.exe", False, "goog:chromeOptions", "'https://chromedriver.storage.googleapis.com/LATEST_RELEASE_' & StringLeft($sBrowserVersion, StringInStr($sBrowserVersion, '.') - 1)", "", '"https://chromedriver.storage.googleapis.com/" & $sDriverLatest & "/chromedriver_win32.zip"'], _
173+
["firefox", "firefox.exe", "geckodriver.exe", True, "moz:firefoxOptions", "https://github.com/mozilla/geckodriver/releases/latest", '<a.*href="\/mozilla\/geckodriver\/releases\/tag\/(?:v)(.*?)"', '"https://github.com/mozilla/geckodriver/releases/download/v" & $sDriverLatest & "/geckodriver-v" & $sDriverLatest & (($bFlag64) ? "-win64.zip" : "-win32.zip")'], _
174+
["msedge", "msedge.exe", "msedgedriver.exe", True, "ms:edgeOptions", "'https://msedgedriver.azureedge.net/LATEST_RELEASE_' & StringLeft($sBrowserVersion, StringInStr($sBrowserVersion, '.') - 1) & '_WINDOWS'", "", '"https://msedgedriver.azureedge.net/" & $sDriverLatest & "/edgedriver_" & (($bFlag64) ? "win64.zip" : "win32.zip")'], _
175+
["opera", "opera.exe", "operadriver.exe", True, "goog:chromeOptions", "https://github.com/operasoftware/operachromiumdriver/releases/latest", '<a.*href="\/operasoftware\/operachromiumdriver\/releases\/tag\/(?:v\.)(.*?)"', '"https://github.com/operasoftware/operachromiumdriver/releases/download/v." & $sDriverLatest & "/operadriver_" & (($bFlag64) ? "win64.zip" : "win32.zip")'] _
176+
]
177+
169178
#EndRegion Global Constants
170179

171180
#Region Global Variables
@@ -193,13 +202,6 @@ Global $_WD_WINHTTP_TIMEOUTS = True
193202
Global $_WD_HTTPTimeOuts[4] = [0, 60000, 30000, 30000]
194203
Global $_WD_HTTPContentType = "Content-Type: application/json"
195204

196-
Global $_WD_SupportedBrowsers[][$_WD_BROWSER__COUNTER] = _
197-
[ _
198-
["chrome", "chrome.exe", "chromedriver.exe", False, "goog:chromeOptions", "'https://chromedriver.storage.googleapis.com/LATEST_RELEASE_' & StringLeft($sBrowserVersion, StringInStr($sBrowserVersion, '.') - 1)", "", '"https://chromedriver.storage.googleapis.com/" & $sDriverLatest & "/chromedriver_win32.zip"'], _
199-
["firefox", "firefox.exe", "geckodriver.exe", True, "moz:firefoxOptions", "https://github.com/mozilla/geckodriver/releases/latest", '<a.*href="\/mozilla\/geckodriver\/releases\/tag\/(?:v)(.*?)"', '"https://github.com/mozilla/geckodriver/releases/download/v" & $sDriverLatest & "/geckodriver-v" & $sDriverLatest & (($bFlag64) ? "-win64.zip" : "-win32.zip")'], _
200-
["msedge", "msedge.exe", "msedgedriver.exe", True, "ms:edgeOptions", "'https://msedgedriver.azureedge.net/LATEST_RELEASE_' & StringLeft($sBrowserVersion, StringInStr($sBrowserVersion, '.') - 1) & '_WINDOWS'", "", '"https://msedgedriver.azureedge.net/" & $sDriverLatest & "/edgedriver_" & (($bFlag64) ? "win64.zip" : "win32.zip")'], _
201-
["opera", "opera.exe", "operadriver.exe", True, "goog:chromeOptions", "https://github.com/operasoftware/operachromiumdriver/releases/latest", '<a.*href="\/operasoftware\/operachromiumdriver\/releases\/tag\/(?:v\.)(.*?)"', '"https://github.com/operasoftware/operachromiumdriver/releases/download/v." & $sDriverLatest & "/operadriver_" & (($bFlag64) ? "win64.zip" : "win32.zip")'] _
202-
]
203205
#EndRegion Global Variables
204206

205207
; #FUNCTION# ====================================================================================================================

0 commit comments

Comments
 (0)