Skip to content

Commit

Permalink
Fix registrations tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
backspace committed Apr 16, 2024
1 parent da5968b commit cca3995
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
4 changes: 2 additions & 2 deletions registrations/test/integration/admin_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Registrations.Integration.Admin do
use Hound.Helpers

# Start a Hound session
hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "logging in as an admin" do
user =
Expand Down Expand Up @@ -209,7 +209,7 @@ defmodule Registrations.Integration.UnmnemonicDevices.Admin do

use Hound.Helpers

hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "admin can create and update settings" do
insert(:octavia, admin: true)
Expand Down
2 changes: 1 addition & 1 deletion registrations/test/integration/home_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Registrations.UnmnemonicDevices.Integration.Home do
set_window_size(current_window_handle(), 720, 450)
end

hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "head tags are correct" do
navigate_to("/")
Expand Down
2 changes: 1 addition & 1 deletion registrations/test/integration/messages_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Registrations.Integration.Messages do
alias Registrations.Pages.Nav

use Hound.Helpers
hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "a message is sent to all registrants with their team information summarised" do
insert(:admin,
Expand Down
4 changes: 2 additions & 2 deletions registrations/test/integration/questions_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Registrations.ClandestineRendezvous.Integration.Questions do

use Hound.Helpers

hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "registering" do
navigate_to("/")
Expand Down Expand Up @@ -47,7 +47,7 @@ defmodule Registrations.UnmnemonicDevices.Integration.Questions do

use Hound.Helpers

hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "registering" do
navigate_to("/")
Expand Down
4 changes: 2 additions & 2 deletions registrations/test/integration/registrations_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Registrations.Integration.ClandestineRendezvous.Registrations do
use Hound.Helpers

# Start a Hound session
hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

def set_window_to_show_account do
set_window_size(current_window_handle(), 720, 450)
Expand Down Expand Up @@ -254,7 +254,7 @@ defmodule Registrations.Integration.UnmnemonicDevices.Registrations do
use Hound.Helpers

# Start a Hound session
hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

def set_window_to_show_account do
set_window_size(current_window_handle(), 720, 450)
Expand Down
4 changes: 2 additions & 2 deletions registrations/test/integration/teams_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Registrations.Integration.Teams do
use Hound.Helpers

# Start a Hound session
hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "teams are negotiable" do
insert(:user,
Expand Down Expand Up @@ -258,7 +258,7 @@ defmodule Registrations.Integration.UnmnemonicDevices.Teams do
use Hound.Helpers

# Start a Hound session
hound_session()
hound_session(Registrations.ChromeHeadlessHelper.additional_capabilities())

test "team emails can be appended to" do
insert(:user,
Expand Down
21 changes: 21 additions & 0 deletions registrations/test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ defmodule Registrations.SwooshHelper do
end
end

defmodule Registrations.ChromeHeadlessHelper do
use ExUnit.CaseTemplate

def additional_capabilities do
[
additional_capabilities: %{
:"goog:chromeOptions" => %{
"args" => [
"--headless",
"--disable-gpu",
"--no-sandbox",
"--disable-dev-shm-usage",
"--disable-software-rasterizer"
]
},
browserName: "chrome"
}
]
end
end

defmodule Registrations.ClandestineRendezvous do
use ExUnit.CaseTemplate

Expand Down

0 comments on commit cca3995

Please sign in to comment.