Skip to content

Add Host filter locator and RTA host-filter test - #1153

Open
kiranvuyurru wants to merge 1 commit into
mainfrom
PMM-15206-rta-host-filters
Open

Add Host filter locator and RTA host-filter test#1153
kiranvuyurru wants to merge 1 commit into
mainfrom
PMM-15206-rta-host-filters

Conversation

@kiranvuyurru

Copy link
Copy Markdown
Contributor

Introduce a locator for the 'Filter by Host' input in the RTA page object and add a test step to the RTA overview suite that verifies filtering by host substring. The new step extracts rs101/rs102 host substrings, applies the filter, and asserts non-matching rows are removed while matching rows remain visible (toggling filters between checks).

Introduce a locator for the 'Filter by Host' input in the RTA page object and add a test step to the RTA overview suite that verifies filtering by host substring. The new step extracts rs101/rs102 host substrings, applies the filter, and asserts non-matching rows are removed while matching rows remain visible (toggling filters between checks).
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The change adds a filterByHost locator and tests partial host filtering in the RTA overview. The test confirms that matching rows remain visible and rows for the other host are excluded.

Changes

RTA host filtering

Layer / File(s) Summary
Host filter locator and validation
e2e_tests/pages/qan/rta/realTimeAnalytics.page.ts, e2e_tests/tests/qan/rta/overview.test.ts
The page object targets the “Filter by Host” control. The end-to-end test applies substrings from both service hostnames and validates the matching and excluded rows.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the new host-filter locator and RTA test, which are the main changes.
Description check ✅ Passed The description accurately explains the locator, host substring filtering, filter toggling, and row visibility assertions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e_tests/tests/qan/rta/overview.test.ts`:
- Around line 196-201: Remove the second queryAnalytics.rta.openFilters() call
before filling rs102HostSubstring, or make openFilters() state-aware so it only
opens a closed panel; preserve the existing filter checks and ensure the second
fill runs while the filter input is visible.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 50cd6fa0-8728-41f4-a37e-e9500fdc5220

📥 Commits

Reviewing files that changed from the base of the PR and between c8762dc and d1024d4.

📒 Files selected for processing (2)
  • e2e_tests/pages/qan/rta/realTimeAnalytics.page.ts
  • e2e_tests/tests/qan/rta/overview.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • percona/pmm-qa (manual)
  • percona/pmm (manual)

Comment on lines +196 to +201
await queryAnalytics.rta.openFilters();
await queryAnalytics.rta.inputs.filterByHost.fill(rs101HostSubstring);
await expect(queryAnalytics.rta.builders.rowByQueryText(rs102HostName)).toHaveCount(0);
await expect(queryAnalytics.rta.builders.rowByQueryText(rs101HostName).first()).toBeVisible();
await queryAnalytics.rta.openFilters();
await queryAnalytics.rta.inputs.filterByHost.fill(rs102HostSubstring);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep the filter panel open for the second host check.

The page object implements openFilters() as an unconditional click on the Show/Hide filters toggle. Line 196 opens the panel. Line 200 toggles it closed, so Line 201 can time out while filling a hidden input. Remove the second toggle or make openFilters() state-aware before filling the second value.

Suggested correction
-    await queryAnalytics.rta.openFilters();
+    if (!(await queryAnalytics.rta.inputs.filterByHost.isVisible())) {
+      await queryAnalytics.rta.openFilters();
+    }
     await queryAnalytics.rta.inputs.filterByHost.fill(rs102HostSubstring);
📝 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
await queryAnalytics.rta.openFilters();
await queryAnalytics.rta.inputs.filterByHost.fill(rs101HostSubstring);
await expect(queryAnalytics.rta.builders.rowByQueryText(rs102HostName)).toHaveCount(0);
await expect(queryAnalytics.rta.builders.rowByQueryText(rs101HostName).first()).toBeVisible();
await queryAnalytics.rta.openFilters();
await queryAnalytics.rta.inputs.filterByHost.fill(rs102HostSubstring);
await queryAnalytics.rta.openFilters();
await queryAnalytics.rta.inputs.filterByHost.fill(rs101HostSubstring);
await expect(queryAnalytics.rta.builders.rowByQueryText(rs102HostName)).toHaveCount(0);
await expect(queryAnalytics.rta.builders.rowByQueryText(rs101HostName).first()).toBeVisible();
if (!(await queryAnalytics.rta.inputs.filterByHost.isVisible())) {
await queryAnalytics.rta.openFilters();
}
await queryAnalytics.rta.inputs.filterByHost.fill(rs102HostSubstring);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e_tests/tests/qan/rta/overview.test.ts` around lines 196 - 201, Remove the
second queryAnalytics.rta.openFilters() call before filling rs102HostSubstring,
or make openFilters() state-aware so it only opens a closed panel; preserve the
existing filter checks and ensure the second fill runs while the filter input is
visible.

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.

1 participant