Packages
wallabidi
0.2.0
0.4.3
0.4.2
0.4.1
0.4.0
0.4.0-rc.11
0.4.0-rc.10
0.4.0-rc.9
0.4.0-rc.8
0.4.0-rc.7
0.4.0-rc.6
0.4.0-rc.5
0.4.0-rc.4
0.4.0-rc.3
0.4.0-rc.2
0.4.0-rc.1
0.4.0-rc.0
0.2.14
0.2.13
0.2.12
0.2.11
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.42
0.1.41
0.1.39
0.1.38
0.1.37
0.1.36
0.1.35
0.1.34
0.1.33
0.1.31
0.1.30
0.1.29
0.1.28
0.1.27
0.1.26
0.1.25
0.1.24
0.1.23
0.1.22
0.1.21
0.1.20
0.1.19
0.1.17
0.1.16
0.1.14
0.1.13
0.1.12
0.1.11
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.2
0.1.1
0.1.0
Concurrent browser testing for Elixir, powered by WebDriver BiDi. A fork of Wallaby.
Current section
Files
Jump to
Current section
Files
mix.exs
defmodule Wallabidi.Mixfile do
use Mix.Project
@source_url "https://github.com/u2i/wallabidi"
@version "0.2.0"
@maintainers ["Tom Clarke"]
def project do
[
app: :wallabidi,
version: @version,
elixir: "~> 1.18",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
package: package(),
description:
"Concurrent browser testing for Elixir, powered by WebDriver BiDi. A fork of Wallaby.",
deps: deps(),
docs: docs(),
# Custom testing
aliases: [
"test.all": [
"test",
"test.live_view",
"test.chrome",
"test.chrome.bidi",
"test.chrome.lifecycle"
],
"test.live_view": fn args -> test_driver("live_view", "LiveView", args) end,
"test.chrome": fn args -> test_driver("chrome_cdp", "Chrome (CDP)", args) end,
"test.chrome.bidi": fn args -> test_driver("chrome", "Chrome (BiDi)", args) end,
"test.bench": fn args -> test_driver("bench", "Benchmarks", args) end,
"test.chrome.lifecycle": &test_chrome_lifecycle/1
],
test_paths: test_paths(System.get_env("WALLABIDI_DRIVER")),
dialyzer: dialyzer()
]
end
def cli do
[
preferred_envs: [
"test.all": :test,
"test.live_view": :test,
"test.chrome": :test,
"test.chrome.bidi": :test,
"test.bench": :test,
"test.chrome.lifecycle": :test
]
]
end
def application do
[extra_applications: [:logger], mod: {Wallabidi, []}]
end
defp elixirc_paths(:test), do: ["lib", "test/support", "integration_test/support"]
# need the testserver in dev for benchmarks to run
defp elixirc_paths(:dev), do: ["lib", "integration_test/support/test_server.ex"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:jason, "~> 1.1"},
{:mint, "~> 1.6"},
{:mint_web_socket, "~> 1.0"},
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.28", only: :dev},
{:ecto_sql, "~> 3.12", optional: true},
{:phoenix_ecto, "~> 4.6", optional: true},
{:phoenix, "~> 1.7", optional: true},
{:phoenix_live_view, "~> 1.0", optional: true},
{:lazy_html, "~> 0.1"},
{:sandbox_shim, "~> 0.1"},
{:plug_cowboy, "~> 2.7"},
# Test-only deps
{:lightpanda, "0.2.8-3", only: :test},
{:sandbox_case, "~> 0.3.8", only: :test},
{:cachex, "~> 4.1", only: :test},
{:fun_with_flags, "~> 1.11", only: :test, runtime: false},
{:ecto_sqlite3, "~> 0.22", only: :test},
{:bandit, "~> 1.0", only: :test},
{:mimic, "~> 1.7", only: :test},
{:mox, "~> 1.2", only: :test}
]
end
defp package do
[
files: ["lib", "mix.exs", "README.md", "LICENSE.md", "priv"],
maintainers: @maintainers,
licenses: ["MIT"],
links: %{
"GitHub" => @source_url,
"Wallaby (upstream)" => "https://github.com/elixir-wallaby/wallaby"
}
]
end
defp docs do
[
extras: [
"README.md": [title: "Introduction"],
"TESTING.md": [title: "Testing"]
],
source_ref: "v#{@version}",
source_url: @source_url,
main: "readme"
]
end
defp dialyzer do
[
plt_add_apps: [:inets, :phoenix_ecto, :ecto_sql],
ignore_warnings: ".dialyzer_ignore.exs",
list_unused_filters: false
]
end
defp test_paths("live_view"), do: ["integration_test/cases"]
defp test_paths("lightpanda"), do: ["integration_test/cases"]
defp test_paths("chrome"), do: ["integration_test/cases"]
defp test_paths("chrome_cdp"), do: ["integration_test/cases"]
defp test_paths("chrome_lifecycle"), do: ["integration_test/lifecycle/chrome"]
defp test_paths("bench"), do: ["bench"]
defp test_paths(_), do: ["test"]
defp test_driver(driver, label, args) do
args = if IO.ANSI.enabled?(), do: ["--color" | args], else: ["--no-color" | args]
IO.puts("==> #{label}: WALLABIDI_DRIVER=#{driver} mix test --no-start")
{_, res} =
System.cmd("mix", ["test", "--no-start" | args],
into: IO.binstream(:stdio, :line),
env: [{"WALLABIDI_DRIVER", driver}]
)
if res > 0 do
System.at_exit(fn _ -> exit({:shutdown, 1}) end)
end
end
defp test_chrome_lifecycle(args) do
args = if IO.ANSI.enabled?(), do: ["--color" | args], else: ["--no-color" | args]
IO.puts("==> Running lifecycle tests for chrome (subprocess)")
{_, res} =
System.cmd("mix", ["test" | args],
into: IO.binstream(:stdio, :line),
env: [
{"WALLABIDI_DRIVER", "chrome_lifecycle"},
{"WALLABIDI_NO_DOCKER", "1"}
]
)
if res > 0 do
System.at_exit(fn _ -> exit({:shutdown, 1}) end)
end
end
end