Skip to content

Conversation

@ktx-akshay
Copy link
Collaborator

…d filtering

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Failed to generate code suggestions for PR

@ktx-akshay ktx-akshay changed the title Test: Update the dashboard test cases for the deployed environment Test: Stabilize and Update Dashboard Tests for the Deployed Environment Dec 2, 2025
@ktx-akshay ktx-akshay force-pushed the dashboard-tests-improvements-deployed branch from 8606e85 to 27b5abf Compare December 2, 2025 10:41
@ktx-akshay ktx-akshay force-pushed the dashboard-tests-improvements-deployed branch from 32d2018 to 5ca8814 Compare December 2, 2025 12:17
@ktx-akshay ktx-akshay changed the title Test: Stabilize and Update Dashboard Tests for the Deployed Environment Test: Stabilize Dashboard Tests for Deployed Environment Dec 2, 2025
@ktx-akshay ktx-akshay marked this pull request as ready for review December 2, 2025 12:32
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Failed to generate code suggestions for PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 2, 2025

Greptile Overview

Greptile Summary

This PR improves test stability for dashboard tests in deployed environments by refining element locators and adding wait strategies.

Key Changes:

  • Improved field item locator in dashboard-chart.js by using .filter() and .first() instead of hasText option for more reliable element selection
  • Changed query cell selector from .first() to .nth(1) in multi y-axis test to target the correct cell
  • Added waitForDashboardUIStable() call before dashboard creation to ensure UI is ready
  • Skipped flaky HTML variable test that doesn't work consistently across environments
  • Added 5-second hardcoded timeout after dashboard creation (consider replacing with event-based waiting)

Issues Found:

  • Typo in comment: "beacuse" should be "because"
  • Hardcoded 5-second waitForTimeout may slow tests unnecessarily
  • Commented-out wait code should be cleaned up

Confidence Score: 4/5

  • This PR is safe to merge with minor style improvements recommended
  • The changes improve test reliability through better element locators and wait strategies. The core logic changes are sound - using .filter().first() is more robust than hasText option, and .nth(1) correctly targets the intended element. The addition of stability waits addresses real timing issues in deployed environments. However, the hardcoded 5-second timeout and commented-out code are minor technical debt items that could be improved.
  • Pay close attention to dashboard-html-chart.spec.js - contains hardcoded timeout that may need refinement for optimal test performance

Important Files Changed

File Analysis

Filename Score Overview
tests/ui-testing/pages/dashboardPages/dashboard-chart.js 5/5 improved field locator by using .filter() and .first() for more reliable element selection
tests/ui-testing/playwright-tests/dashboards/dashboard-html-chart.spec.js 3/5 added stability wait and hardcoded 5s timeout, skipped flaky test, has typo in comment
tests/ui-testing/playwright-tests/dashboards/dashboard-multi-y-axis.spec.js 4/5 changed .first() to .nth(1) for query selector, left commented-out wait timeout

Sequence Diagram

sequenceDiagram
    participant Test as Test Spec
    participant PM as PageManager
    participant DC as DashboardCreate
    participant CTS as ChartTypeSelector
    participant Page as Playwright Page
    
    Test->>PM: Initialize PageManager(page)
    Test->>PM: menuItem("dashboards-item")
    Test->>Page: waitForDashboardPage()
    
    opt HTML Chart Test Only
        Test->>DC: waitForDashboardUIStable()
        DC->>Page: Wait for search input visible
        DC->>Page: Wait for import button visible
        DC-->>Test: UI Stable
    end
    
    Test->>DC: createDashboard(name)
    DC->>Page: Wait for "New Dashboard" button
    DC->>Page: Click dashboard create button
    DC->>Page: Fill dashboard name
    DC->>Page: Click submit
    DC-->>Test: Dashboard created
    
    opt HTML Chart Test Only
        Test->>Page: waitForTimeout(5000)
    end
    
    Test->>DC: addPanel()
    Test->>CTS: selectChartType()
    
    alt Multi Y-Axis Chart
        Test->>CTS: searchAndAddField(fieldName, target)
        CTS->>Page: Fill search input
        CTS->>Page: locator().filter({hasText}).first()
        Note over CTS,Page: Improved locator strategy
        CTS->>Page: Click add button
        Test->>Page: Click query inspector
        Test->>Page: getByRole("cell").nth(1)
        Note over Test,Page: Changed from .first() to .nth(1)
    else HTML Chart
        Test->>Page: Fill HTML editor with snippet
        Test->>Page: Verify rendered content
    end
    
    Test->>PM: savePanel()
    Test->>PM: backToDashboardList()
    Test->>Test: deleteDashboard()
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@ktx-akshay ktx-akshay changed the title Test: Stabilize Dashboard Tests for Deployed Environment test: Stabilize Dashboard Tests for Deployed Environment Dec 2, 2025
@ktx-akshay ktx-akshay merged commit 9b9e99b into main Dec 2, 2025
49 of 58 checks passed
@ktx-akshay ktx-akshay deleted the dashboard-tests-improvements-deployed branch December 2, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants