test(calling): added playwright tests for call settings#5012
test(calling): added playwright tests for call settings#5012vivekv1504 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d43739d40
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Single-user Call Settings tests | ||
| { | ||
| name: 'SET_CALL_SETTINGS - PROD', | ||
| dependencies: ['OAuth - PROD'], |
There was a problem hiding this comment.
Serialize call-settings projects with shared accounts
SET_CALL_SETTINGS uses USER_1, USER_2, and USER_3, but this project only depends on OAuth, so Playwright can run it in parallel with the registration projects and SET_CALL_TRANSFER_CONSULT, which use the same accounts. test-data.ts documents that the same Webex account must never be active in two sessions simultaneously and that dependencies are how shared accounts are ordered; with this dependency, these new tests can deregister or mutate settings while the other projects are running, making the E2E suite flaky.
Useful? React with 👍 / 👎.
| // Restore | ||
| if (originalChecked) { | ||
| await setCallForwardAlways(page, true, cfDestination); |
There was a problem hiding this comment.
Restore the original forwarding destination
When CF Always was already enabled before the test, the cleanup re-enables it with cfDestination (USER_2) instead of the destination that was loaded from the account. On real PROD/INT test accounts this leaves the user's call-forwarding target permanently changed after the test; capture the original destination/ring values before overwriting them and restore those exact values.
Useful? React with 👍 / 👎.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
COMPLETES #< https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7878 >
This pull request addresses
The Calling SDK CallSettingsClient APIs (Do Not Disturb, Call Forwarding, Voicemail, and Call Waiting) did not have end-to-end Playwright coverage against the calling sample app. Without automated tests, regressions in settings fetch/save, UI wiring, or live call behavior (e.g. DND blocking incoming calls, call forwarding routing) could go unnoticed.
This PR adds a dedicated SET_CALL_SETTINGS Playwright project and a full E2E suite that exercises these flows through the sample app UI and validates real call behavior with multiple registered users.
by making the following changes
Playwright test infrastructure
SET_CALL_SETTINGSuser set intest-data.tswith three accounts:USER_3— settings owner / calleeUSER_2— primary callerUSER_1— second caller (for multi-user scenarios)SET_CALL_SETTINGS - PRODandSET_CALL_SETTINGS - INTprojects inplaywright.config.ts(with OAuth dependencies).playwright/suites/set-call-settings.spec.ts.Reusable test utilities (
utils/call-settings.ts)loadSettings()— clicks “Get Settings” and waits for bothcallForwardingandvoicemailGET responses plus DND UI settle (avoids saving CF/VM before server state is loaded).clickDnd(),ensureDndState()with PUT wait +expect.poll()to handle eventual consistency between write and read.setCallForwardAlways/Busy/NoAnswer/NotReachable()andsaveCfSettings()with PUT response waits.setVoicemailSendAllCalls/BusyCalls/UnansweredCalls()andsaveVoicemailSettings().Selectors (
constants/selectors.ts)#callForwardFormand#voicemailFormto avoid duplicate ID collisions in the sample app.UI tests (
callSettingsTests) — single user, serialEach live-call test resets settings in
beforeAll/finallyblocks and usesINCOMING_CALL_ANSWER_BTNto assert whetherline:incoming_callfired.Reliability fixes
Sample app
docs/samples/calling/index.html: corrected voicemail “When not answered” rings input ID (vmNotAnsweredRings).Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.