From 70c82ba8f121a75601bf3122c7c665bac5aa77b6 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 6 Mar 2026 15:43:02 -0600 Subject: [PATCH] refactor: remove emoji from e2e scripts and docs - Remove emoji from create_test_user.exs output - Remove emoji from setup.sh - Keep emoji in test files (used for matching actual app emoji) --- e2e/scripts/create_test_user.exs | 46 +++++++++++++++++--------------- e2e/setup.sh | 12 ++++----- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/e2e/scripts/create_test_user.exs b/e2e/scripts/create_test_user.exs index 04152de9..69c6d4b3 100644 --- a/e2e/scripts/create_test_user.exs +++ b/e2e/scripts/create_test_user.exs @@ -11,25 +11,27 @@ email = "e2e-test@towerops.local" password = "TestPassword123!" totp_secret = "JBSWY3DPEHPK3PXP" -IO.puts("\nšŸŽ­ Creating E2E Test User...") -IO.puts("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n") +IO.puts("\nCreating E2E Test User...") +IO.puts(String.duplicate("=", 40) <> "\n") # Check if user already exists case Accounts.get_user_by_email(email) do nil -> # Create new user - IO.puts("šŸ“ Registering user: #{email}") + IO.puts("Registering user: #{email}") case Accounts.register_user(%{ email: email, password: password, - password_confirmation: password + password_confirmation: password, + terms_of_service_consent: true, + privacy_policy_consent: true }) do {:ok, user} -> - IO.puts("āœ… User created successfully!") + IO.puts("[OK] User created successfully!") # Set up TOTP - IO.puts("šŸ” Setting up TOTP authentication...") + IO.puts("Setting up TOTP authentication...") case Accounts.create_user_credential(user, %{ type: :totp, @@ -37,56 +39,56 @@ case Accounts.get_user_by_email(email) do enabled: true }) do {:ok, _credential} -> - IO.puts("āœ… TOTP enabled!") + IO.puts("[OK] TOTP enabled!") # Create organization - IO.puts("šŸ¢ Creating test organization...") + IO.puts("Creating test organization...") case Organizations.create_organization(%{name: "E2E Test Org"}, user.id) do {:ok, org} -> - IO.puts("āœ… Organization created: #{org.name}") + IO.puts("[OK] Organization created: #{org.name}") # Print credentials - IO.puts("\n" <> String.duplicate("━", 40)) - IO.puts("\n✨ E2E Test User Ready!") + IO.puts("\n" <> String.duplicate("=", 40)) + IO.puts("\nE2E Test User Ready!") IO.puts("\nAdd these to e2e/.env:\n") IO.puts("TEST_USER_EMAIL=#{email}") IO.puts("TEST_USER_PASSWORD=#{password}") IO.puts("TEST_USER_TOTP_SECRET=#{totp_secret}") - IO.puts("\n" <> String.duplicate("━", 40) <> "\n") + IO.puts("\n" <> String.duplicate("=", 40) <> "\n") {:error, changeset} -> - IO.puts("āŒ Failed to create organization:") + IO.puts("[ERROR] Failed to create organization:") IO.inspect(changeset.errors) end {:error, changeset} -> - IO.puts("āŒ Failed to set up TOTP:") + IO.puts("[ERROR] Failed to set up TOTP:") IO.inspect(changeset.errors) end {:error, changeset} -> - IO.puts("āŒ Failed to create user:") + IO.puts("[ERROR] Failed to create user:") IO.inspect(changeset.errors) end user -> - IO.puts("āš ļø User already exists: #{email}") + IO.puts("[WARN] User already exists: #{email}") IO.puts("\nExisting user details:") # Get TOTP credential credential = Repo.get_by(Accounts.UserCredential, user_id: user.id, type: :totp) if credential do - IO.puts("\n" <> String.duplicate("━", 40)) - IO.puts("\n✨ E2E Test User Credentials:") + IO.puts("\n" <> String.duplicate("=", 40)) + IO.puts("\nE2E Test User Credentials:") IO.puts("\nAdd these to e2e/.env:\n") IO.puts("TEST_USER_EMAIL=#{email}") IO.puts("TEST_USER_PASSWORD=#{password}") IO.puts("TEST_USER_TOTP_SECRET=#{credential.totp_secret}") - IO.puts("\n" <> String.duplicate("━", 40) <> "\n") + IO.puts("\n" <> String.duplicate("=", 40) <> "\n") else - IO.puts("āš ļø No TOTP credential found for this user") + IO.puts("[WARN] No TOTP credential found for this user") IO.puts("\nTo set up TOTP manually, run:") IO.puts(""" @@ -107,7 +109,7 @@ case Accounts.get_user_by_email(email) do |> Enum.filter(&(&1.role == :owner)) if Enum.empty?(orgs) do - IO.puts("\nāš ļø User has no organizations") + IO.puts("\n[WARN] User has no organizations") IO.puts("\nTo create one, run:") IO.puts(""" @@ -116,6 +118,6 @@ case Accounts.get_user_by_email(email) do Towerops.Organizations.create_organization(%{name: "E2E Test Org"}, user.id) """) else - IO.puts("\nāœ… User has #{length(orgs)} organization(s)") + IO.puts("\n[OK] User has #{length(orgs)} organization(s)") end end diff --git a/e2e/setup.sh b/e2e/setup.sh index 81e16b74..4a37151a 100755 --- a/e2e/setup.sh +++ b/e2e/setup.sh @@ -2,22 +2,22 @@ set -e -echo "šŸŽ­ Setting up Playwright E2E tests..." +echo "Setting up Playwright E2E tests..." # Install dependencies -echo "šŸ“¦ Installing npm dependencies..." +echo "Installing npm dependencies..." npm install # Install Playwright browsers -echo "🌐 Installing Playwright browsers..." +echo "Installing Playwright browsers..." npx playwright install # Create .env if it doesn't exist if [ ! -f .env ]; then - echo "šŸ“ Creating .env file from template..." + echo "Creating .env file from template..." cp .env.example .env echo "" - echo "āš ļø IMPORTANT: Edit .env and set your test user credentials!" + echo "IMPORTANT: Edit .env and set your test user credentials!" echo " TEST_USER_EMAIL, TEST_USER_PASSWORD, and TEST_USER_TOTP_SECRET" echo "" fi @@ -25,7 +25,7 @@ fi # Create .auth directory mkdir -p tests/.auth -echo "āœ… Setup complete!" +echo "Setup complete!" echo "" echo "Next steps:" echo " 1. Edit .env with your test user credentials"