Skip to content

Conversation

@anushkaaaaaaaa
Copy link
Contributor

@anushkaaaaaaaa anushkaaaaaaaa commented Nov 6, 2025

Description

  • i have added e2e tests in cypress for dashboard and events pages under community dropdown.

Related issue(s)

Summary by CodeRabbit

  • Tests
    • Added end-to-end test coverage for the Dashboard page: header, Hot Topics, Good First Issues, and header links.
    • Added end-to-end test coverage for the Events page: main sections, action buttons, calendar/ICS links, recordings, event types, FAQ/host links, and event cards across All, Upcoming, and Recorded tabs.
    • Added page-object test helpers to encapsulate reusable page interactions and assertions for Dashboard and Events.

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b839d8e
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/69538ea84837b8000840ac9a
😎 Deploy Preview https://deploy-preview-4548--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

Adds four new Cypress files: two end-to-end test suites (dashboard.cy.js, events.cy.js) and two Page Object Model classes (cypress/pages/dashboard.js, cypress/pages/events.js) implementing navigation and verification helpers for the Dashboard and Events pages.

Changes

Cohort / File(s) Summary
Test Suites
cypress/dashboard.cy.js, cypress/events.cy.js
New Cypress test modules. dashboard.cy.js tests dashboard visit, header, Hot Topics, Good First Issues, and header links. events.cy.js tests events page visit, main sections, action buttons, recordings, event types, tabs (All/Upcoming/Recorded), and multiple link/verifications.
Page Objects
cypress/pages/...
cypress/pages/dashboard.js, cypress/pages/events.js
New Page Object classes DashboardPage and EventsPage with navigation, visibility checks, section-specific verifications, link/href assertions, tab handling, and event-card inspections.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant T as Cypress Test
  participant P as Page Object
  participant B as Browser/App

  rect rgb(235,248,255)
    Note right of T: beforeEach -> visit page
    T->>P: visit()
    P->>B: navigate to URL
  end

  rect rgb(245,255,235)
    Note right of T: run verifications
    T->>P: verifyHeader()/verifySections()/verifyLinks()
    P->>B: query elements & read hrefs
    P-->>T: assertions (visible/text/href)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to:
    • Selector robustness and potential flakiness in cypress/pages/*.js
    • External-link href assertions and expected fragments
    • Timing/wait strategies around dynamic event lists and tab switches

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • akshatnema
  • sambhavgupta0705
  • devilkiller-ag
  • vishvamsinh28
  • anshgoyalevil
  • Mayaleeeee

Poem

🐰 I hopped through tests with whiskers bright,

I clicked each link and checked the site at night.
With pages neat and assertions true,
Dashboard and Events now pass review.
🌿

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: add e2e tests for dashboard and events pages' clearly and concisely describes the main change—adding end-to-end tests for two specific pages. It matches the changeset which introduces test files and page objects for dashboard and events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5f8e1c and 6760dc8.

📒 Files selected for processing (2)
  • cypress/events.cy.js (1 hunks)
  • cypress/pages/events.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cypress/events.cy.js
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: cypress-run
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Test NodeJS PR - windows-latest
  • GitHub Check: Test NodeJS PR - macos-13

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1089dbc) to head (b839d8e).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #4548   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          798       798           
  Branches       146       146           
=========================================
  Hits           798       798           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Nov 6, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 37
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-4548--asyncapi-website.netlify.app/

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
cypress/pages/events.js (3)

38-55: Remove unused method or add corresponding tests.

This method is not called anywhere in the test suite (cypress/events.cy.js). Consider removing it to reduce maintenance burden, or if it's intended for future use, add corresponding tests.


57-62: Remove unused method or add corresponding tests.

This method is not referenced in the test suite. Consider removing it or adding tests that exercise this functionality.


64-113: Eliminate code duplication across event card verification methods.

The methods verifyAllEventCards, verifyUpcomingEventCards, and verifyRecordedEventCards have identical implementations. This violates the DRY principle and increases maintenance burden.

Consolidate into a single method:

- verifyAllEventCards(count) {
+ verifyEventCards(count) {
    cy.get('[data-testid="EventPostItem-main"]')
      .should('have.length.at.least', count)
      .each(($card, index) => {
        if (index < count) {
          cy.wrap($card)
            .find('a[data-testid="EventPostItem-link"]')
            .should('have.attr', 'href')
            .and('match', /github\.com\/asyncapi\/community\/issues\/\d+/);
        }
      });
  }
+
+ verifyAllEventCards(count) {
+   return this.verifyEventCards(count);
+ }
+
+ verifyUpcomingEventCards(count) {
+   return this.verifyEventCards(count);
+ }
+
+ verifyRecordedEventCards(count) {
+   return this.verifyEventCards(count);
+ }
-
- verifyUpcomingEventCards(count) {
-   cy.get('[data-testid="EventPostItem-main"]')
-     .should('have.length.at.least', count)
-     .each(($card, index) => {
-       if (index < count) {
-         cy.wrap($card)
-           .find('a[data-testid="EventPostItem-link"]')
-           .should('have.attr', 'href')
-           .and('match', /github\.com\/asyncapi\/community\/issues\/\d+/);
-       }
-     });
- }
-
- verifyRecordedEventCards(count) {
-   cy.get('[data-testid="EventPostItem-main"]')
-     .should('have.length.at.least', count)
-     .each(($card, index) => {
-       if (index < count) {
-         cy.wrap($card)
-           .find('a[data-testid="EventPostItem-link"]')
-           .should('have.attr', 'href')
-           .and('match', /github\.com\/asyncapi\/community\/issues\/\d+/);
-       }
-     });
- }
cypress/pages/dashboard.js (2)

26-28: Remove unused method or add corresponding tests.

The verifyElementHasAttribute method is not referenced in the test suite (cypress/dashboard.cy.js). Consider removing it to reduce code clutter.


6-8: Consider extracting common helper to a base class.

The verifyElementIsVisible method is duplicated in both DashboardPage and EventsPage with identical implementations. For better maintainability, consider creating a base BasePage class that both page objects can extend.

Example structure:

In cypress/pages/base.js:

class BasePage {
  verifyElementIsVisible(selector) {
    cy.get(selector).should('be.visible');
  }
}

export default BasePage;

Then update both page objects:

import BasePage from './base';

class DashboardPage extends BasePage {
  // existing methods
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5a86b7 and 0b04fa6.

📒 Files selected for processing (4)
  • cypress/dashboard.cy.js (1 hunks)
  • cypress/events.cy.js (1 hunks)
  • cypress/pages/dashboard.js (1 hunks)
  • cypress/pages/events.js (1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Lighthouse CI
  • GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (5)
cypress/pages/events.js (2)

29-36: Verify if force: true is necessary for the click action.

Using { force: true } bypasses Cypress's actionability checks. This should only be used when the element is intentionally obscured or when there's a valid reason it can't be interacted with naturally.

Consider removing the force: true option and verifying if the click works without it:

  switchToFilter(label) {
    cy.get('[data-testid="EventFilters-main"]')
      .contains(
        '[data-testid="EventFilter-click"]',
        new RegExp(`^${label}$`, 'i'),
      )
-     .click({ force: true });
+     .click();
  }

If removing it causes test failures, investigate whether there's a UI issue (e.g., overlapping elements) that should be addressed in the application code rather than bypassed in tests.


1-161: Well-structured page object implementation.

The EventsPage class follows the page object pattern effectively, with clear method names and good use of data-testid attributes for stable selectors. The overall structure supports maintainable tests.

cypress/events.cy.js (1)

1-53: Well-organized test suite with comprehensive coverage.

The test suite is well-structured with clear, user-focused test descriptions. The use of beforeEach for page navigation and the separation of concerns across individual test cases makes the suite maintainable and easy to understand.

cypress/pages/dashboard.js (1)

1-62: Clean page object implementation.

The DashboardPage class is well-structured with clear, descriptive method names and appropriate use of helper methods. The page object pattern is correctly applied.

cypress/dashboard.cy.js (1)

1-25: Clean and focused test suite.

The test suite is well-organized with clear test cases that each verify a specific aspect of the dashboard page. The structure promotes maintainability and readability.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
cypress/pages/events.js (1)

115-127: Consider using descriptive selectors instead of hard-coded indices.

Using .eq(0) and .eq(1) makes tests fragile if button order changes. Consider adding more specific data-testid attributes or using text-based selection for better maintainability.

Example refactor using more descriptive approach:

  verifyEventButtonsLinks() {
-   cy.get('[data-testid="Events-Button"] a[data-testid="Button-link"]')
-     .eq(0)
+   cy.contains('[data-testid="Events-Button"] a[data-testid="Button-link"]', /add to google calendar/i)
      .should('be.visible')
      .and('have.attr', 'href')
      .and('include', 'calendar.google.com');

-   cy.get('[data-testid="Events-Button"] a[data-testid="Button-link"]')
-     .eq(1)
+   cy.contains('[data-testid="Events-Button"] a[data-testid="Button-link"]', /download ics/i)
      .should('be.visible')
      .and('have.attr', 'href')
      .and('include', 'calendar.google.com/calendar/ical');
  }
cypress/pages/dashboard.js (2)

6-12: Consider extracting common helpers to a base page class.

Both DashboardPage and EventsPage implement identical verifyElementIsVisible() methods. Extracting common helpers to a base class would reduce duplication and improve maintainability.

Example structure:

// cypress/pages/BasePage.js
class BasePage {
  verifyElementIsVisible(selector) {
    cy.get(selector).should('be.visible');
  }
  
  verifyTextVisible(text) {
    cy.contains(text).should('be.visible');
  }
}

export default BasePage;

Then update page objects:

// cypress/pages/dashboard.js
import BasePage from './BasePage';

class DashboardPage extends BasePage {
  visit() {
    cy.visit('/community/dashboard');
  }
  // ... rest of the methods
}

26-28: I need to expand the search to check if this method might be referenced outside the cypress directory.

Remove unused helper method verifyElementHasAttribute.

The method is defined in cypress/pages/dashboard.js (lines 26–28) but never called within the codebase. Removing it aligns with Page Object Model best practices and reduces code maintenance overhead.

- verifyElementHasAttribute(selector, attribute, value) {
-   cy.get(selector).should('have.attr', attribute, value);
- }
-
  verifyLinkWithText(selector, text, expectedHrefPart) {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5a86b7 and 0b04fa6.

📒 Files selected for processing (4)
  • cypress/dashboard.cy.js (1 hunks)
  • cypress/events.cy.js (1 hunks)
  • cypress/pages/dashboard.js (1 hunks)
  • cypress/pages/events.js (1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Lighthouse CI
  • GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (3)
cypress/dashboard.cy.js (1)

1-25: LGTM! Well-structured test suite.

The test suite follows Cypress best practices with clear test separation, appropriate use of beforeEach, and proper Page Object Model implementation.

cypress/events.cy.js (1)

1-53: LGTM! Comprehensive test coverage.

The test suite provides thorough coverage of the Events page functionality, including filtering, link validation, and section verification. Tests are well-organized and follow Cypress best practices.

cypress/pages/events.js (1)

29-36: Remove force: true from the click action and verify tests pass.

The force: true is the only instance of forced clicking in the entire cypress test suite, with no explanatory comments. The codebase consistently uses standard .click() without force and prioritizes visibility assertions via .should('be.visible'). Cypress best practices recommend avoiding force: true unless there's a legitimate reason (complex interaction patterns, element coverage, etc.), which is not evident here. Try removing force: true at line 35 and run the tests to confirm they pass—if they do, the force option was unnecessary and masks real actionability issues.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
cypress/pages/events.js (1)

101-113: Consider extracting button link verification to reduce duplication.

The two button link verifications follow the same pattern. While acceptable, extracting a helper would improve maintainability.

Apply this diff to reduce duplication:

+ verifyButtonLinkByIndex(index, expectedUrlPart) {
+   cy.get('[data-testid="Events-Button"] a[data-testid="Button-link"]')
+     .eq(index)
+     .should('be.visible')
+     .and('have.attr', 'href')
+     .and('include', expectedUrlPart);
+ }
+
  verifyEventButtonsLinks() {
-   cy.get('[data-testid="Events-Button"] a[data-testid="Button-link"]')
-     .eq(0)
-     .should('be.visible')
-     .and('have.attr', 'href')
-     .and('include', 'calendar.google.com');
-
-   cy.get('[data-testid="Events-Button"] a[data-testid="Button-link"]')
-     .eq(1)
-     .should('be.visible')
-     .and('have.attr', 'href')
-     .and('include', 'calendar.google.com/calendar/ical');
+   this.verifyButtonLinkByIndex(0, 'calendar.google.com');
+   this.verifyButtonLinkByIndex(1, 'calendar.google.com/calendar/ical');
  }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b04fa6 and c513668.

📒 Files selected for processing (1)
  • cypress/pages/events.js (1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Test NodeJS PR - macos-13
  • GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (7)
cypress/pages/events.js (7)

1-8: LGTM!

The class structure and helper method are well-designed. The verifyElementIsVisible helper promotes code reuse across visibility checks.


10-27: LGTM!

The visibility verification methods consistently use the helper and follow good practices with descriptive test IDs.


64-99: LGTM! Past review comment successfully addressed.

The duplication issue from the previous review has been resolved. The three verification methods (verifyAllEventCards, verifyUpcomingEventCards, verifyRecordedEventCards) now properly delegate to the shared verifyEventCards helper, eliminating code duplication while maintaining clear, semantic method names for test readability.


38-62: LGTM!

The event card link verification methods handle both title-based and index-based lookups correctly. The conditional logic in verifyEventCardLinkByTitleAndHref appropriately handles scenarios with and without metaText.


115-126: LGTM!

The FAQ and recordings link verification methods correctly validate both visibility and expected href patterns.


128-136: LGTM!

The event recording links validation properly checks for YouTube URLs using an appropriate regex pattern.


147-147: LGTM!

Standard ES6 default export.

Comment on lines +138 to +144
verifyHostLinks() {
cy.get('a[data-testid="TextLink-href"]')
.should('have.length.greaterThan', 0)
.each(($link) => {
cy.wrap($link).should('have.attr', 'href');
});
}
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 6, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Strengthen host link validation.

The method only verifies that the href attribute exists but doesn't validate its content. This weak assertion could allow empty or malformed URLs to pass.

Apply this diff to add meaningful validation:

  verifyHostLinks() {
    cy.get('a[data-testid="TextLink-href"]')
      .should('have.length.greaterThan', 0)
      .each(($link) => {
-       cy.wrap($link).should('have.attr', 'href');
+       cy.wrap($link)
+         .should('have.attr', 'href')
+         .and('not.be.empty')
+         .and('match', /^https?:\/\/.+/);
      });
  }

This ensures hrefs are non-empty and follow a valid URL pattern.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
verifyHostLinks() {
cy.get('a[data-testid="TextLink-href"]')
.should('have.length.greaterThan', 0)
.each(($link) => {
cy.wrap($link).should('have.attr', 'href');
});
}
verifyHostLinks() {
cy.get('a[data-testid="TextLink-href"]')
.should('have.length.greaterThan', 0)
.each(($link) => {
cy.wrap($link)
.should('have.attr', 'href')
.and('not.be.empty')
.and('match', /^https?:\/\/.+/);
});
}
🤖 Prompt for AI Agents
In cypress/pages/events.js around lines 138 to 144, the verifyHostLinks() helper
only checks that an href attribute exists but not its content; update it to
assert href is non-empty and matches a URL pattern by fetching each link's href
(cy.wrap($link).invoke('attr', 'href')) and then asserting it is truthy/length>0
and matches a reasonable regex (e.g., starts with http:// or https:// or a
protocol-relative or relative path pattern depending on app requirements);
ensure assertions use Cypress should with match or include to fail on empty or
malformed values.

Copy link
Member

Choose a reason for hiding this comment

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

@anushkaaaaaaaa What is the reason behind making it a resolve? For me, it makes sense to have a stronger assertion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
cypress/pages/events.js (1)

146-151: Strengthen host link assertions.

Reiterating earlier feedback: only checking that href exists won’t catch empty or malformed links. Please assert that the value is present and well-formed so the test guards against regressions.

   verifyHostLinks() {
     cy.get('a[data-testid="TextLink-href"]')
       .should('have.length.greaterThan', 0)
       .each(($link) => {
-        cy.wrap($link).should('have.attr', 'href');
+        cy.wrap($link)
+          .should('have.attr', 'href')
+          .and('not.be.empty')
+          .and('match', /^https?:\/\//);
       });
   }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c513668 and b5f8e1c.

📒 Files selected for processing (2)
  • cypress/events.cy.js (1 hunks)
  • cypress/pages/events.js (1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Test NodeJS PR - macos-13
  • GitHub Check: Test NodeJS PR - windows-latest

Comment on lines +29 to +37
switchToFilter(label) {
cy.get('[data-testid="EventFilters-main"]')
.contains(
'[data-testid="EventFilter-click"]',
new RegExp(`^${label}$`, 'i'),
)
.click();
cy.wait(500);
}
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 6, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Replace arbitrary wait with deterministic synchronization.

Using cy.wait(500) hides timing bugs and flakes whenever the DOM takes longer than half a second (or faster, if debounce finishes earlier). Please wait on a real condition—e.g., chain a .should(...) that asserts the clicked filter’s active state or wait on the network request powering the tab—so Cypress can retry automatically and the test remains stable.

   switchToFilter(label) {
     cy.get('[data-testid="EventFilters-main"]')
       .contains(
         '[data-testid="EventFilter-click"]',
         new RegExp(`^${label}$`, 'i'),
       )
-      .click();
-    cy.wait(500);
+      .click()
+      .should('have.attr', 'aria-pressed', 'true'); // adjust to the actual active-state indicator
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
switchToFilter(label) {
cy.get('[data-testid="EventFilters-main"]')
.contains(
'[data-testid="EventFilter-click"]',
new RegExp(`^${label}$`, 'i'),
)
.click();
cy.wait(500);
}
switchToFilter(label) {
cy.get('[data-testid="EventFilters-main"]')
.contains(
'[data-testid="EventFilter-click"]',
new RegExp(`^${label}$`, 'i'),
)
.click()
.should('have.attr', 'aria-pressed', 'true'); // adjust to the actual active-state indicator
}
🤖 Prompt for AI Agents
In cypress/pages/events.js around lines 29 to 37, replace the hard-coded
cy.wait(500) with deterministic synchronization: after clicking the filter,
chain a .should(...) that asserts the clicked filter entered its active state
(for example check the active CSS class or an aria attribute on the filter
element) OR wait on the network request that loads the filtered data by adding a
cy.intercept(...) and cy.wait('@alias') before proceeding; ensure the assertion
or network wait is chained to the existing get/contains/click flow so Cypress
can retry until the condition is met.

Copy link
Member

Choose a reason for hiding this comment

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

@anushkaaaaaaaa Please look into this

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Member

@princerajpoot20 princerajpoot20 left a comment

Choose a reason for hiding this comment

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

@anushkaaaaaaaa Please have a look at the review comments and CodeRabbit suggestions

dashboard.verifyHotTopicsSection();
});

it('User verifies Good First Issues section', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Can you please improve the naming of all these tests? You can refer to the test naming conventions. For example, test names should not start with phrases like user verifies.

The naming should follow a pattern like: should display the Good First Issues section

events.verifyFaqLink();
});

it('User verifies all host profile links', () => {
Copy link
Member

Choose a reason for hiding this comment

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

As mentioned above, please review the naming of all these tests

Comment on lines +138 to +144
verifyHostLinks() {
cy.get('a[data-testid="TextLink-href"]')
.should('have.length.greaterThan', 0)
.each(($link) => {
cy.wrap($link).should('have.attr', 'href');
});
}
Copy link
Member

Choose a reason for hiding this comment

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

@anushkaaaaaaaa What is the reason behind making it a resolve? For me, it makes sense to have a stronger assertion.

Comment on lines +29 to +37
switchToFilter(label) {
cy.get('[data-testid="EventFilters-main"]')
.contains(
'[data-testid="EventFilter-click"]',
new RegExp(`^${label}$`, 'i'),
)
.click();
cy.wait(500);
}
Copy link
Member

Choose a reason for hiding this comment

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

@anushkaaaaaaaa Please look into this

@@ -0,0 +1,25 @@
import DashboardPage from './pages/dashboard';

describe('Dashboard Page Tests', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Please pay attention to the naming. It is really important in order to have maintainable code.

It is a test file. Do you think we should have another tests appended in the naming? It should be simply like: Dashboard Page

@@ -0,0 +1,53 @@
import EventsPage from './pages/events';

describe('Events Page Tests', () => {
Copy link
Member

Choose a reason for hiding this comment

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

As mentioned above, please review all these namings

@@ -0,0 +1,62 @@
class DashboardPage {
visit() {
cy.visit('/community/dashboard');
Copy link
Member

@princerajpoot20 princerajpoot20 Dec 14, 2025

Choose a reason for hiding this comment

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

These visit() methods are everywhere. They are repeating everywhere. Consider using a single helper like visit(path). This reduces repetition and makes your code DRY.

Please review all the methods in all the tests you have added vis multiple PRs. If they can be extract out to shared functions which makes it re-usable and keeps the code DRY

@princerajpoot20
Copy link
Member

FYI: #4533 (review)

Copilot AI review requested due to automatic review settings December 30, 2025 08:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive end-to-end test coverage for the Dashboard and Events pages using Cypress, implementing the page object model pattern for better test maintainability and reusability.

Key changes:

  • Created page object classes encapsulating reusable interactions for Dashboard and Events pages
  • Added 14 test cases covering UI elements, navigation, links, and filtering functionality
  • Followed existing Cypress test patterns in the codebase with data-testid selectors

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
cypress/pages/events.js Page object implementing methods to interact with and verify the Events page, including filters, event cards, recordings, and various links
cypress/pages/dashboard.js Page object implementing methods to interact with and verify the Dashboard page header, sections, and navigation links
cypress/events.cy.js Test suite with 9 test cases covering Events page functionality including filters, recordings, event types, and link validation
cypress/dashboard.cy.js Test suite with 4 test cases verifying Dashboard page header, sections, and link functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +26 to +29
verifyElementHasAttribute(selector, attribute, value) {
cy.get(selector).should('have.attr', attribute, value);
}

Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The method verifyElementHasAttribute is defined but never used in the test file or within the page object itself. This creates unnecessary code that adds no value. Consider removing it to keep the codebase clean and maintainable.

Suggested change
verifyElementHasAttribute(selector, attribute, value) {
cy.get(selector).should('have.attr', attribute, value);
}

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +45
this.verifyLinkWithText(
'[data-testid="Button-link"]',
'Contribution Guide',
'github.com/asyncapi',
);

cy.contains('[data-testid="Button-link"]', 'Contribution Guide')
.should('have.attr', 'href')
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The verification of the 'Contribution Guide' link is duplicated. Lines 38-42 already verify the href contains 'github.com/asyncapi', then lines 44-46 unnecessarily retrieve the same link again just to check for 'type=source'. These assertions should be combined into a single chain or the link should be aliased to avoid redundant DOM queries.

Suggested change
this.verifyLinkWithText(
'[data-testid="Button-link"]',
'Contribution Guide',
'github.com/asyncapi',
);
cy.contains('[data-testid="Button-link"]', 'Contribution Guide')
.should('have.attr', 'href')
cy.contains('[data-testid="Button-link"]', 'Contribution Guide')
.should('be.visible')
.and('have.attr', 'href')
.and('include', 'github.com/asyncapi')

Copilot uses AI. Check for mistakes.
new RegExp(`^${label}$`, 'i'),
)
.click();
cy.wait(500);
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Hardcoded waits like cy.wait(500) are a Cypress anti-pattern and can lead to flaky tests. Instead, use explicit assertions to wait for the expected state after clicking the filter. For example, wait for the filter to become active or for the content to update by asserting on a class change or content change.

Suggested change
cy.wait(500);
cy.get('[data-testid="EventPostItem-main"]').should('be.visible');

Copilot uses AI. Check for mistakes.
Comment on lines +76 to +98
verifyAllEventCards() {
this.verifyEventCards();
}

switchToAll() {
this.switchToFilter('All');
}

switchToUpcoming() {
this.switchToFilter('Upcoming');
}

switchToRecorded() {
this.switchToFilter('Recorded');
}

verifyUpcomingEventCards() {
this.verifyEventCards();
}

verifyRecordedEventCards() {
this.verifyEventCards();
}
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The methods verifyAllEventCards(), verifyUpcomingEventCards(), and verifyRecordedEventCards() all delegate to the same verifyEventCards() method without any distinction. This creates unnecessary duplication and doesn't provide tab-specific validation. Consider either removing these wrapper methods and calling verifyEventCards() directly from tests, or add tab-specific assertions to validate that the correct subset of events is displayed.

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +56
verifyEventCardLinkByTitleAndHref(title, href, metaText) {
if (metaText) {
cy.contains('[data-testid="Event-span"]', metaText)
.parents('[data-testid="EventPostItem-main"]')
.within(() => {
cy.contains('h3', title).should('exist');
cy.get('a[data-testid="EventPostItem-link"]').should(
'have.attr',
'href',
href,
);
});
} else {
cy.contains('[data-testid="EventPostItem-main"]', title)
.find('a[data-testid="EventPostItem-link"]')
.should('have.attr', 'href', href);
}
}
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The method verifyEventCardLinkByTitleAndHref is defined but never used in the test file. This suggests either incomplete test coverage or unnecessary code. If this method is intended for future use, consider removing it until needed to keep the codebase clean. If specific event validation is needed, add corresponding tests.

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +64
verifyEventCardHrefByIndex(index, expectedHref) {
cy.get('[data-testid="EventPostItem-main"]')
.eq(index)
.find('a[data-testid="EventPostItem-link"]')
.should('have.attr', 'href', expectedHref);
}

Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The method verifyEventCardHrefByIndex is defined but never used in the test file. This suggests either incomplete test coverage or unnecessary code. Consider removing it until needed to keep the codebase clean.

Suggested change
verifyEventCardHrefByIndex(index, expectedHref) {
cy.get('[data-testid="EventPostItem-main"]')
.eq(index)
.find('a[data-testid="EventPostItem-link"]')
.should('have.attr', 'href', expectedHref);
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Be Triaged

Development

Successfully merging this pull request may close these issues.

3 participants