Skip to content

Commit

Permalink
Merge pull request #53 from praekeltfoundation/flow-wrangler-readiness
Browse files Browse the repository at this point in the history
Fix config and folder structure for flow-wrangler
  • Loading branch information
HawkiesZA authored Sep 25, 2024
2 parents efdb07f + f8b7c29 commit 2f88346
Show file tree
Hide file tree
Showing 73 changed files with 5,203 additions and 25 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
793 changes: 793 additions & 0 deletions Onboarding/QA/flows/intro-and-welcome.md

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4,393 changes: 4,393 additions & 0 deletions Onboarding/QA/flows/profile-pregnancy-health.md

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions Onboarding/QA/tests/basic-questions_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ defmodule BasicQuestionsTest do

import Onboarding.QA.Helpers.Macros

defp flow_path(flow_name), do: Path.join([__DIR__, "..","flows", flow_name <> ".json"])

def setup_fake_cms(auth_token) do
# Start the handler.
wh_pid = start_link_supervised!({FakeCMS, %FakeCMS.Config{auth_token: auth_token}})
Expand Down Expand Up @@ -159,7 +157,7 @@ defmodule BasicQuestionsTest do
auth_token = System.get_env("API_TOKEN", "CRauthTOKEN123")
kind = if auth_token == "CRauthTOKEN123", do: :fake, else: :real

flow_path("basic-questions")
Helpers.flow_path("basic-questions")
|> FlowTester.from_json!()
|> real_or_fake_cms("https://content-repo-api-qa.prk-k8s.prd-p6t.org/", auth_token, kind)
|> FlowTester.set_global_dict("config", %{"contentrepo_token" => auth_token})
Expand Down
4 changes: 1 addition & 3 deletions Onboarding/QA/tests/intro-and-welcome_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ defmodule IntroAndWelcomeTest do

import Onboarding.QA.Helpers.Macros

defp flow_path(flow_name), do: Path.join([__DIR__, "..","flows", flow_name <> ".json"])

def setup_fake_cms(auth_token) do
# Start the handler.
wh_pid = start_link_supervised!({FakeCMS, %FakeCMS.Config{auth_token: auth_token}})
Expand Down Expand Up @@ -228,7 +226,7 @@ defmodule IntroAndWelcomeTest do
auth_token = System.get_env("API_TOKEN", "CRauthTOKEN123")
kind = if auth_token == "CRauthTOKEN123", do: :fake, else: :real

flow_path("intro-and-welcome")
Helpers.flow_path("intro-and-welcome")
|> FlowTester.from_json!()
|> real_or_fake_cms("https://content-repo-api-qa.prk-k8s.prd-p6t.org/", auth_token, kind)
|> FlowTester.set_global_dict("config", %{"contentrepo_token" => auth_token})
Expand Down
4 changes: 1 addition & 3 deletions Onboarding/QA/tests/personal-profile-questions_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ defmodule PersonalProfileQuestionsTest do

alias Onboarding.QA.Helpers

defp flow_path(flow_name), do: Path.join([__DIR__, "..","flows", flow_name <> ".json"])

def setup_fake_cms(auth_token) do
# Start the handler.
wh_pid = start_link_supervised!({FakeCMS, %FakeCMS.Config{auth_token: auth_token}})
Expand Down Expand Up @@ -152,7 +150,7 @@ defmodule PersonalProfileQuestionsTest do
auth_token = System.get_env("API_TOKEN", "CRauthTOKEN123")
kind = if auth_token == "CRauthTOKEN123", do: :fake, else: :real

flow_path("personal-profile-questions")
Helpers.flow_path("personal-profile-questions")
|> FlowTester.from_json!()
|> real_or_fake_cms("https://content-repo-api-qa.prk-k8s.prd-p6t.org/", auth_token, kind)
|> FlowTester.set_global_dict("config", %{"contentrepo_token" => auth_token})
Expand Down
4 changes: 1 addition & 3 deletions Onboarding/QA/tests/profile-generic_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ defmodule ProfileGenericTest do

import Onboarding.QA.Helpers.Macros

defp flow_path(flow_name), do: Path.join([__DIR__, "..","flows", flow_name <> ".json"])

def setup_fake_cms(auth_token) do
# Start the handler.
wh_pid = start_link_supervised!({FakeCMS, %FakeCMS.Config{auth_token: auth_token}})
Expand Down Expand Up @@ -110,7 +108,7 @@ defmodule ProfileGenericTest do
auth_token = System.get_env("API_TOKEN", "CRauthTOKEN123")
kind = if auth_token == "CRauthTOKEN123", do: :fake, else: :real

flow_path("profile-generic")
Helpers.flow_path("profile-generic")
|> FlowTester.from_json!()
|> real_or_fake_cms("https://content-repo-api-qa.prk-k8s.prd-p6t.org/", auth_token, kind)
|> FlowTester.set_global_dict("config", %{"contentrepo_token" => auth_token})
Expand Down
4 changes: 1 addition & 3 deletions Onboarding/QA/tests/profile-hcw_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ defmodule ProfileHCWTest do

