Skip to content

CHI-3711: POC for voice and sms E2E tests - CI only - #4547

Open
stephenhand wants to merge 52 commits into
masterfrom
CHI-3711-voice_test_poc
Open

CHI-3711: POC for voice and sms E2E tests - CI only#4547
stephenhand wants to merge 52 commits into
masterfrom
CHI-3711-voice_test_poc

Conversation

@stephenhand

@stephenhand stephenhand commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

This creates a POC for testing SMS and Voice calls with E2E tests

  • They are only tested as CI tests running locally, not for production in lambdas
  • There's probably a few hardcoded bits that need tidying up when productionising
  • We send all the test tasks to the same queue - webchat, SMS and voice, is this an issue?
  • We need a task to clean up conversations for the SMS tests to run after a failure. Should this be necessary?

Checklist

  • Corresponding issue has been opened
  • New tests added
  • [n/a] Feature flags added
  • [n/a] Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

stephenhand and others added 30 commits July 15, 2026 14:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
…nt/AsyncIterable pattern

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
- Add SMS channel to twilio-iac/helplines/e2e/development.hcl using the
  messaging-lex-v3-blocking-lambda.tftpl template (same as aselo_webchat)
  and an empty contact_identity (conversations address managed separately)
- Create twilio-iac/helplines/e2e/files/additional.configure.tf that uses
  a Twilio data source to look up the only phone number attached to the
  account at apply time and creates the SMS conversations address linked to
  the SMS studio flow
- Guard twilio_conversations_configuration_addresses_v1 in channels/v1/main.tf
  so channels with an empty contact_identity skip automatic address creation
  (allowing helpline-specific additional.tf to manage it instead)

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
- Replace dynamic phone number lookup with hardcoded +12607821891 in both development.hcl and additional.configure.tf
- Remove data source that previously scraped the phone number from the Twilio account
- Set contact_identity to the hardcoded phone number in the SMS channel configuration

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
The twilio-iac/terraform-modules/channels/v1/main.tf module now
automatically creates the SMS conversations address since
contact_identity is no longer empty. The separate additional.configure.tf
file is no longer needed.

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
- Add voice channel using voice-no-chatbot-operating-hours-blocking-lambda template
- Use the same phone number (+12607821891) as the SMS channel
- Include voice_ivr_greeting_message, voice_ivr_blocked_message, and voice_ivr_language
- Follows established patterns used in other helplines for voice configurations

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
…nt/AsyncIterable pattern

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
- Add SMS channel to twilio-iac/helplines/e2e/development.hcl using the
  messaging-lex-v3-blocking-lambda.tftpl template (same as aselo_webchat)
  and an empty contact_identity (conversations address managed separately)
- Create twilio-iac/helplines/e2e/files/additional.configure.tf that uses
  a Twilio data source to look up the only phone number attached to the
  account at apply time and creates the SMS conversations address linked to
  the SMS studio flow
- Guard twilio_conversations_configuration_addresses_v1 in channels/v1/main.tf
  so channels with an empty contact_identity skip automatic address creation
  (allowing helpline-specific additional.tf to manage it instead)

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Copilot AI and others added 16 commits July 22, 2026 23:44
- Replace dynamic phone number lookup with hardcoded +12607821891 in both development.hcl and additional.configure.tf
- Remove data source that previously scraped the phone number from the Twilio account
- Set contact_identity to the hardcoded phone number in the SMS channel configuration

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
The twilio-iac/terraform-modules/channels/v1/main.tf module now
automatically creates the SMS conversations address since
contact_identity is no longer empty. The separate additional.configure.tf
file is no longer needed.

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
- Add voice channel using voice-no-chatbot-operating-hours-blocking-lambda template
- Use the same phone number (+12607821891) as the SMS channel
- Include voice_ivr_greeting_message, voice_ivr_blocked_message, and voice_ivr_language
- Follows established patterns used in other helplines for voice configurations

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
…I-3711-voice_test_poc

# Conflicts:
#	e2e-tests/tests/offlineContact.spec.ts
@stephenhand
stephenhand marked this pull request as ready for review July 23, 2026 12:49
Copilot AI review requested due to automatic review settings July 23, 2026 12:49
@stephenhand
stephenhand requested a review from gpaoloni July 23, 2026 12:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds WIP support for voice end-to-end testing by extending Twilio TaskRouter/IaC configuration, adding a new voice filtering lambda, and expanding Playwright E2E utilities/tests to cover voice and SMS via Conversations.

Changes:

  • Add a new TaskRouter workflow filter + queue for “Voice E2E Test” routing.
  • Introduce voice/filterCountryOrVoIP account-scoped lambda (with unit tests) and route wiring.
  • Add/adjust Playwright E2E helpers and specs for voice calling, SMS Conversations flow, and more reusable contact form filling.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
twilio-iac/helplines/templates/workflows/master.tftpl Adds a new “Voice E2E Test” routing filter targeting a new queue
twilio-iac/helplines/e2e/development.hcl Expands E2E routing filter expression to include voice and SMS
twilio-iac/helplines/e2e/common.hcl Adds e2e_test_voice task queue for the E2E helpline config
twilio-iac/helplines/defaults.hcl Adds e2e_test_voice task queue to global defaults
lambdas/account-scoped/tests/unit/voice/filterCountryOrVoIP.test.ts Unit tests for the new voice filtering handler
lambdas/account-scoped/src/voice/filterCountryOrVoIP.ts New handler to block non-US and VoIP/blocked-carrier callers via Twilio Lookups
lambdas/account-scoped/src/router.ts Wires the new voice/filterCountryOrVoIP route into the router
e2e-tests/workerStatus.ts Improves worker status-setting robustness and logging
e2e-tests/twilio/voice.ts Adds helper to initiate a voice call into the service under test
e2e-tests/twilio/sms.ts Reworks SMS E2E to use Twilio Conversations (stateful conversation SID)
e2e-tests/twilio/channels.ts Adds cleanup utilities for SMS conversations and migrates chat cleanup to Conversations APIs
e2e-tests/tests/voice.spec.ts New Playwright voice E2E spec that accepts a task and submits a contact form
e2e-tests/tests/sms.spec.ts Updates SMS spec to use new contact-form helper + conversation cleanup
e2e-tests/tests/offlineContact.spec.ts Refactors offline-contact spec to reuse form content helpers
e2e-tests/tests/aseloWebchat.spec.ts Refactors webchat spec to reuse contact-form helper
e2e-tests/playwright.config.ts Adds fake media-stream args for local runs and deduplicates args setup
e2e-tests/package.json Updates scripts for conversation cleanup and local retry behavior
e2e-tests/formContentsByHelpline.ts Adjusts form content and introduces an “empty form” variant map
e2e-tests/deleteConversations.ts Updates cleanup script to delete both chat and SMS conversations
e2e-tests/contactForm.ts Adds fillWithContent helper to reuse a consistent tab-filling sequence

Comment thread twilio-iac/helplines/e2e/development.hcl Outdated
Comment on lines +47 to +51
"filter_friendly_name": "Voice E2E Test",
"expression": "channelType=='voice' AND name=='+12064083885'",
"targets": [
{
"expression": "(worker.waitingOfflineContact != true AND ((task.channelType == 'voice' AND worker.channel.chat.assigned_tasks == 0) OR (task.channelType != 'voice' AND worker.channel.voice.assigned_tasks == 0)) AND ((task.transferTargetType == 'worker' AND task.targetSid == worker.sid) OR (task.transferTargetType != 'worker' AND worker.sid != task.ignoreAgent))) OR (worker.waitingOfflineContact == true AND task.targetSid == worker.sid AND task.isContactlessTask == true)",
Comment thread e2e-tests/twilio/voice.ts
export const makeCallToService = async () => {
const clientAccountSid = getConfigValue('clientTwilioAccountSid') as string;
const authToken = getConfigValue('clientTwilioAuthToken') as string;
const from = getConfigValue('clientSmsPhoneNumber') as string;
Comment on lines +50 to +55
participants.some((participant) => {
return (
participant.messagingBinding?.address === fromNumber &&
participant.messagingBinding?.proxy_address === toNumber
);
})
Comment thread e2e-tests/twilio/sms.ts
// Tracks the start of the current SMS test session so we only check messages received after this time
let sessionStartTime: Date | undefined;

let clientConversationSid: string;
Comment on lines +64 to 66
const helpline = getConfigValue('helplineShortCode') as keyof typeof formContentsByHelpline;
const formContent = formContentsByHelplineForEmptyForm[helpline];

@stephenhand
stephenhand changed the base branch from copilot/wip-add-config-and-basic-sms-test-methods to master July 23, 2026 15:20
@stephenhand stephenhand changed the title WIP voice testing CHI-3711: POC for voice and sms E2E tests - CI only Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants