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 1 commit 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".
| const acceptBtn = testManager.agent1Page.getByTestId(CAMPAIGN_TEST_IDS.ACCEPT_BUTTON).first(); | ||
| await expect(acceptBtn).toBeDisabled(); |
There was a problem hiding this comment.
Don't wait for a removed Accept button after skip
When this test clicks Skip, CampaignTask sets pendingAction to SKIP, and CampaignTaskListItem renders the disabled campaign-task-connecting-button instead of campaign-task-accept-button whenever pendingAction is set. In the integrated SET_10 suite this locator has no element, so toBeDisabled() times out before the re-offer logic is exercised; assert the connecting/pending state here or wait for the re-offer before checking the Accept button.
Useful? React with 👍 / 👎.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
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.