import Onboarding.QA.Helpers.Macros

defp flow_path(flow_name), do: Path.join([__DIR__, "..","flows", flow_name <> ".json"])

def setup_fake_cms(auth_token) do
# Start the handler.
wh_pid = start_link_supervised!({FakeCMS, %FakeCMS.Config{auth_token: auth_token}})
Expand Down Expand Up @@ -186,7 +184,7 @@ defmodule ProfileHCWTest do
auth_token = System.get_env("API_TOKEN", "CRauthTOKEN123")
kind = if auth_token == "CRauthTOKEN123", do: :fake, else: :real

flow_path("profile-hcw")
Helpers.flow_path("profile-hcw")
|> FlowTester.from_json!()
|> real_or_fake_cms("https://content-repo-api-qa.prk-k8s.prd-p6t.org/", auth_token, kind)
|> FlowTester.set_global_dict("config", %{"contentrepo_token" => auth_token})
Expand Down
4 changes: 1 addition & 3 deletions Onboarding/QA/tests/profile-pregnancy-health_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ defmodule ProfilePregnancyHealthTest do

import Onboarding.QA.Helpers.Macros

defp flow_path(flow_name), do: Path.join([__DIR__, "..","flows", flow_name <> ".json"])

def setup_fake_cms(auth_token) do
# Start the handler.
wh_pid = start_link_supervised!({FakeCMS, %FakeCMS.Config{auth_token: auth_token}})
Expand Down Expand Up @@ -789,7 +787,7 @@ defmodule ProfilePregnancyHealthTest do
auth_token = System.get_env("API_TOKEN", "CRauthTOKEN123")
kind = if auth_token == "CRauthTOKEN123", do: :fake, else: :real

flow_path("profile-pregnancy-health")
Helpers.flow_path("profile-pregnancy-health")
|> FlowTester.from_json!()
|> real_or_fake_cms("https://content-repo-api-qa.prk-k8s.prd-p6t.org/", auth_token, kind)
|> FlowTester.set_global_dict("config", %{"contentrepo_token" => auth_token})
Expand Down
4 changes: 1 addition & 3 deletions Onboarding/QA/tests/profile-pregnant-nurse_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ defmodule ProfilePregnantNurseTest do

import Onboarding.QA.Helpers.Macros

defp flow_path(flow_name), do: Path.join([__DIR__, "..","flows", flow_name <> ".json"])

def setup_fake_cms(auth_token) do
# Start the handler.
wh_pid = start_link_supervised!({FakeCMS, %FakeCMS.Config{auth_token: auth_token}})
Expand Down Expand Up @@ -127,7 +125,7 @@ defmodule ProfilePregnantNurseTest do
auth_token = System.get_env("API_TOKEN", "CRauthTOKEN123")
kind = if auth_token == "CRauthTOKEN123", do: :fake, else: :real

flow_path("profile-pregnant-nurse")
Helpers.flow_path("profile-pregnant-nurse")
|> FlowTester.from_json!()
|> real_or_fake_cms("https://content-repo-api-qa.prk-k8s.prd-p6t.org/", auth_token, kind)
|> FlowTester.set_global_dict("config", %{"contentrepo_token" => auth_token})
Expand Down
2 changes: 2 additions & 0 deletions Onboarding/QA/tests/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ defmodule Onboarding.QA.Helpers do

def handle_edd_reminder_flow(step), do: FlowTester.handle_child_flow(step, edd_reminder_uuid())

def flow_path(flow_name), do: Path.join([__DIR__, "..","flows_json", flow_name <> ".json"])

defmodule Macros do
# This lets us have cleaner button/list assertions.
def indexed_list(var, labels) do
Expand Down
12 changes: 8 additions & 4 deletions Onboarding/stacks_config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
base_url: "https://whatsapp.turn.io"
workspace_uuid: "2c329412-1dda-4365-bcc1-d0e9283a9513"
qa_url: https://content-repo-api-qa.prk-k8s.prd-p6t.org
prod_url: https://platform-mnch-contentrepo.prk-k8s.prd-p6t.org
tokens:
- name: contentrepo
qa_token: badly_managed_token_prod
prod_token: badly_managed_token_prod
urls:
- name: contentrepo
qa_url: https://content-repo-api-qa.prk-k8s.prd-p6t.org
prod_url: https://platform-mnch-contentrepo.prk-k8s.prd-p6t.org
stack_uuids:
- name: "intro-and-welcome" # "Onboarding: Intro & Welcome"
prod_uuid: 47111691-cb8d-4cf0-8ecc-ed6792108157
Expand Down

0 comments on commit 2f88346

Please sign in to comment.