Skip to content

test(calling): added playwright tests for call settings#5012

Open
vivekv1504 wants to merge 3 commits into
webex:nextfrom
vivekv1504:callingSDK-callsettings
Open

test(calling): added playwright tests for call settings#5012
vivekv1504 wants to merge 3 commits into
webex:nextfrom
vivekv1504:callingSDK-callsettings

Conversation

@vivekv1504
Copy link
Copy Markdown
Contributor

@vivekv1504 vivekv1504 commented May 29, 2026

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

  • Added SET_CALL_SETTINGS user set in test-data.ts with three accounts:
    • USER_3 — settings owner / callee
    • USER_2 — primary caller
    • USER_1 — second caller (for multi-user scenarios)
  • Registered SET_CALL_SETTINGS - PROD and SET_CALL_SETTINGS - INT projects in playwright.config.ts (with OAuth dependencies).
  • Added suite entry point: playwright/suites/set-call-settings.spec.ts.

Reusable test utilities (utils/call-settings.ts)

  • loadSettings() — clicks “Get Settings” and waits for both callForwarding and voicemail GET responses plus DND UI settle (avoids saving CF/VM before server state is loaded).
  • DND helpers  clickDnd(), ensureDndState() with PUT wait + expect.poll() to handle eventual consistency between write and read.
  • Call Forward helpers  setCallForwardAlways/Busy/NoAnswer/NotReachable() and saveCfSettings() with PUT response waits.
  • Voicemail helpers  setVoicemailSendAllCalls/BusyCalls/UnansweredCalls() and saveVoicemailSettings().

Selectors (constants/selectors.ts)

  • Added call-settings selectors for DND, Call Waiting, Call Forward, and Voicemail forms.
  • Scoped selectors to #callForwardForm and #voicemailForm to avoid duplicate ID collisions in the sample app.

UI tests (callSettingsTests) — single user, serial

Test ID | Coverage -- | -- CS-GET-001 | Get Settings — all UI fields settle and become enabled CS-DND-002 | DND enable/disable round-trip CS-CF-003–006 | Call Forward Always, Busy, No Answer (+ rings), Not Reachable round-trips CS-CFA-007 | Get Call Forward Always by directory number CS-ERR-008 | DND PUT 500 — button text reverts CS-VM-009–015 | Voicemail form load, toggles, numberOfRings, MWI, enabled, email notification, email copy

Each live-call test resets settings in beforeAll / finally blocks and uses INCOMING_CALL_ANSWER_BTN to assert whether line:incoming_call fired.

Reliability fixes

  • Improved DND toggle handling to poll server state after PUT instead of relying on immediate UI updates.
  • Tests restore original settings after each case to avoid polluting shared test accounts.

Sample app

  • Minor fix in docs/samples/calling/index.html: corrected voicemail “When not answered” rings input ID (vmNotAnsweredRings).

Screenshot 2026-05-29 at 13 04 00 Screenshot 2026-05-29 at 13 04 26

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Cursor
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@vivekv1504 vivekv1504 requested a review from a team as a code owner May 29, 2026 16:51
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +151 to +153
// Restore
if (originalChecked) {
await setCallForwardAlways(page, true, cfDestination);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@vivekv1504 vivekv1504 added the validated If the pull request is validated for automation. label May 29, 2026
@aws-amplify-us-east-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-5012.d3m3l2kee0btzx.amplifyapp.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant