Skip to content

Fix failing E2E tests for PR #4097#4098

Merged
acicovic merged 4 commits intofix/pci-sidebar-multiple-contact-messagesfrom
copilot/sub-pr-4097
Mar 26, 2026
Merged

Fix failing E2E tests for PR #4097#4098
acicovic merged 4 commits intofix/pci-sidebar-multiple-contact-messagesfrom
copilot/sub-pr-4097

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Description

PR #4097 moved <VerifyCredentials> to the Tools tab level, so when credentials are absent the "Related Posts" panel button no longer exists and the credentials message renders at the tab level — not inside a components-panel__body. The E2E tests that checked for this message were still trying to expand "Related Posts" and locate the error within a panel body, causing timeouts.

  • tests/e2e/utils.ts — Added getSidebarPanelOrTabMessage(page, selector): waits for the sidebar to render, checks relatedPostsButton.isVisible(), and either expands the panel (credentials present → message inside panel body) or reads directly from the tab level (credentials absent). Updated getRelatedPostsMessage to delegate to it.
  • tests/e2e/specs/content-helper/top-bar-icon.spec.ts — Replaced the duplicated (and missing-await) panel-expand logic in testContentHelperIcon with a call to the same shared helper.

Motivation and context

Six E2E tests were failing after PR #4097 because they assumed the credentials message would always be inside an opened panel body. The shared getSidebarPanelOrTabMessage helper handles both states without compromising test quality.

How has this been tested?

Covered by the existing E2E test suite (errors.spec.ts and top-bar-icon.spec.ts). The updated utilities correctly handle both the credentials-present path (expand panel, read from components-panel__body.is-opened) and the credentials-absent path (read from .wp-parsely-content-helper directly).


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI changed the title [WIP] Fix multiple contact messages in PCI Sidebar Fix failing E2E tests for PR #4097 Mar 26, 2026
Copilot AI requested a review from acicovic March 26, 2026 19:38
@acicovic acicovic marked this pull request as ready for review March 26, 2026 20:04
@acicovic acicovic requested a review from a team as a code owner March 26, 2026 20:04
@acicovic acicovic merged commit 1fd45ce into fix/pci-sidebar-multiple-contact-messages Mar 26, 2026
35 checks passed
@acicovic acicovic deleted the copilot/sub-pr-4097 branch March 26, 2026 20:15
@acicovic acicovic added this to the 3.22.1 milestone Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants