Skip to content

feat(playwright): integrate campaign preview tests into e2e suite and…#720

Open
cmullenx wants to merge 1 commit into
webex:nextfrom
cmullenx:chrmulle/campaigne2e
Open

feat(playwright): integrate campaign preview tests into e2e suite and…#720
cmullenx wants to merge 1 commit into
webex:nextfrom
cmullenx:chrmulle/campaigne2e

Conversation

@cmullenx

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • The testing is done with the amplify link
    < ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Windsurf
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

… 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
@cmullenx
cmullenx requested a review from a team as a code owner July 17, 2026 12:46
@cmullenx cmullenx added validated Indicates that the PR is ready for actions run_e2e Add this label to run E2E test for meeting and CC widgets labels Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +771 to +772
const acceptBtn = testManager.agent1Page.getByTestId(CAMPAIGN_TEST_IDS.ACCEPT_BUTTON).first();
await expect(acceptBtn).toBeDisabled();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-720.d1b38q61t1z947.amplifyapp.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run_e2e Add this label to run E2E test for meeting and CC widgets validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant