Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b7aec5e5e
ℹ️ 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".
playwright/ai-docs/AGENTS.md
Outdated
| } | ||
| ``` | ||
|
|
||
| All convenience methods (`basicSetup`, `setupForAdvancedTaskControls`, etc.) internally call `setup()` with pre-configured options. |
There was a problem hiding this comment.
Correct the claim that all setup helpers route through setup()
This statement is inaccurate for at least setupForStationLogin, which performs its own context/page initialization and does not call setup() in playwright/test-manager.ts. Contributors following this guidance may assume SetupConfig options and shared setup behavior apply uniformly to every helper, leading to incorrectly structured tests or missing setup/cleanup steps when using station-login flows.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a910fbc16
ℹ️ 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".
playwright/test-data.ts
Outdated
| CHAT_URL: `${env.PW_CHAT_URL}-e2e-7.html`, | ||
| EMAIL_ENTRY_POINT: `${env.PW_SANDBOX}.e2e7@gmail.com`, | ||
| ENTRY_POINT: env.PW_ENTRY_POINT7, | ||
| TEST_SUITE: 'conference-tests1.spec.ts', |
There was a problem hiding this comment.
Point conference sets to existing suite files
SET_7/SET_8/SET_9 are mapped to conference-tests1.spec.ts, conference-tests2.spec.ts, and conference-tests3.spec.ts, but there are no matching files under playwright/suites (repo-wide filename search returns none), so these projects will run with zero matched tests and silently skip the intended conference coverage while still incurring OAuth/setup work for those sets.
Useful? React with 👍 / 👎.
ciscoRankush
left a comment
There was a problem hiding this comment.
Review of Playwright SDD docs — 8 items (M1–M8). All comments are inline on the relevant files.
The PR provides a decent template/workflow structure (the "how to work" part), but is very thin on actual framework documentation (the "how it works" part). An AI agent following this documentation would know the file layout and process to follow, but would not be able to write or modify tests without the missing technical reference.
The single playwright/ai-docs/ARCHITECTURE.md is the right place for all technical reference (M1–M7). The file would grow from ~140 to ~325 lines — reasonable for this scope.
playwright/ai-docs/ARCHITECTURE.md
Outdated
| - Runtime setup/teardown: `playwright/test-manager.ts` | ||
| - Shared operations: `playwright/Utils/*.ts` | ||
| - Shared constants/types/timeouts: `playwright/constants.ts` | ||
| - OAuth + env expansion: `playwright/global.setup.ts` |
There was a problem hiding this comment.
M1: TestManager Class Documentation Missing
TestManager is 627 lines and is the single class every test file depends on. It gets one bullet here and one line in the data flow section. This is insufficient — an AI agent cannot write or modify tests without this.
Needs a dedicated ## TestManager section documenting:
1. Constructor:
new TestManager(projectName: string, maxRetries?: number) — projectName is the SET key (e.g., 'SET_1'), used to resolve set-scoped env vars like ${projectName}_AGENT1_ACCESS_TOKEN.
2. SetupConfig interface — all 10 options and defaults:
interface SetupConfig {
needsAgent1?: boolean; // default: true
needsAgent2?: boolean; // default: false
needsCaller?: boolean; // default: false
needsExtension?: boolean; // default: false
needsChat?: boolean; // default: false
needsMultiSession?: boolean; // default: false
agent1LoginMode?: LoginMode; // default: 'Desktop'
enableConsoleLogging?: boolean; // default: true
enableAdvancedLogging?: boolean; // default: false
needDialNumberLogin?: boolean; // default: false
}3. Seven page properties available after setup:
agent1Page, agent2Page, callerPage, agent1ExtensionPage, chatPage, multiSessionAgent1Page, dialNumberPage
4. Convenience methods (method → config preset):
basicSetup(), setupForAdvancedTaskControls(), setupForAdvancedCombinations(), setupForDialNumber(), setupForStationLogin(), setupForIncomingTaskDesktop(), setupForIncomingTaskExtension(), setupForIncomingTaskMultiSession()
5. Cleanup:
softCleanup()— handles stray tasks only (between test files viaafterAll)cleanup()— full logout + close all pages/contexts (end of entire suite)
6. 3-phase parallel setup:
Phase 1: Create all browser contexts in parallel → Phase 2: Login + widget init in parallel for independent pages → Phase 3: Console logging setup
| - Shared operations: `playwright/Utils/*.ts` | ||
| - Shared constants/types/timeouts: `playwright/constants.ts` | ||
| - OAuth + env expansion: `playwright/global.setup.ts` | ||
|
|
There was a problem hiding this comment.
M2: Utils Layer Documentation Missing
8 utility files with 50+ exported functions — none documented. This line says only playwright/Utils/*.ts.
Needs a ## Utils Reference section with at minimum:
| File | Key Exports | Purpose |
|---|---|---|
initUtils.ts |
loginViaAccessToken, oauthLogin, enableAllWidgets, initialiseWidgets, agentRelogin, setupMultiLoginPage |
Page bootstrap, widget initialization |
stationLoginUtils.ts |
desktopLogin, extensionLogin, dialLogin, telephonyLogin, stationLogout, verifyLoginMode, ensureUserStateVisible |
Station login/logout for 3 modes (Desktop, Extension, Dial Number) |
userStateUtils.ts |
changeUserState, getCurrentState, verifyCurrentState, getStateElapsedTime, validateConsoleStateChange, checkCallbackSequence |
Agent state management and verification |
taskControlUtils.ts |
holdCallToggle, recordCallToggle, endTask, verifyHoldTimer, verifyHoldButtonIcon, verifyRecordButtonIcon, setupConsoleLogging, verifyHoldLogs, verifyRecordingLogs, verifyEndLogs, verifyRemoteAudioTracks |
Basic call controls + callback log verification |
advancedTaskControlUtils.ts |
consultOrTransfer, cancelConsult, setupAdvancedConsoleLogging, verifyTransferSuccessLogs, verifyConsultStartSuccessLogs, verifyConsultEndSuccessLogs |
Transfer and consult operations |
incomingTaskUtils.ts |
createCallTask, createChatTask, createEmailTask, acceptIncomingTask, declineIncomingTask, acceptExtensionCall, loginExtension, submitRonaPopup, waitForIncomingTask |
Task creation (call/chat/email), acceptance, RONA handling |
wrapupUtils.ts |
submitWrapup |
Wrapup submission flow |
helperUtils.ts |
handleStrayTasks, pageSetup, waitForState, waitForStateLogs, waitForWebSocketDisconnection, waitForWebSocketReconnection, clearPendingCallAndWrapup, dismissOverlays |
Cleanup, state polling, network monitoring, overlay dismissal |
Without this, an AI agent will either duplicate existing logic or fabricate non-existent functions.
| - Shared constants/types/timeouts: `playwright/constants.ts` | ||
| - OAuth + env expansion: `playwright/global.setup.ts` | ||
|
|
||
| --- |
There was a problem hiding this comment.
M3: Constants Documentation Missing
constants.ts defines every enum, type, and timeout used across tests — currently undocumented.
Key enums:
| Constant | Values | Used For |
|---|---|---|
USER_STATES |
MEETING, AVAILABLE, LUNCH (Lunch Break), RONA, ENGAGED, AGENT_DECLINED |
State change operations |
LOGIN_MODE |
DESKTOP, EXTENSION, DIAL_NUMBER (Dial Number) |
Station login mode selection |
PAGE_TYPES |
AGENT1, AGENT2, CALLER, EXTENSION, CHAT, MULTI_SESSION, DIAL_NUMBER |
TestManager page identification |
TASK_TYPES |
CALL, CHAT, EMAIL, SOCIAL |
Incoming task type identification |
WRAPUP_REASONS |
SALE, RESOLVED |
Wrapup submission |
RONA_OPTIONS |
AVAILABLE, IDLE |
RONA popup state selection |
CONSOLE_PATTERNS |
SDK_STATE_CHANGE_SUCCESS, ON_STATE_CHANGE_REGEX, ON_STATE_CHANGE_KEYWORDS |
Console log verification (see M4) |
Timeout hierarchy (critical for choosing correct timeout per operation):
| Constant | Value | Use Case |
|---|---|---|
DROPDOWN_SETTLE_TIMEOUT |
200ms | Dropdown animation settle |
UI_SETTLE_TIMEOUT |
2s | General UI settle after actions |
DEFAULT_TIMEOUT |
5s | Default retry/check timeout |
AWAIT_TIMEOUT |
10s | Standard element interaction |
WRAPUP_TIMEOUT |
15s | Wrapup box visibility |
FORM_FIELD_TIMEOUT |
20s | Form field / popover loading |
OPERATION_TIMEOUT |
30s | Longer operations (logout verify) |
EXTENSION_REGISTRATION_TIMEOUT |
40s | WebRTC extension registration |
NETWORK_OPERATION_TIMEOUT |
40s | Network-dependent operations |
WIDGET_INIT_TIMEOUT |
50s | Widget initialization |
CHAT_LAUNCHER_TIMEOUT |
60s | Chat launcher iframe loading |
ACCEPT_TASK_TIMEOUT |
60s | Waiting for incoming task |
Without this, an agent will use arbitrary timeout values or wrong enum names.
| Avoid documenting future sets or files before they exist. | ||
|
|
||
| --- | ||
|
|
There was a problem hiding this comment.
M4: Console Log Verification Pattern Undocumented
The framework's primary assertion mechanism for verifying SDK behavior is console log monitoring — used across nearly every test file. Not documented anywhere.
How it works:
-
Setup:
setupConsoleLogging(page)orsetupAdvancedConsoleLogging(page)registers apage.on('console', ...)handler that filters for specific SDK event strings. -
Captured events (basic controls):
WXCC_SDK_TASK_HOLD_SUCCESS/WXCC_SDK_TASK_RESUME_SUCCESSWXCC_SDK_TASK_PAUSE_RECORDING_SUCCESS/WXCC_SDK_TASK_RESUME_RECORDING_SUCCESSonHoldResume invoked/onRecordingToggle invoked/onEnd invoked
-
Captured events (advanced controls):
WXCC_SDK_TASK_TRANSFER_SUCCESS/WXCC_SDK_TASK_CONSULT_START_SUCCESS/WXCC_SDK_TASK_CONSULT_END_SUCCESSAgentConsultTransferred/onTransfer invoked/onConsult invoked
-
Captured events (state changes):
WXCC_SDK_AGENT_STATE_CHANGE_SUCCESSonStateChange invoked with state name: <stateName>(matched viaCONSOLE_PATTERNS.ON_STATE_CHANGE_REGEX)
-
Verification functions:
verifyHoldLogs(),verifyRecordingLogs(),verifyEndLogs(),verifyTransferSuccessLogs(),verifyConsultStartSuccessLogs(),validateConsoleStateChange(),checkCallbackSequence() -
Sequence validation:
checkCallbackSequence()verifies that SDK API success event appears in logs before theonStateChangecallback.
This section should be added under a ## Console Log Verification Pattern heading. Without it, an AI agent writing new tests would not know how to verify SDK behavior and would write incomplete assertions.
| ├── test-data.ts | ||
| ├── constants.ts | ||
| ├── global.setup.ts | ||
| └── ai-docs/ |
There was a problem hiding this comment.
M5: Set → Suite → Test File Mapping Missing
The file topology lists suites and tests separately but doesn't show which test factories each suite imports. This is the critical wiring an agent needs to know where to add a new test.
Add a ## Set → Suite → Test Mapping section:
| Set | Suite File | Test Files Imported |
|---|---|---|
| SET_1 | digital-incoming-task-tests |
digital-incoming-task-and-task-controls + dial-number-task-control-test |
| SET_2 | task-list-multi-session-tests |
incoming-task-and-controls-multi-session + tasklist-test |
| SET_3 | station-login-user-state-tests |
station-login-test + user-state-test + incoming-telephony-task-test |
| SET_4 | basic-advanced-task-controls-tests |
basic-task-controls-test + advance-task-control-combinations-test |
| SET_5 | advanced-task-controls-tests |
advanced-task-controls-test |
| SET_6 | dial-number-tests |
dial-number-task-control-test |
Without this, an agent asked to 'add a new incoming task test' won't know it should go in SET_1's suite.
| - workers: `Object.keys(USER_SETS).length` | ||
| - global timeout: `180000` | ||
| - per-project retries: `1` | ||
|
|
There was a problem hiding this comment.
M6: Sample App (SUT) Context Missing
The tests are testing CC widgets running inside samples-cc-react-app at localhost:3000. playwright.config.ts starts it via:
webServer: {
command: 'yarn workspace samples-cc-react-app serve',
url: 'http://localhost:3000',
}
This context is completely absent. An agent wouldn't know what the system under test actually is. Also missing: the Chrome launch flags critical for WebRTC testing:
--use-fake-ui-for-media-stream/--use-fake-device-for-media-stream— allows media access without real devices--use-file-for-fake-audio-capture=dummyAudio.wav— provides fake audio input--remote-debugging-port=${9221 + index}— unique debug port per set
Add a ## System Under Test paragraph in the Dynamic Project Generation section explaining what is actually being tested and how the browser is configured.
playwright/ai-docs/ARCHITECTURE.md
Outdated
|
|
||
| 1. reads set-scoped env values using `testInfo.project.name` | ||
| 2. creates required pages/contexts per setup config | ||
| 3. performs login/widget initialization |
There was a problem hiding this comment.
M7: Factual Error — testInfo.project.name
This line says TestManager "reads set-scoped env values using testInfo.project.name".
Actually, TestManager constructor takes projectName: string directly:
constructor(projectName: string, maxRetries: number = DEFAULT_MAX_RETRIES)Tests instantiate it as: new TestManager(test.info().project.name). The distinction matters — TestManager doesn't access testInfo at all; it receives the project name as a constructor argument.
Fix to: "TestManager receives the project name (SET key) via its constructor, which tests pass from test.info().project.name."
|
|
||
| ## Done Criteria | ||
|
|
||
| - [ ] Suite/test wiring complete |
There was a problem hiding this comment.
M8: Governance Gap — Doc Updates Not Enforced
This Done Criteria is missing mandatory doc update steps. Currently has 3 items, none mention AGENTS.md or ARCHITECTURE.md.
Should include:
- [ ] playwright/ai-docs/AGENTS.md baseline updated (if new suite/set added)- [ ] playwright/ai-docs/ARCHITECTURE.md file topology and set mapping updated (if new files/sets added)
Also:
03-framework-and-doc-updates.mdsays "update only if required" — should be mandatory in the 00-master workflow when adding new tests/suites/sets04-validation.mdshould explicitly check:- [ ] AGENTS.md baseline matches actual suitesand- [ ] ARCHITECTURE.md file topology matches actual files- The PR description claims
playwright/ai-docs/specs/multiparty-conference.spec.mdwas added — but this file is not in the diff. Either implement the specs/ concept or remove the claim. - When fixing/stabilizing tests, there's no guidance to update docs to reflect what changed — add a fix → doc-update loop.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 058e6ba657
ℹ️ 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".
|
|
||
| | Set | Suite File (`TEST_SUITE`) | Test Files Imported By Suite | | ||
| | --- | --- | --- | | ||
| | `SET_1` | `digital-incoming-task-tests.spec.ts` | `digital-incoming-task-and-task-controls.spec.ts`, `dial-number-task-control-test.spec.ts` | |
There was a problem hiding this comment.
Map SET_1 to actually wired test factories
This mapping lists dial-number-task-control-test.spec.ts under SET_1, but playwright/suites/digital-incoming-task-tests.spec.ts only registers createDigitalIncomingTaskAndTaskControlsTests via test.describe(...) and never wires the dial-number factory, so contributors using this table can add scenarios in the wrong file and silently miss coverage in SET_1. Please document the factories that are actually executed (or explicitly call out imported-but-unwired files).
Useful? React with 👍 / 👎.
COMPLETES #N/A (documentation update)
This pull request addresses
Playwright E2E documentation and agent routing were incomplete for contributors working in this monorepo. Specifically, root-level guidance did not consistently route developers/agents to Playwright ai-docs.
by making the following changes
/AGENTS.mdto explicitly include Playwright in architecture understanding and documentation update flows.playwright/ai-docs/AGENTS.mdwith Playwright framework usage, setup patterns, utility guidance, and contributor-facing references.ai-docs/templates/Playright/playright-test-spec-generator.mdto align with current framework constraints and conventions (includingSET_7, current TestManager capacity, heading/style rules, and routing-sensitive naming guidance).Change Type
The following scenarios were tested
yarnyarn run buildThe GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.