Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

strategy:
matrix:
elixir-otp: [{otp: 24.x, elixir: 1.12.x}, {otp: 26.x, elixir: 1.16.x}, {otp: 27.x, elixir: 1.17.x}, {otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}]
elixir-otp: [{otp: 26.x, elixir: 1.17.x}, {otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}, {otp: 29.x, elixir: 1.20.x}]
fail-fast: false

env:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:

strategy:
matrix:
elixir-otp: [{otp: 28.x, elixir: 1.19.x}]
elixir-otp: [{otp: 29.x, elixir: 1.20.x}]
fail-fast: false

steps:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:

strategy:
matrix:
elixir-otp: [{otp: 24.x, elixir: 1.12.x}, {otp: 26.x, elixir: 1.16.x}, {otp: 27.x, elixir: 1.17.x}, {otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}]
elixir-otp: [{otp: 26.x, elixir: 1.17.x}, {otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}, {otp: 29.x, elixir: 1.20.x}]
fail-fast: false

env:
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:

strategy:
matrix:
elixir-otp: [{otp: 24.x, elixir: 1.12.x}, {otp: 26.x, elixir: 1.16.x}, {otp: 27.x, elixir: 1.17.x}, {otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}]
elixir-otp: [{otp: 26.x, elixir: 1.17.x}, {otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}, {otp: 29.x, elixir: 1.20.x}]
fail-fast: false

env:
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:

strategy:
matrix:
elixir-otp: [{otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}]
elixir-otp: [{otp: 27.x, elixir: 1.18.x}, {otp: 28.x, elixir: 1.19.x}, {otp: 29.x, elixir: 1.20.x}]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ _Your company's name and logo could be here!_

### Requirements

Wallaby requires Elixir 1.12+ and OTP 22+.
Wallaby requires Elixir 1.17+ and OTP 26+.

Wallaby also requires `bash` to be installed. Generally `bash` is widely available, but it does not come pre-installed on Alpine Linux.

Expand Down
16 changes: 14 additions & 2 deletions integration_test/cases/feature/automatic_screenshot_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule Wallaby.Integration.Feature.AutomaticScreenshotTest do
assert ExUnit.run() == %{failures: 1, skipped: 0, total: 1, excluded: 0}
end)

assert output =~ "\n1 feature, 1 failure\n"
assert_one_feature_failed(output)
assert screenshot_taken_count(output) == 2
end
end
Expand All @@ -58,11 +58,23 @@ defmodule Wallaby.Integration.Feature.AutomaticScreenshotTest do
assert ExUnit.run() == %{failures: 1, skipped: 0, total: 1, excluded: 0}
end)

assert output =~ "\n1 feature, 1 failure\n"
assert_one_feature_failed(output)
assert screenshot_taken_count(output) == 2
end
end

# ExUnit's CLIFormatter summary line changed format in Elixir 1.20.
# Pre-1.20: "1 feature, 1 failure"
# 1.20+: "Result: 0/1 passed" / "Failed: 1 feature"
defp assert_one_feature_failed(output) do
if Version.match?(System.version(), ">= 1.20.0") do
assert output =~ "\nResult: 0/1 passed\n"
assert output =~ "\nFailed: 1 feature\n"
else
assert output =~ "\n1 feature, 1 failure\n"
end
end

defp configure_and_reload_on_exit(opts) do
old_opts = ExUnit.configuration()
ExUnit.configure(opts)
Expand Down
24 changes: 13 additions & 11 deletions lib/wallaby/chrome.ex
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ defmodule Wallaby.Chrome do
@default_readiness_timeout 10_000

alias Wallaby.Chrome.Chromedriver
alias Wallaby.WebdriverClient
alias Wallaby.{DependencyError, Metadata}
alias Wallaby.WebdriverClient
import Wallaby.Driver.LogChecker

@typedoc """
Expand Down Expand Up @@ -609,19 +609,21 @@ defmodule Wallaby.Chrome do
defp put_beam_metadata(capabilities, opts) do
capabilities
|> update_in([:chromeOptions, :args], fn args ->
for arg <- args do
case String.split(arg, "=") do
["--user-agent", user_agent] ->
new_user_agent = Metadata.append(user_agent, opts[:metadata])
"--user-agent=#{new_user_agent}"

_ ->
arg
end
end
Enum.map(args, &append_metadata_to_arg(&1, opts[:metadata]))
end)
end

defp append_metadata_to_arg(arg, metadata) do
case String.split(arg, "=") do
["--user-agent", user_agent] ->
new_user_agent = Metadata.append(user_agent, metadata)
"--user-agent=#{new_user_agent}"

_ ->
arg
end
end

defp resolve_opt(opts, key) do
case Keyword.fetch(opts, key) do
{:ok, value} -> value
Expand Down
2 changes: 1 addition & 1 deletion lib/wallaby/selenium.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ defmodule Wallaby.Selenium do

@behaviour Wallaby.Driver

alias Wallaby.{Driver, Element, Session}
alias Wallaby.Helpers.KeyCodes
alias Wallaby.Metadata
alias Wallaby.WebdriverClient
alias Wallaby.{Driver, Element, Session}

@typedoc """
Options to pass to Wallaby.start_session/1
Expand Down
6 changes: 3 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule Wallaby.Mixfile do
[
app: :wallaby,
version: @version,
elixir: "~> 1.12",
elixir: "~> 1.17",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -48,8 +48,8 @@ defmodule Wallaby.Mixfile do
defp deps do
[
{:jason, "~> 1.1"},
{:httpoison, "~> 0.12 or ~> 1.0 or ~> 2.0"},
{:web_driver_client, "~> 0.2.0"},
{:httpoison, "~> 0.12 or ~> 1.0 or ~> 2.0 or ~> 3.0"},
{:web_driver_client, "~> 0.3.0"},
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:bypass, "~> 1.0.0", only: :test},
Expand Down
Loading
Loading