fix: update E2E tests for Studio UI redesign#3529
Conversation
…transactions (#3524) saveRecord() and deleteRecord() in RemoteGrpcDatabase did not include the active transactionId in gRPC requests, and the server-side handlers did not look up external transactions from the activeTransactions map. This caused "Transaction not active" errors when using begin()/commit() with vertex save or delete operations. Refactored server handlers to follow the same pattern as executeCommand() — dispatching to the transaction's dedicated executor thread when an external transaction is active. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Separate IllegalArgumentException (INVALID_ARGUMENT) from other exceptions (INTERNAL) in createRecord error handling. Wrap all record types (Vertex, Document, Edge) in explicit transaction management in createRecordInternal, consistent with updateRecordInternal and deleteRecordInternal. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Update all Playwright E2E test selectors and workflows to match the
redesigned ArcadeDB Studio frontend:
- Login: #loginPopup -> #loginPage, Sign In button -> .login-submit-btn
- Database selector: <select> -> searchable dropdown (#queryDbSelectContainer)
- Execute button: role-based -> [data-testid="execute-query-button"]
- Toasts: SweetAlert2 -> Bootstrap toasts (#toastContainer .studio-toast)
- Graph container: locator('canvas').last() -> locator('#graph')
- Graph tab: results now default to Table view, explicitly switch to Graph
- Server page: 6 individual charts -> summary cards + single #serverChartCommands
- DataTables export: buttons in wrapper -> custom .dt-export-dropdown menu
- Canvas selectors in evaluate(): canvas:last-child -> #graph canvas
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on adapting the Playwright end-to-end tests to a significant redesign of the ArcadeDB Studio user interface. It updates numerous selectors and interaction patterns across the test suite to ensure that automated tests continue to function correctly with the new frontend. Additionally, it addresses a critical bug in the gRPC server's transaction handling for record creation, update, and deletion, ensuring that these operations correctly participate in ongoing transactions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🧪 CI InsightsHere's what we observed from your CI run for ff728f2. 🟢 All jobs passed!But CI Insights is watching 👀 |
There was a problem hiding this comment.
Code Review
This pull request updates the E2E tests to align with a UI redesign, primarily by updating selectors and test logic to match the new frontend. It also includes a backend fix for gRPC transaction handling, which is well-implemented and comes with new regression tests. The E2E test updates are generally good, but I've identified several instances where waitForTimeout is used. I've provided suggestions to replace these with more robust, condition-based waits to improve test stability and prevent flakiness.
| // Verify we're on the Database tab | ||
| await expect(page.getByRole('heading', { name: 'Database' })).toBeVisible(); | ||
| // Wait for the database tab to load | ||
| await page.waitForTimeout(1000); |
There was a problem hiding this comment.
Using waitForTimeout can lead to flaky tests because it's not synchronized with the application's state. It's better to wait for a specific element to be ready. Here, you can wait for the 'Create' button to become visible before proceeding.
| await page.waitForTimeout(1000); | |
| await expect(page.locator('button[onclick="createDatabase()"]')).toBeVisible(); |
| // Navigate to Metrics subtab | ||
| await page.getByRole('link', { name: 'Metrics' }).click(); | ||
| await page.locator('#tab-metrics-sel').click(); | ||
| await page.waitForTimeout(2000); // Wait for metrics to load |
| await page.locator('#tab-server-events-sel').click(); | ||
|
|
||
| // Wait for events table to load | ||
| await page.waitForTimeout(2000); // Events may take time to load |
There was a problem hiding this comment.
Using waitForTimeout can make tests flaky. Instead of a fixed wait, it's better to wait for the element to be visible for a certain period, especially since its appearance is optional. This can be done with waitFor and catching a timeout error.
| await page.waitForTimeout(2000); // Events may take time to load | |
| await page.locator('#serverEvents').waitFor({ state: 'visible', timeout: 2000 }).catch(() => { /* table might not appear, which is acceptable */ }); |
| await expect(page.getByRole('link', { name: 'Graph' })).toBeVisible(); | ||
| // Switch to Graph tab (results default to Table view) | ||
| await page.locator('a[href="#tab-graph"]').click(); | ||
| await page.waitForTimeout(500); |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3529 +/- ##
==========================================
+ Coverage 57.51% 57.56% +0.04%
==========================================
Files 1500 1500
Lines 102663 102729 +66
Branches 21266 21286 +20
==========================================
+ Hits 59048 59133 +85
+ Misses 35230 35191 -39
- Partials 8385 8405 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
(cherry picked from commit 4ef1924)
Summary
e2e-studio/to match the redesigned Studio frontend#loginPage,.login-submit-btn), database selector (searchable dropdown), execute button (data-testid), toast notifications (Bootstrap), graph container (#graphdiv), server page (summary cards + single chart), and DataTables export (custom dropdown menu)Test plan
npx playwright test— 81 passed, 2 flaky (timing-sensitive graph init), 1 skipped🤖 Generated with Claude Code