Run tests with headless chrome

pull/2/head
Doc Ritezel 7 years ago
parent 1fb103e60a
commit d2177aca8b
  1. 5
      .gitignore
  2. 24
      circle.yml
  3. 4
      config/test.exs
  4. 6
      mix.exs

5
.gitignore vendored

@ -24,4 +24,7 @@ npm-debug.log
# Alternatively, you may comment the line below and commit the # Alternatively, you may comment the line below and commit the
# secrets files as long as you replace their contents by environment # secrets files as long as you replace their contents by environment
# variables. # variables.
/config/*.secret.exs /config/*.secret.exs
# Wallaby screenshots
screenshots/

@ -1,3 +1,7 @@
general:
artifacts:
- screenshots
machine: machine:
environment: environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH" PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
@ -11,12 +15,15 @@ machine:
- mkdir -p $CIRCLE_TEST_REPORTS/eslint - mkdir -p $CIRCLE_TEST_REPORTS/eslint
dependencies: dependencies:
cache_directories:
- ~/.asdf
- _build
- deps
- assets/node_modules
pre: pre:
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome-stable_current_amd64.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome-stable_current_amd64.deb
- "LATEST_RELEASE=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE` && wget https://chromedriver.storage.googleapis.com/${LATEST_RELEASE}/chromedriver_linux64.zip"
- unzip chromedriver_linux64.zip
- sudo cp chromedriver /usr/local/bin/chromedriver
- sudo chmod +x /usr/local/bin/chromedriver
- if ! asdf | grep version; then git clone https://github.com/HashNuke/asdf.git ~/.asdf; fi - if ! asdf | grep version; then git clone https://github.com/HashNuke/asdf.git ~/.asdf; fi
- if ! asdf plugin-list | grep erlang; then asdf plugin-add erlang https://github.com/HashNuke/asdf-erlang.git; fi - if ! asdf plugin-list | grep erlang; then asdf plugin-add erlang https://github.com/HashNuke/asdf-erlang.git; fi
- if ! asdf plugin-list | grep elixir; then asdf plugin-add elixir https://github.com/HashNuke/asdf-elixir.git; fi - if ! asdf plugin-list | grep elixir; then asdf plugin-add elixir https://github.com/HashNuke/asdf-elixir.git; fi
@ -24,9 +31,14 @@ dependencies:
timeout: 3600 timeout: 3600
- awk '/elixir/ { print $2 }' .tool-versions | xargs asdf install elixir: - awk '/elixir/ { print $2 }' .tool-versions | xargs asdf install elixir:
timeout: 3600 timeout: 3600
override:
- yes | mix do deps.get, local.rebar, deps.compile, compile - yes | mix do deps.get, local.rebar, deps.compile, compile
- cd assets && npm install && cd .. - cd assets && npm install && cd ..
cache_directories:
- ~/.asdf
- _build
- deps
- assets/node_modules
test: test:
pre: pre:

@ -17,3 +17,7 @@ config :explorer, Explorer.Repo,
database: "explorer_test", database: "explorer_test",
hostname: "localhost", hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox pool: Ecto.Adapters.SQL.Sandbox
config :wallaby,
screenshot_on_failure: true,
chrome: [headless: false]

@ -39,14 +39,14 @@ defmodule Explorer.Mixfile do
[ [
{:phoenix, "~> 1.3.0"}, {:phoenix, "~> 1.3.0"},
{:phoenix_pubsub, "~> 1.0"}, {:phoenix_pubsub, "~> 1.0"},
{:phoenix_pubsub_redis, "~> 2.1.0"}, {:phoenix_pubsub_redis, "~> 2.1.0", only: [:prod]},
{:phoenix_ecto, "~> 3.2"}, {:phoenix_ecto, "~> 3.2"},
{:postgrex, ">= 0.0.0"}, {:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.10"}, {:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.0", only: :dev}, {:phoenix_live_reload, "~> 1.0", only: [:dev]},
{:gettext, "~> 0.11"}, {:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"}, {:cowboy, "~> 1.0"},
{:wallaby, "~> 0.19.2", [runtime: false, only: :test]}, {:wallaby, "~> 0.19.2", only: [:test], runtime: false},
{:junit_formatter, ">= 0.0.0"}, {:junit_formatter, ">= 0.0.0"},
{:credo, "~> 0.8", only: [:dev, :test], runtime: false} {:credo, "~> 0.8", only: [:dev, :test], runtime: false}
] ]

Loading…
Cancel
Save