test(calling): add transfer consult flows#4939
Conversation
- Target visible incoming #answer via #incomingsection scope to avoid the hidden duplicate in the sample app - Make cleanupActiveCalls retry-capable with a direct call.end() fallback, and invoke it before context teardown - Fix withTimeout to clear its timer on settle so promises do not leak handles - Tolerate resumeCall being entered from either Hold or Resume state - Guard unregisterLine against closed pages / already-unregistered state, and wait for "Unregistered" rather than "Un registering"
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
Enable the SET_3USER Playwright projects (PROD + INT) and add the transfer/consult test group that runs against them. Picks up the checkpoint that was lost during an earlier reset + rebase. - packages/calling/playwright.config.ts: enable SET_3USER projects - packages/calling/playwright/suites/set-3user.spec.ts: suite entry - packages/calling/playwright/test-groups/transfer-tests.ts: blind and consult transfer flows
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c019e875a1
ℹ️ 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".
| // Page may have closed during teardown | ||
| } | ||
| }); | ||
| test.afterAll(() => group.teardown()); |
There was a problem hiding this comment.
Use a defined cleanup method in afterAll
setupThreeUserGroup() returns setup, cleanupAfterEach, and getters, but no teardown method, so test.afterAll(() => group.teardown()) throws TypeError: group.teardown is not a function when this describe finishes. That causes this suite to fail during teardown and skips the intended final cleanup path for the shared 3-user contexts.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea0d907a9d
ℹ️ 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".
| name: 'SET_3USER - PROD', | ||
| dependencies: ['SET_2USER - PROD'], | ||
| testDir: './playwright/suites', | ||
| testMatch: USER_SETS.SET_3USER.testSuite, |
There was a problem hiding this comment.
Gate SET_3USER projects behind USER_6 OAuth prerequisites
Enabling SET_3USER here makes USER_6 mandatory for every default Playwright run, but OAuth setup still treats USER_6 as optional (REQUIRED_OAUTH_ROLES excludes it), so environments without USER_6_* credentials/token will pass OAuth setup and then fail later when TestManager requests getToken('USER_6') for the third context. This turns the new projects into a deterministic runtime failure in CI/local setups that only provision USER_1..USER_5.
Useful? React with 👍 / 👎.
| await settleUi(callerPage); | ||
| await callerPage.locator(CALLING_SELECTORS.TRANSFER_BTN).click({timeout: AWAIT_TIMEOUT}); | ||
| await callerPage.waitForTimeout(POST_ACTION_SETTLE_MS); | ||
| } finally { |
There was a problem hiding this comment.
Maybe Add a Catch here, in case something actually fails.
Rest Looks Good.
| } from '../utils/call'; | ||
| import {CALLING_SELECTORS, AWAIT_TIMEOUT} from '../constants'; | ||
|
|
||
| const UI_SETTLE_MS = 3000; |
There was a problem hiding this comment.
We have timeouts.ts file right where we defined timeout related constants , move these there
|
|
||
| export function transferTests() { | ||
| test.describe('Transfer - Blind', () => { | ||
| test.describe.configure({mode: 'serial', timeout: 240000}); |
There was a problem hiding this comment.
We can constant added for this timeout that we are using in describe blocks and mode as well
| await group.teardown(); | ||
| }); | ||
|
|
||
| test('CALL-024: Consult transfer - caller consults then commits transfer to third party', async () => { |
There was a problem hiding this comment.
Add scenarios where user on hold drops the call before consult transfer completes and scenarios where transferror puts the consulted user on hold and resumes the initial user.
| ); | ||
| }; | ||
|
|
||
| const setupThreeUserGroup = () => { |
There was a problem hiding this comment.
These methods can be present in util file right. If we have separate folder created to keep utility methods, then these may also qualify to be moved there
| await group.teardown(); | ||
| }); | ||
|
|
||
| test('CALL-009: Blind transfer completion - caller transfers call to third party', async () => { |
There was a problem hiding this comment.
How are we coming up with these indexes: CALL-009 and then CALL-026 even though both are for blind transfer.
| await callerPage.locator(CALLING_SELECTORS.TRANSFER_BTN).click({timeout: AWAIT_TIMEOUT}); | ||
| await callerPage.waitForTimeout(POST_ACTION_SETTLE_MS); | ||
|
|
||
| await waitForCallDisconnect(callerPage, 30000); |
| await waitForCallDisconnect(calleePage); | ||
| }); | ||
|
|
||
| test('CALL-027: Blind transfer rejection - transfer target rejects, original call remains', async () => { |
There was a problem hiding this comment.
In case of blind transfer, transferror would be disconnected from the call irrespective if the transfer is accepted or not I believe
| await Promise.all([waitForCallDisconnect(callerPage), waitForCallDisconnect(calleePage)]); | ||
| }); | ||
|
|
||
| test('CALL-017: ALL_CALLS_CLEARED - fires after last call ends (consult transfer)', async () => { |
There was a problem hiding this comment.
What is the significance of this test ?
| await Promise.all([waitForCallDisconnect(callerPage), waitForCallDisconnect(calleePage)]); | ||
| }); | ||
|
|
||
| test('CALL-004: Remote busy handling - caller dials callee already on a call', async () => { |
There was a problem hiding this comment.
Please elaborate this test, I don't fully understand. We establish call with transferpage and calleePage and then caller Page is busy.
| // use: {...browserOptions[PW_BROWSER], testEnv: 'int'} as any, | ||
| // }, | ||
| { | ||
| name: 'SET_3USER - PROD', |
There was a problem hiding this comment.
As discussed, please come with a naming convention followed across all client modules
COMPLETES https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7882
This pull request addresses
Follow-up to #4879 — adds 3-user transfer & consult call-flow Playwright E2E
coverage for the Calling SDK on top of the existing 2-user suite, and hardens
call cleanup / selectors that surfaced while iterating on the new flows.
by making the following changes
SET_3USER - PRODandSET_3USER - INTPlaywright projects (depend onSET_2USER)suites/set-3user.spec.tsas the 3-user suite entry pointtest-groups/transfer-tests.tswith blind transfer and consult transfer flowsChange Type
The following scenarios were tested
SET_3USER - PROD/SET_3USER - INTThe GAI Coding Policy And Copyright Annotation Best Practices
I certified that