-
Notifications
You must be signed in to change notification settings - Fork 715
test: enhance dashboard import functionality and stability #9457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Failed to generate code suggestions for PR |
7857b21 to
a55d65b
Compare
|
Failed to generate code suggestions for PR |
Greptile OverviewGreptile SummaryThis PR significantly improves the stability and robustness of dashboard import end-to-end tests by adding comprehensive retry logic, extended wait conditions, and better error handling throughout the import and deletion workflows. Key Changes
Style Issues
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Test as Test Spec
participant PM as PageManager
participant DI as DashboardImport
participant Page as Playwright Page
participant UI as UI Elements
Note over Test,UI: Dashboard Import Flow (Enhanced)
Test->>PM: dashboardImport.clickImportDashboard()
PM->>DI: clickImportDashboard()
DI->>UI: Wait for import button (15s)
DI->>UI: Click import button
DI->>UI: Wait for file tab (10s)
DI->>UI: Wait for input attached (10s)
alt File Upload
Test->>DI: uploadDashboardFile(path)
DI->>UI: Wait for file tab visible (10s)
DI->>UI: Click file tab
loop Retry up to 3 times
DI->>UI: setInputFiles(path)
alt Success
DI->>UI: Break retry loop
else Failure
DI->>UI: Wait for input attached (5s)
end
end
DI->>UI: Wait for JSON editor visible (10s)
DI->>UI: Wait for view lines visible (10s)
else URL Import
Test->>DI: clickUrlImportTab()
loop Retry up to 5 times
DI->>UI: Wait for URL tab (30s)
DI->>UI: Click URL tab
DI->>UI: Wait for URL input visible (10s)
alt Success
DI->>UI: Break retry loop
else Failure
DI->>UI: Wait for tab visible (5s)
end
end
Test->>Page: Fill URL input
Test->>Page: Wait for JSON content
end
Test->>DI: clickImportButton()
DI->>UI: Wait for import button
DI->>UI: Click import button
Test->>Page: waitForDashboardPage()
Page->>UI: Wait for URL navigation (30s)
Page->>UI: Wait for page stabilization (1s)
alt Promise.race (first to complete)
Page->>UI: Wait for API response (30s)
Page->>UI: Wait for dashboard table (30s)
Page->>UI: Wait for import button (30s)
end
Page->>UI: Final stabilization wait (1s)
Test->>DI: deleteImportedDashboard(prefix, name)
DI->>UI: Wait for dashboard table (20s)
DI->>UI: Wait for first row (15s)
loop Retry up to 5 times to find row
DI->>UI: Wait for dashboard row (4s)
alt Row found
DI->>UI: Break retry loop
else Not found
alt Final retry
DI->>UI: Fallback to cell-based selector
DI->>UI: Click cell
DI->>UI: Click delete button
DI->>UI: Click confirm
else Continue retry
DI->>UI: Wait for DOM loaded
end
end
end
loop Retry up to 3 times to delete
DI->>UI: Hover over row
DI->>UI: Wait for delete button (10s)
DI->>UI: Click delete button
DI->>UI: Wait for confirm button (5s)
alt Success
DI->>UI: Break retry loop
else Failure
DI->>UI: Wait for row visible (5s)
end
end
DI->>UI: Click confirm button (10s)
alt Verify deletion (fallback chain)
DI->>UI: Wait for row detached (10s)
else Fallback 1
DI->>UI: Wait for networkidle (5s)
else Fallback 2
DI->>UI: Wait for row hidden (5s)
else Fallback 3
DI->>DI: Log warning via console
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
tests/ui-testing/playwright-tests/dashboards/dashboard-import.spec.js, line 15 (link)style: Use
testLogger.info()instead ofconsole.log()for consistency with the project's logging frameworkContext Used: Context from
dashboard- Use a logging framework instead of print statements for debugging in tests to allow better control o... (source)
3 files reviewed, 3 comments
a55d65b to
b9ca689
Compare
No description provided.