Conversation
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
stephenhand
left a comment
There was a problem hiding this comment.
The preengagement form on the new client has more mandatory fields than the legacy form, determine which fields need to be filled and update the test code to populate them
…t POM Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Identified the mandatory fields from the AS helpline's pre-engagement form definition (
All fields are still filled conditionally (if visible) to keep the POM flexible across helplines. Committed in 86095f9. |
There was a problem hiding this comment.
Pull request overview
Adds a new Playwright E2E flow for the aselo-webchat-react-app client (React/Redux, data-test / data-testid selectors), mirroring the existing legacy webchat E2E test flow and ensuring the new client’s pre-engagement form is completed before chatting.
Changes:
- Added
ASELO_WEBCHAT_URL/aseloWebchatUrlconfig option with a sensible default based onHLandHL_ENV. - Introduced a new Page Object Model (
aseloWebchat.ts) targeting the new app’s test attributes and pre-engagement fields. - Added a new serial Playwright spec (
aseloWebchat.spec.ts) that runs the same end-to-end chat + contact save flow against the new client.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| e2e-tests/config.ts | Adds aseloWebchatUrl config option used by the new E2E flow. |
| e2e-tests/aseloWebchat.ts | New POM for the React webchat client (open widget, fill pre-engagement form, run scripted chat). |
| e2e-tests/tests/aseloWebchat.spec.ts | New Playwright test that executes the full chat + HRM contact save workflow using the new POM. |
You can also share your feedback on Copilot code review. Take the survey.
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>
stephenhand
left a comment
There was a problem hiding this comment.
The new E2E test is failing because it doesn't check the accept terms and conditions checkbox
There was a problem hiding this comment.
Pull request overview
Adds a Playwright E2E test path for the new aselo-webchat-react-app client, mirroring the existing legacy webchat E2E flow while targeting the React app’s data-test / data-testid selectors and completing the required pre-engagement form.
Changes:
- Added a new Page Object Model for the React-based Aselo webchat client (
e2e-tests/aseloWebchat.ts). - Added a new Playwright spec that runs the full chat + HRM contact save flow against the new client (
e2e-tests/tests/aseloWebchat.spec.ts). - Introduced a new E2E config option for the Aselo webchat URL (
aseloWebchatUrl, env varASELO_WEBCHAT_URL) ine2e-tests/config.ts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| e2e-tests/tests/aseloWebchat.spec.ts | New serial E2E test that opens the new webchat, fills pre-engagement, runs the chat script, and saves the contact form. |
| e2e-tests/config.ts | Adds aseloWebchatUrl config option (env override + default URL) for navigating to the new client. |
| e2e-tests/aseloWebchat.ts | New POM for the React app using data-test/data-testid selectors and onBlur-based pre-engagement field updates. |
| // The url of the aselo webchat react app is used to navigate to the new aselo webchat client | ||
| aseloWebchatUrl: { | ||
| envKey: 'ASELO_WEBCHAT_URL', | ||
| default: `https://assets-${localOverrideEnv}.tl.techmatters.org/aselo-webchat-react-app/${helplineShortCode}/`, |
There was a problem hiding this comment.
webchatUrl explicitly uses the direct S3 URL to avoid CloudFront caching issues (see the comment above), but aseloWebchatUrl defaults to the assets-...tl.techmatters.org host. For consistency and to reduce the risk of E2E tests hitting stale cached assets, consider switching this default to the equivalent https://s3.amazonaws.com/assets-${localOverrideEnv}.tl.techmatters.org/aselo-webchat-react-app/${helplineShortCode}/ (still overridable via ASELO_WEBCHAT_URL).
| default: `https://assets-${localOverrideEnv}.tl.techmatters.org/aselo-webchat-react-app/${helplineShortCode}/`, | |
| default: `https://s3.amazonaws.com/assets-${localOverrideEnv}.tl.techmatters.org/aselo-webchat-react-app/${helplineShortCode}/`, |
There was a problem hiding this comment.
Using the cloudfront URL is a better test as it checks cloudfront and the cache evection on deployment is correctly configured
…kbox Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com> Agent-Logs-Url: https://github.com/techmatters/flex-plugins/sessions/e3456621-e7b9-4674-9f4f-25f1ddf08972
The checkbox wasn't being checked because Paste's Fixed in 7899e21:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
stephenhand
left a comment
There was a problem hiding this comment.
The test is failing because the terms & conditions checkbox is out of the viewport when the test tries to select it. From the logs it looks like the method being used should automatically try to scroll it into view but you might want to try explicitly scrolling it into view or changing the timeout
| // The url of the aselo webchat react app is used to navigate to the new aselo webchat client | ||
| aseloWebchatUrl: { | ||
| envKey: 'ASELO_WEBCHAT_URL', | ||
| default: `https://assets-${localOverrideEnv}.tl.techmatters.org/aselo-webchat-react-app/${helplineShortCode}/`, |
There was a problem hiding this comment.
Using the cloudfront URL is a better test as it checks cloudfront and the cache evection on deployment is correctly configured
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com> Agent-Logs-Url: https://github.com/techmatters/flex-plugins/sessions/41d2e2c4-dec3-4823-ad73-fcf0c023b662
Added an explicit |
Description
Adds an E2E test for the new
aselo-webchat-react-appclient, parallel to the existing legacy webchat test. The new client uses React+Redux withdata-test/data-testidattributes rather than Twilio Flex CSS classes, and requires completing a pre-engagement form before chatting.e2e-tests/config.tsaseloWebchatUrlconfig option (ASELO_WEBCHAT_URLenv var), defaulting to the CloudFront URLhttps://assets-${env}.tl.techmatters.org/aselo-webchat-react-app/${helplineShortCode}/(intentionally uses CloudFront rather than S3 direct, to validate cache eviction on deployment)HL=e2e,HL_ENV=development) resolves tohttps://assets-development.tl.techmatters.org/aselo-webchat-react-app/e2e/e2e-tests/aseloWebchat.ts(new POM)webchat.tsbut targets the new app's test attributes instead of Twilio Flex CSS classesbutton.Twilio-EntryPoint[data-testid="entry-point-button"]div.Twilio-MainContainer[data-test="root-container"]div.Twilio-PreEngagementCanvas[data-test="pre-engagement-chat-form"].Twilio-MessageInputArea-TextArea textarea[data-test="message-input-textarea"]div.Twilio-MessageListItem div.Twilio-MessageBubble[data-testid="message-bubble"] pfillPreEngagementForm()populates all mandatory fields of the AS pre-engagement form and explicitly calls.blur()to flush Redux store updates (the new app usesonBlurhandlers rather thanonChangeto dispatchupdatePreEngagementDataField):firstName→input#firstNamecontactIdentifier(email) →input#contactIdentifierage→select#agegender→select#gendertermsAndConditions→input#termsAndConditions— usescount() > 0(notisVisible()) andscrollIntoViewIfNeeded()+check({ force: true })because Twilio Paste renders the checkbox input as a visually-hidden element (position:absolute,clip:rect(0 0 0 0), zero-size) that may be below the viewportselectHelpline()uses native<select>via Playwright'sselectOption()rather than the MUI dropdown approach in the legacy POMe2e-tests/tests/aseloWebchat.spec.ts(new test)webchat.spec.ts: open chat → fill pre-engagement form → run chat script → fill contact form → saveChecklist
Other Related Issues
None
Verification steps
Run against the development environment:
The test navigates to the deployed e2e page, clicks the chat entry point, completes all mandatory pre-engagement form fields (first name, email, age, gender, terms & conditions), exchanges chat messages via the bot/counselor flow, and saves the contact form.
AFTER YOU MERGE
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
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.