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>
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 tohttps://assets-${env}.tl.techmatters.org/aselo-webchat-react-app/${helplineShortCode}/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#termsAndConditionsselectHelpline()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.