Add Host filter locator and RTA host-filter test - #1153
Conversation
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).
WalkthroughThe change adds a ChangesRTA host filtering
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
e2e_tests/pages/qan/rta/realTimeAnalytics.page.tse2e_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)
| 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); |
There was a problem hiding this comment.
🎯 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.
| 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.
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).