feat(cc-widgets): Add multi-party conference E2E suites for SET_7 and SET_8#624
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
akulakum
left a comment
There was a problem hiding this comment.
PR Review: feat(cc-widgets): Add multi-party conference E2E suites for SET_7 and SET_8
Summary
Good test coverage for multi-party conference scenarios. The PR adds comprehensive E2E tests for MPC, transfer, and switch flows with proper retry patterns and cleanup handling.
Critical Issues (Must Fix)
-
Missing
global.setup.tsupdates -setupForConferenceDesktopexpectsAGENT3_ACCESS_TOKENandAGENT4_ACCESS_TOKEN, butglobal.setup.tsonly handles AGENT1/AGENT2 OAuth flows. SET_7/SET_8 tests will fail at runtime. -
Missing
PAGE_TYPESupdates -constants.tsneedsAGENT3andAGENT4page types for consistency with TestManager changes.
Medium Issues
-
skipOAuthshould be environment-driven - Currently hardcoded; should useprocess.env.PW_SKIP_OAUTH -
Excessive
waitForTimeoutusage - ~15+ occurrences of hardcoded waits; prefer explicit condition waits for reliability -
Helper functions should be extracted -
setAgentState,ensureAgentsIdle,submitWrapupIfVisible,clickMergeWhenReadycould be reusable utilities inUtils/conferenceUtils.ts
Minor Issues
-
Factory pattern deviation - New parameterized factory differs from existing convention (functional but inconsistent)
-
5-minute test timeout - Consider per-test timeouts instead of blanket 300s
-
Missing env var validation in
getAgentNames()
Documentation Issues
-
Set-to-suite mapping outdated -
playwright/ai-docs/AGENTS.mdandai-docs/templates/playwright/00-master.mddon't include SET_7/SET_8 mappings -
Missing
setupForConferenceDesktopin TestManager methods list in docs
Positive Observations
✅ Good retry patterns in createInboundAndAccept and consultAgentWithRetry
✅ Proper error handling with .catch(() => {})
✅ Parallel context creation for performance
✅ Explicit merge-button readiness validation (addresses flakiness mentioned in PR description)
✅ Clear test naming convention (CTS-MPC-01, CTS-TC-01, etc.)
✅ Well-structured Playwright template hierarchy in ai-docs/templates/playwright/
|
|
||
| export type ConferenceSuiteGroup = 'all' | 'mpc' | 'transfer-switch' | 'mpc-transfer' | 'switch'; | ||
|
|
||
| async function setAgentState(page: Page, state: string): Promise<void> { |
There was a problem hiding this comment.
Suggestion: These helper functions (setAgentState, ensureAgentsIdle, submitWrapupIfVisible, clickMergeWhenReady, etc.) are generic and reusable.
Consider extracting them to Utils/conferenceUtils.ts for consistency with existing utility patterns and reusability in future conference tests.
// playwright/Utils/conferenceUtils.ts
export async function setAgentState(page: Page, state: string): Promise<void> { ... }
export async function ensureAgentsIdle(pages: Page[]): Promise<void> { ... }
export async function submitWrapupIfVisible(page: Page): Promise<void> { ... }
export async function clickMergeWhenReady(ownerPage: Page): Promise<void> { ... }|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1ae3d74d4
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
218548a to
adb3d19
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f5fe689c8
ℹ️ 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: be6585adf8
ℹ️ 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".
| await Promise.race([handleStrayTasks(page, validAuxiliaryPage), timeoutPromise]); | ||
| } catch { |
There was a problem hiding this comment.
Prevent timed-out cleanup from leaking into next test
safeHandleStrayTasks uses Promise.race with a 60s timeout, but when the timeout wins, handleStrayTasks(...) keeps running in the background because it is never canceled. In that case beforeEach/afterEach can return and the next test starts while the previous cleanup is still clicking end/wrapup controls on the same pages, which creates nondeterministic cross-test interference and flaky conference results.
Useful? React with 👍 / 👎.
…rty-conference-e2e-tests
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 121ac907ba
ℹ️ 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: 3caeeb4e06
ℹ️ 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: 8b001150dd
ℹ️ 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: 9b9fb612e1
ℹ️ 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: 05ebcfc147
ℹ️ 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".
05ebcfc to
3caeeb4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 855e4f0464
ℹ️ 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".
4e57920 to
2961cf0
Compare
855e4f0 to
3caeeb4
Compare
…rty-conference-e2e-tests
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66e28c39bb
ℹ️ 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: 6812bca655
ℹ️ 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".
| private async runBestEffortWithTimeout(operation: () => Promise<void>, timeout: number = OPERATION_TIMEOUT): Promise<void> { | ||
| const guardedOperation = operation().catch(() => {}); | ||
| const timeoutGuard = new Promise<void>((resolve) => setTimeout(resolve, timeout)); | ||
| await Promise.race([guardedOperation, timeoutGuard]); |
There was a problem hiding this comment.
Clear timeout guard after best-effort race returns
runBestEffortWithTimeout schedules a setTimeout for each call but never clears it when operation() finishes first. Since safeHandleStrayTasks/safeStationLogout call this repeatedly during softCleanup() and cleanup(), successful cleanups still leave many 30s+ active timers, which can keep the worker event loop alive and noticeably delay or hang teardown at suite end. Store the timeout handle and clearTimeout it once the raced operation settles.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1715146b51
ℹ️ 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".
| hasVisibleEndControl: false, | ||
| hasVisibleWrapup: true, |
There was a problem hiding this comment.
Don't require all end controls to disappear before wrap-up
waitForWrapupAfterCallEnd currently requires hasVisibleEndControl: false before it succeeds, but these flows can still have a visible (often disabled) end-call control while wrap-up is already the correct actionable state; this commit’s other control-handling code already accounts for that pattern. With the new call-site in incoming telephony, this strict condition can timeout healthy call-end flows and fail tests even when wrap-up is ready. Gate on wrap-up readiness instead of full end-control disappearance.
Useful? React with 👍 / 👎.
| const hasEndControl = await getAgentPage(1) | ||
| .getByTestId('call-control:end-call') | ||
| .first() | ||
| .isVisible() |
There was a problem hiding this comment.
Check any visible end control in baseline call readiness
startBaselineCallOnAgent1 validates readiness using only call-control:end-call.first(). In conference layouts with multiple control groups, the first match can be hidden while another end control is visible/enabled (which is why this commit added multi-control scans in other helpers), so hasEndControl can stay false and the readiness poll times out despite a valid active call. Scan all matching end controls (or reuse the shared visible-control helper) before failing baseline setup.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c36e05221
ℹ️ 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".
| const controlCount = await controls.count().catch(() => 0); | ||
|
|
||
| for (let i = 0; i < controlCount; i++) { |
There was a problem hiding this comment.
Retry until consult/transfer control becomes actionable
openConsultOrTransferMenu now snapshots controls.count() once and immediately throws when no visible+enabled control is present, so it no longer waits for the consult/transfer button to appear after recent state transitions (for example, right after accept/merge/cancel). In these common timing windows the function fails with No visible enabled ... control found even though the control becomes actionable within the existing timeout budget, introducing avoidable flakiness across all consultOrTransfer(...) callers.
Useful? React with 👍 / 👎.
| const hasEnd = await page | ||
| .getByTestId('call-control:end-call') | ||
| .first() | ||
| .isVisible() | ||
| .catch(() => false); |
There was a problem hiding this comment.
Detect post-disconnect controls across all rendered groups
This readiness check only inspects .first() for both call-control:end-call and call-control:wrapup-button, but conference pages can render multiple control groups where the first match is hidden while another instance is visible/enabled. In that layout, expectPostCustomerLeaveControls can timeout after customer disconnect even though valid end or wrap-up controls are already present, causing false failures in CTS-MPC-07/09/10.
Useful? React with 👍 / 👎.
COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7322
This pull request addresses
Missing and uneven multi-party conference E2E coverage for the conference matrix scenarios, where tests were not logically split for parallel execution by set, and conference merge actions could intermittently fail due to missing button readiness checks.
by making the following changes
playwright/tests/conference-transfer-switch-test.spec.ts.SET_7: MPC scenarios (CTS-MPC-01..16)SET_8: Transfer + Switch scenarios (CTS-TC-01..05,CTS-SW-01..05)playwright/suites/following existing structure:conference-mpc-transfer-tests.spec.tsconference-switch-tests.spec.tsplaywright/test-data.tsforSET_7andSET_8.playwright/test-manager.tsfor 4-agent conference flows.skip/fixmeper agreed scope (TC14,TC20,TC17-19).The following scenarios were tested
yarn test:e2e --project=SET_7yarn test:e2e --project=SET_8yarn test:e2e --project=SET_7 --project=SET_8Result: