diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Browsers.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Browsers.psm1 index b480419ea..9ba439062 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Browsers.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Browsers.psm1 @@ -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 diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index b3a3a452f..944235327 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -232,6 +232,7 @@ $browsersAndDriversList = @( (Get-ChromeDriverVersion), (Get-ChromiumVersion), (Get-EdgeVersion), + (Get-EdgeDriverVersion), (Get-SeleniumVersion) ) diff --git a/images/linux/scripts/installers/microsoft-edge.sh b/images/linux/scripts/installers/microsoft-edge.sh index 409289919..dc3ef46f6 100644 --- a/images/linux/scripts/installers/microsoft-edge.sh +++ b/images/linux/scripts/installers/microsoft-edge.sh @@ -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" diff --git a/images/linux/scripts/tests/Browsers.Tests.ps1 b/images/linux/scripts/tests/Browsers.Tests.ps1 index abf4e4a39..1bb7b8f70 100644 --- a/images/linux/scripts/tests/Browsers.Tests.ps1 +++ b/images/linux/scripts/tests/Browsers.Tests.ps1 @@ -22,6 +22,10 @@ Describe "Edge" { It "Edge" { "microsoft-edge --version" | Should -ReturnZeroExitCode } + + It "Edge Driver" { + "msedgedriver --version" | Should -ReturnZeroExitCode + } } Describe "Chromium" {