Introduce Cypress

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-05 19:07:50 +02:00
parent cd72059536
commit 77d286ebb6
27 changed files with 1041 additions and 845 deletions

View File

@@ -4,13 +4,21 @@ defmodule MobilizonWeb.Endpoint do
"""
use Phoenix.Endpoint, otp_app: :mobilizon
# For e2e tests
if Application.get_env(:mobilizon, :sql_sandbox) do
plug(Phoenix.Ecto.SQL.Sandbox,
at: "/sandbox",
header: "x-session-id",
repo: Mobilizon.Storage.Repo
)
end
plug(MobilizonWeb.Plugs.UploadedMedia)
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phoenix.digest
# when deploying your static files in production.
plug(MobilizonWeb.Plugs.UploadedMedia)
plug(
Plug.Static,
at: "/",

View File

@@ -118,7 +118,7 @@ defmodule MobilizonWeb.Router do
get("/:sig/:url/:filename", MediaProxyController, :remote)
end
if Mix.env() == :dev do
if Mix.env() in [:dev, :e2e] do
# If using Phoenix
forward("/sent_emails", Bamboo.SentEmailViewerPlug)
end