Add cypress for promo link click curations - #14180
Open
HarveyPeachey wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Cypress end-to-end coverage to verify that clicking a promo “card/container” (not just the inner link) navigates to the expected destination, helping protect the full-card click target behavior on Topic and Home pages.
Changes:
- Added a Topic Page Cypress test that clicks the first promo container and asserts navigation.
- Added a Home Page (canonical-only) Cypress test that clicks the first promo container when topic promos exist.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ws-nextjs-app/cypress/e2e/pageTypes/topicPage/tests.ts | Adds a new Topic Page E2E test for promo container click navigation. |
| ws-nextjs-app/cypress/e2e/pageTypes/homePage/testsForCanonicalOnly.ts | Adds a new canonical Home Page E2E test for promo container click navigation (when promos exist). |
Comment on lines
+46
to
+48
| describe('Promo click target', () => { | ||
| it('should navigate when clicking the first promo container area', () => { | ||
| cy.get('body').then($body => { |
Comment on lines
+120
to
+127
| cy.get('@firstPromo') | ||
| .find('h2 a') | ||
| .should('have.attr', 'href') | ||
| .then($href => { | ||
| // Click container area rather than the anchor itself to verify the full-card click target. | ||
| cy.get('@firstPromo').click('topRight'); | ||
| cy.url().should('eq', $href); | ||
| }); |
Comment on lines
+60
to
+67
| cy.get('@firstPromo') | ||
| .find('h2 a') | ||
| .should('have.attr', 'href') | ||
| .then($href => { | ||
| // Click container area rather than the anchor itself to verify the full-card click target. | ||
| cy.get('@firstPromo').click('topRight'); | ||
| cy.url().should('eq', $href); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves JIRA:
Summary
A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.
Code changes
Testing
Useful Links