feat(playwright): integrate campaign preview tests into e2e suite and…#720
feat(playwright): integrate campaign preview tests into e2e suite and…#720cmullenx wants to merge 3 commits into
Conversation
… add coverage Wire campaign preview Playwright tests into the contact center e2e runner and add 9 new tests covering previously untested component behavior. Infrastructure: - constants.ts: add CAMPAIGN_TEST_IDS with all 21 data-testid values from the CampaignTask component tree (task, list item, title, phone, actions, buttons, expanded area, popover, countdown, global variables, error dialog) - test-manager.ts: add setupForCampaignPreview() — single agent, desktop login, console logging (campaign tests inject mock tasks via page.evaluate) - test-data.ts: add SET_10 with TEST_SUITE pointing to campaign-preview-tests.spec.ts so playwright.config.ts auto-discovers it Utility enhancement: - campaignPreviewUtils.ts: extend stubCampaignPreviewActions to support 'cancel' failAction (stubs task.end() to reject), add cancel tracking to getCampaignActionCounts return type New test coverage (9 tests across 6 describe blocks): - Cancel Error: cancel failure shows error dialog with correct title, dismiss re-enables cancel button - Button Disabled Combinations: both skip and remove disabled simultaneously, accept remains enabled - Countdown Display: countdown timer renders when timeout timestamp is set - Fallback Title: empty customer name falls back to ANI as title, phone subtitle hidden when it equals the title - Error Dialog Content: verifies correct error title text for accept, skip, and remove failures (3 tests) - Re-offer After Skip: simulated new contact (changed timeout) resets all buttons to enabled state Total campaign preview test count: 22 existing + 9 new = 31 tests
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a51b79c540
ℹ️ 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".
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6435cc252
ℹ️ 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 proto = Object.getPrototypeOf(storeWrapper) as Record<string, unknown>; | ||
| if (proto && typeof proto.refreshTaskList === 'function') { | ||
| (storeWrapper as Record<string, unknown>).refreshTaskList = proto.refreshTaskList; |
There was a problem hiding this comment.
Restore the saved refreshTaskList function
When restoreRefreshTaskList() runs, this prototype lookup never finds the original method: I checked StoreWrapper and refreshTaskList is declared as an instance field (refreshTaskList = ...), so it lives on the store wrapper instance rather than Object.getPrototypeOf(storeWrapper). After any test stubs refreshes in a page/context, the helper leaves refreshTaskList as a no-op, so cleanup or later checks in that context cannot observe real SDK task updates; save the original function before overwriting it and restore that saved reference instead.
Useful? React with 👍 / 👎.
COMPLETES # https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7836
This pull request addresses
Adds e2e tests for campaigns
by making the following changes
adding e2e tests and integrating them into the suite
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.