Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ubuntu] Add Microsoft Edge #5874

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ function Get-ChromiumVersion {
return $chromiumVersion
}

function Get-EdgeVersion {
$edgeVersion = (microsoft-edge --version).trim()
$aptSourceRepo = Get-AptSourceRepository -PackageName "microsoft-edge"
return "$edgeVersion (apt source repository: $aptSourceRepo)"
mikhailkoliada marked this conversation as resolved.
Show resolved Hide resolved
}

function Get-SeleniumVersion {
$seleniumBinaryName = Get-ToolsetValue "selenium.binary_name"
$fullSeleniumVersion = (Get-ChildItem "/usr/share/java/${seleniumBinaryName}-*").Name -replace "${seleniumBinaryName}-"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ $browsersAndDriversList = @(
(Get-ChromeVersion),
(Get-ChromeDriverVersion),
(Get-ChromiumVersion),
(Get-EdgeVersion),
(Get-SeleniumVersion)
)

Expand Down
24 changes: 24 additions & 0 deletions images/linux/scripts/installers/microsoft-edge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -e
################################################################################
## File: microsoft-edge.sh
## Desc: Installs Microsoft Edge
################################################################################

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"


wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > $gpg_key
# Specify an arch as Microsoft repository supports armhf and arm64 as well
echo "deb [arch=amd64 signed-by=$gpg_key] $REPO_URL stable main" > $repo_path

apt-get update
apt-get install --no-install-recommends microsoft-edge-stable

rm $gpg_key
rm $repo_path

echo "microsoft-edge $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt

invoke_tests "Browsers" "Edge"
8 changes: 7 additions & 1 deletion images/linux/scripts/tests/Browsers.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ Describe "Chrome" {
}
}

Describe "Edge" {
It "Edge" {
"microsoft-edge --version" | Should -ReturnZeroExitCode
}
}

Describe "Chromium" {
It "Chromium" {
"chromium-browser --version" | Should -ReturnZeroExitCode
}
}
}
1 change: 1 addition & 0 deletions images/linux/ubuntu1804.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"{{template_dir}}/scripts/installers/dotnetcore-sdk.sh",
"{{template_dir}}/scripts/installers/erlang.sh",
"{{template_dir}}/scripts/installers/firefox.sh",
"{{template_dir}}/scripts/installers/microsoft-edge.sh",
"{{template_dir}}/scripts/installers/gcc.sh",
"{{template_dir}}/scripts/installers/gfortran.sh",
"{{template_dir}}/scripts/installers/git.sh",
Expand Down
1 change: 1 addition & 0 deletions images/linux/ubuntu2004.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
"{{template_dir}}/scripts/installers/dotnetcore-sdk.sh",
"{{template_dir}}/scripts/installers/erlang.sh",
"{{template_dir}}/scripts/installers/firefox.sh",
"{{template_dir}}/scripts/installers/microsoft-edge.sh",
"{{template_dir}}/scripts/installers/gcc.sh",
"{{template_dir}}/scripts/installers/gfortran.sh",
"{{template_dir}}/scripts/installers/git.sh",
Expand Down
1 change: 1 addition & 0 deletions images/linux/ubuntu2204.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ build {
"${path.root}/scripts/installers/codeql-bundle.sh",
"${path.root}/scripts/installers/containers.sh",
"${path.root}/scripts/installers/dotnetcore-sdk.sh",
"${path.root}/scripts/installers/microsoft-edge.sh",
"${path.root}/scripts/installers/gcc.sh",
"${path.root}/scripts/installers/gfortran.sh",
"${path.root}/scripts/installers/git.sh",
Expand Down