ClientUtils.JourneyRemote (client_utils v0.6.17)

View Source

Runs the journeys, in a real browser, against a deployed app (UAT) instead of the local test endpoint. just journeys-remote <url> is the way in.

  • CMS_JOURNEY_BASE_URL: where the browser goes. test/test_helper.exs sets :phoenix_test, :base_url from base_url/2; unset, it is the local endpoint, as before. A walk visits relative paths ("/users/log-in"), never Endpoint.url() <> ..., or it ignores this.
  • CMS_JOURNEY_SECRET_KEY_BASE: that app's secret key base, for whatever the project's fakes must read from the deployed app (its mailbox).

Rows a remote run creates are real and stay. unique/1 names them per run so a second run never collides with the first.

Summary

Functions

The base URL the journeys' browser uses: CMS_JOURNEY_BASE_URL (given as url), or local, the test endpoint's own URL, when it is unset.

The tags ExUnit.start/1 excludes: :e2e unless this is a browser run, which CMS_E2E=1 (the local endpoint) or CMS_JOURNEY_BASE_URL (a deployed app) makes it. Without either a walk reads "0 tests, 5 excluded".

Whether this run goes to a deployed app rather than the local endpoint.

A name unique to this call and this run ("<prefix>-<time>-<n>"), for anything a journey creates: run twice against the same app, the second run's names never meet the first's.

Functions

base_url(url, local)

@spec base_url(String.t() | nil, String.t()) :: String.t()

The base URL the journeys' browser uses: CMS_JOURNEY_BASE_URL (given as url), or local, the test endpoint's own URL, when it is unset.

exclusions(cms_e2e \\ System.get_env("CMS_E2E"), base_url \\ System.get_env("CMS_JOURNEY_BASE_URL"))

@spec exclusions(String.t() | nil, String.t() | nil) :: [:e2e]

The tags ExUnit.start/1 excludes: :e2e unless this is a browser run, which CMS_E2E=1 (the local endpoint) or CMS_JOURNEY_BASE_URL (a deployed app) makes it. Without either a walk reads "0 tests, 5 excluded".

remote?(url \\ System.get_env("CMS_JOURNEY_BASE_URL"))

@spec remote?(String.t() | nil) :: boolean()

Whether this run goes to a deployed app rather than the local endpoint.

unique(prefix)

@spec unique(String.t()) :: String.t()

A name unique to this call and this run ("<prefix>-<time>-<n>"), for anything a journey creates: run twice against the same app, the second run's names never meet the first's.