mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 21:28:12 +00:00
[Ubuntu] Add Microsoft Edge Web Driver (#5878)
* [Ubuntu] Add Edge Web Driver * take part 0 in sw report
This commit is contained in:
@@ -29,6 +29,11 @@ function Get-EdgeVersion {
|
||||
return "$edgeVersion (apt source repository: $aptSourceRepo)"
|
||||
}
|
||||
|
||||
function Get-EdgeDriverVersion {
|
||||
$edgeDriverVersion = msedgedriver --version | Take-OutputPart -Part 0,1,2,3
|
||||
return $edgeDriverVersion
|
||||
}
|
||||
|
||||
function Get-SeleniumVersion {
|
||||
$seleniumBinaryName = Get-ToolsetValue "selenium.binary_name"
|
||||
$fullSeleniumVersion = (Get-ChildItem "/usr/share/java/${seleniumBinaryName}-*").Name -replace "${seleniumBinaryName}-"
|
||||
@@ -41,6 +46,10 @@ function Build-BrowserWebdriversEnvironmentTable {
|
||||
"Name" = "CHROMEWEBDRIVER"
|
||||
"Value" = $env:CHROMEWEBDRIVER
|
||||
},
|
||||
@{
|
||||
"Name" = "EDGEWEBDRIVER"
|
||||
"Value" = $env:EDGEWEBDRIVER
|
||||
},
|
||||
@{
|
||||
"Name" = "GECKOWEBDRIVER"
|
||||
"Value" = $env:GECKOWEBDRIVER
|
||||
|
||||
@@ -232,6 +232,7 @@ $browsersAndDriversList = @(
|
||||
(Get-ChromeDriverVersion),
|
||||
(Get-ChromiumVersion),
|
||||
(Get-EdgeVersion),
|
||||
(Get-EdgeDriverVersion),
|
||||
(Get-SeleniumVersion)
|
||||
)
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
## Desc: Installs Microsoft Edge
|
||||
################################################################################
|
||||
|
||||
source $HELPER_SCRIPTS/install.sh
|
||||
|
||||
REPO_URL="https://packages.microsoft.com/repos/edge"
|
||||
gpg_key="/usr/share/keyrings/microsoft-edge.gpg"
|
||||
repo_path="/etc/apt/sources.list.d/microsoft-edge.list"
|
||||
@@ -21,4 +23,27 @@ rm $repo_path
|
||||
|
||||
echo "microsoft-edge $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
|
||||
|
||||
# Install Microsoft Edge Webdriver
|
||||
|
||||
EDGEDRIVER_DIR="/usr/local/share/edge_driver"
|
||||
EDGEDRIVER_BIN="$EDGEDRIVER_DIR/msedgedriver"
|
||||
|
||||
mkdir -p $EDGEDRIVER_DIR
|
||||
|
||||
EDGE_VERSION=$(microsoft-edge --version | cut -d' ' -f 3)
|
||||
EDGE_VERSION_MAJOR=$(echo $EDGE_VERSION | cut -d'.' -f 1)
|
||||
|
||||
EDGE_DRIVER_VERSION_URL="https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_VERSION_MAJOR}_LINUX"
|
||||
# Convert a resulting file to normal UTF-8
|
||||
EDGE_DRIVER_LATEST_VERSION=$(curl -s "$EDGE_DRIVER_VERSION_URL" | iconv -f utf-16 -t utf-8 | tr -d '\r')
|
||||
|
||||
EDGEDRIVER_URL="https://msedgedriver.azureedge.net/${EDGE_DRIVER_LATEST_VERSION}/edgedriver_linux64.zip"
|
||||
download_with_retries $EDGEDRIVER_URL "/tmp" "edgedriver_linux64.zip"
|
||||
|
||||
unzip -qq /tmp/edgedriver_linux64.zip -d $EDGEDRIVER_DIR
|
||||
chmod +x $EDGEDRIVER_BIN
|
||||
ln -s $EDGEDRIVER_BIN /usr/bin
|
||||
|
||||
echo "EDGEWEBDRIVER=$EDGEDRIVER_DIR" | tee -a /etc/environment
|
||||
|
||||
invoke_tests "Browsers" "Edge"
|
||||
|
||||
@@ -22,6 +22,10 @@ Describe "Edge" {
|
||||
It "Edge" {
|
||||
"microsoft-edge --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Edge Driver" {
|
||||
"msedgedriver --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Chromium" {
|
||||
|
||||
Reference in New Issue
Block a user