test(calling): add Playwright E2E tests for SDK init and device registration#4799
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e077b36be
ℹ️ 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".
7e077b3 to
3d3c22e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5da3dd4982
ℹ️ 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".
Kesari3008
left a comment
There was a problem hiding this comment.
Partial review done, will finish rest tomorrow
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d48b687df7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38b3a1356f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65bd83cd44
ℹ️ 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".
65bd83c to
58cbe58
Compare
💡 Codex Review
webex-js-sdk/packages/calling/package.json Lines 37 to 38 in 58cbe58 These new scripts reference ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
58cbe58 to
c14ff25
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c14ff25373
ℹ️ 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".
Kesari3008
left a comment
There was a problem hiding this comment.
Update to the latest branch
- Add test-manager pattern with phased parallel execution - Add registration lifecycle, failover, keepalive, and error test groups - Add suite entry points (set-1, set-2, set-3) for parallel workers - Add test-data with registration test case definitions - Update playwright config for multi-project device registration testing - Update oauth setup and registration utils for multi-account support
…neralize OAuth setup - Replace hardcoded SET_1/2/3 and INT mirror projects with dynamic generation from USER_SETS - Refactor OAuth setup to iterate unique account roles instead of hardcoded USER_1/2/3 - Update env separator logic to handle both PROD and INT suffixes - Fix REG-001 assertion to use toBeGreaterThanOrEqual for registration count - Add retry logic for isLineRegistered check in REG-010
…tration assertions Move REG-012/013 negative cases into sdk-init as a single combined test, remove REG-002 idempotent register test, and strengthen REG-001 to assert exactly one registration POST.
89da77b to
51a2db1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff784e36c9
ℹ️ 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".
| .locator('option:not([disabled])') | ||
| .evaluateAll((opts) => (opts as HTMLOptionElement[]).map((o) => o.value)); | ||
|
|
||
| expect(optionValues).toEqual(['calling', 'contactcenter', 'guestcalling']); |
There was a problem hiding this comment.
Relax service indicator option assertion
setServiceIndicator() now fails unless the dropdown’s non-disabled options are exactly ['calling','contactcenter','guestcalling']. This makes every test that uses this helper break on benign UI changes (option reorder, new option, or feature-flagged extra option) even when selecting the requested service would still work, so the suite becomes brittle to unrelated sample-app updates.
Useful? React with 👍 / 👎.
| const HIGH_RETRY_AFTER = 120; // Above RETRY_TIMER_UPPER_LIMIT (60s) | ||
| let primaryAttempts = 0; | ||
| let backupAttempts = 0; | ||
| const testStartTime = Date.now(); |
There was a problem hiding this comment.
Measure REG-016 elapsed time from registration trigger
testStartTime is recorded before navigation and SDK initialization, but the final assertion compares total elapsed time against Retry-After (120s) to validate failover speed. In slower CI runs, page load/init overhead can consume most of that window and fail the test even if failover after the register click is immediate, creating false negatives unrelated to 429 handling.
Useful? React with 👍 / 👎.
|
Ensure to add validated label in each PR else pipeline checks won't run |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4530671f0
ℹ️ 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".
| if (role === uniqueRoles[0]) { | ||
| throw new Error( | ||
| `${role}${envPrefix}_EMAIL and ${role}${envPrefix}_PASSWORD must be set in .env` |
There was a problem hiding this comment.
Scope required OAuth credentials to selected projects
The OAuth setup hard-fails only on uniqueRoles[0] (currently USER_1) regardless of which Playwright project is being run, so targeted runs like --project='SET_2 - PROD' can fail before fetching USER_2 tokens if USER_1_* credentials are absent. This is a regression for project-level execution because SET_2/SET_3 are mapped to other roles in USER_SETS, yet the dependency gate still forces unrelated account credentials.
Useful? React with 👍 / 👎.
Thank you for your contribution! |
COMPLETES https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7737
COMPLETES https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7738
This pull request addresses
Playwright E2E tests for the Calling SDK covering SDK initialization and device registration flows, using a phased parallel execution architecture that runs 3 accounts across 3 parallel workers.
Architecture: Phased Parallel Execution
The test suite uses a phased parallel execution model to work within the constraint that the same Webex account must never be in two browsers simultaneously:
Each phase fully completes before the next starts. Playwright project dependencies enforce ordering. Projects are generated dynamically from a
USER_SETSconfig — each set gets a PROD and INT variant automatically.Test Distribution Across Workers
SET_1(set-1.spec.ts)SET_2(set-2.spec.ts)SET_3(set-3.spec.ts)Changes
New test infrastructure
playwright.config.ts— Config with dynamic project generation fromUSER_SETSand phased dependenciesplaywright/test-manager.ts— TestManager pattern (modeled after widgets) for shared browser context lifecycleplaywright/test-data.ts— Account/set definitions, token helpers, project name utilitiesplaywright/utils/registration.ts— Registration action helpers (register, unregister, status checks)playwright/utils/setup.ts— SDK init helpers (navigation, init, discovery capture)playwright/constants/— Selectors, timeouts, Mobius URL constantsTest groups (shared logic, not spec files)
sdk-init.ts— SDK initialization: normal calling, contact center, guest calling, explicit region/country, negative caseregistration-lifecycle.ts— Serial tests with shared browser via TestManager (REG-001, 003, 008, 010)registration-failover.ts— Serial chained tests for failover/failback (REG-006 → REG-017 → REG-007)registration-keepalive.ts— Fresh context per test for keepalive and 429 retry flows (REG-004, 005, 015, 016)registration-errors.ts— Invalid token registration (REG-011)Suite entry points (thin spec files)
suites/set-1.spec.ts— SDK init + registration lifecycle + errorssuites/set-2.spec.ts— Failover & failbacksuites/set-3.spec.ts— Keepalive flowsOAuth setup
utils/oauth.setup.ts— Data-driven OAuth for all unique roles derived fromUSER_SETSTechniques used
keepaliveIntervalandrehomingIntervalfor faster test executioncontext.setOffline(true/false)for network disruption simulation (REG-008)page.evaluate()to read SDK internals (registration status, active Mobius URL, device info)Test Cases
SET_1 — SDK Init + Registration Lifecycle + Errors (~8 min)
callingservice indicator, verify auto-discoverycontactcenterindicator and service domainSET_2 — Failover & Failback (~10 min)
SET_3 — Keepalive & 429 Retry Flows (~12 min)
Deferred
Total: 17 tests (5 SDK init + 12 registration) across 3 parallel workers. All 3 sets run concurrently, so wall-clock time is ~12 min (longest set).
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that