Skip to content

fix: update E2E tests for Studio UI redesign#3529

Merged
robfrank merged 5 commits intomainfrom
fix-e2e-studio
Feb 27, 2026
Merged

fix: update E2E tests for Studio UI redesign#3529
robfrank merged 5 commits intomainfrom
fix-e2e-studio

Conversation

@robfrank
Copy link
Copy Markdown
Collaborator

Summary

  • Update all 11 Playwright E2E test files in e2e-studio/ to match the redesigned Studio frontend
  • Fix login selectors (#loginPage, .login-submit-btn), database selector (searchable dropdown), execute button (data-testid), toast notifications (Bootstrap), graph container (#graph div), server page (summary cards + single chart), and DataTables export (custom dropdown menu)
  • Add explicit Graph tab switching since query results now default to the Table view

Test plan

  • Run npx playwright test — 81 passed, 2 flaky (timing-sensitive graph init), 1 skipped
  • Verify no regressions on CI with Docker environment

🤖 Generated with Claude Code

robfrank and others added 5 commits February 27, 2026 19:15
…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]>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • E2E Test Updates for Studio UI Redesign: All 11 Playwright E2E test files in e2e-studio/ have been updated to align with the redesigned Studio frontend, ensuring continued test coverage and functionality.
  • Selector Fixes: Login selectors (#loginPage, .login-submit-btn), the database selector (now a searchable dropdown), the execute button (data-testid), toast notifications (Bootstrap-based), the graph container (#graph div), the server page (summary cards + single chart), and DataTables export (custom dropdown menu) have all been updated to reflect new UI elements.
  • Graph Tab Switching: Explicit Graph tab switching has been added to tests, as query results now default to the Table view, requiring manual navigation to the Graph view for relevant assertions.
  • gRPC Transaction Handling: The createRecord, updateRecord, and deleteRecord gRPC service methods have been refactored to correctly handle external transactions, ensuring proper transaction context is maintained across operations.
  • gRPC Transaction Regression Tests: New regression tests have been added to verify that newVertex().save() and newEdge() operations within a gRPC transaction do not throw 'Transaction not active' errors and that transaction rollback/commit behavior is correct.

🧠 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
  • e2e-studio/tests/apexcharts-upgrade.spec.ts
    • Updated login selectors from #loginPopup to #loginPage and sign-in button from getByRole to .login-submit-btn.
    • Changed server tab navigation from getByRole('tab').nth(2) to #tab-server-sel.
    • Modified chart rendering assertions to focus on the single Transaction Operations chart (#serverChartCommands) and verify server summary cards instead of multiple individual charts.
  • e2e-studio/tests/create-database.spec.ts
    • Updated login selectors and sign-in button to match new UI.
    • Changed database tab navigation to #tab-database-sel and added a waitForTimeout for tab loading.
    • Modified database creation dialog selectors from getByRole('dialog') to #globalModal and input field to #inputCreateDatabaseName.
    • Updated database selection verification to use the searchable dropdown's .db-name element.
  • e2e-studio/tests/cytoscape-validation.spec.ts
    • Updated the canvas selector for graph operations from canvas:last-child to #graph canvas for more precise targeting.
  • e2e-studio/tests/datatables-compatibility.spec.ts
    • Updated DataTables export button assertions to target a custom dropdown (.dt-export-dropdown) and its menu items.
    • Modified sub-tab navigation selectors (e.g., Database Settings, Server Settings, Metrics, Events) to use specific ID selectors like #tab-db-settings-sel.
  • e2e-studio/tests/datatables-critical-validation.spec.ts
    • Adjusted the assertion for pagination info text to match a more flexible regex pattern Showing \d+ to \d+ of \d+ entries.
  • e2e-studio/tests/graph-context-menu.spec.ts
    • Updated query execution to use page.evaluate(() => (window as any).editor.setValue(...)) and the [data-testid="execute-query-button"] selector.
    • Modified graph canvas selectors from canvas:last-child to #graph canvas.
  • e2e-studio/tests/graph-export.spec.ts
    • Updated graph canvas selectors from canvas:last-child to #graph canvas for image export tests.
  • e2e-studio/tests/graph-styling.spec.ts
    • Updated query execution method to use CodeMirror API via page.evaluate and the [data-testid="execute-query-button"].
    • Added explicit graph tab switching (a[href="#tab-graph"]) since results now default to table view.
    • Increased timeout for waitForFunction checking globalCy initialization.
  • e2e-studio/tests/notification-test.spec.ts
    • Updated login dialog selectors from getByRole('dialog') to #loginPage and input fields to specific IDs.
    • Changed database selection to interact with the new searchable dropdown (#queryDbSelectContainer).
    • Modified query execution to use CodeMirror API and [data-testid="execute-query-button"].
    • Updated notification selectors from .swal2-toast to .studio-toast or #toastContainer .toast to match Bootstrap toasts.
  • e2e-studio/tests/query-beer-database.spec.ts
    • Updated login selectors and sign-in button to match new UI.
    • Changed database selection to interact with the new searchable dropdown (#queryDbSelectContainer).
    • Modified query execution to use CodeMirror API and [data-testid="execute-query-button"].
    • Added explicit graph tab switching and waitForFunction for Cytoscape initialization before graph assertions.
    • Removed vertices and text assertion as graph stats display changed.
  • e2e-studio/utils/test-utils.ts
    • Modified ArcadeStudioTestHelper constructor to make page public.
    • Updated login logic to use #loginPage and .login-submit-btn selectors.
    • Refactored database selection logic to interact with the new searchable dropdown (#queryDbSelectContainer).
    • Updated executeQuery to dismiss new Bootstrap toasts and use [data-testid="execute-query-button"].
    • Enhanced waitForGraphReady to explicitly switch to the Graph tab and verify #graph container visibility.
    • Adjusted setupGraphWithData and getGraphCanvas to return and target the #graph container instead of canvas.last().
  • grpc-client/src/main/java/com/arcadedb/remote/grpc/RemoteGrpcDatabase.java
    • Modified deleteRecord methods to include TransactionContext in the DeleteRecordRequest if a transaction is active.
    • Updated saveRecord (for both update and create) to include TransactionContext in UpdateRecordRequest and CreateRecordRequest respectively.
  • grpc-client/src/test/java/com/arcadedb/remote/grpc/RemoteGrpcDatabaseRegressionTest.java
    • Added MutableVertex import.
    • Introduced two new test methods: vertexSaveAndEdgeCreationWithinTransaction and vertexSaveRollbackWithinTransaction to validate transaction behavior for vertex saving and edge creation (Issue GRPC is not working? #3524).
  • grpcw/src/main/java/com/arcadedb/server/grpc/ArcadeDbGrpcService.java
    • Refactored createRecord, updateRecord, and deleteRecord gRPC service methods to delegate to internal methods (createRecordInternal, etc.) and handle external transaction contexts.
    • Implemented logic within internal record handling methods to conditionally begin, commit, or rollback transactions based on whether an external transaction is active or if the operation initiates an inline transaction.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/mvn-test.yml
Activity
  • The author, robfrank, reported running npx playwright test with 81 tests passed, 2 flaky (timing-sensitive graph init), and 1 skipped.
  • The author also indicated a plan to verify no regressions on CI with the Docker environment.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Feb 27, 2026

🧪 CI Insights

Here's what we observed from your CI run for ff728f2.

🟢 All jobs passed!

But CI Insights is watching 👀

@robfrank robfrank merged commit 4ef1924 into main Feb 27, 2026
11 of 13 checks passed
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The waitForTimeout is redundant here because the following expect call has its own timeout mechanism. You can remove this line and rely on Playwright's built-in waiting capabilities within expect.

await page.locator('#tab-server-events-sel').click();

// Wait for events table to load
await page.waitForTimeout(2000); // Events may take time to load
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This waitForTimeout is likely for the tab transition animation and can make the test flaky. The subsequent waitForFunction should be sufficient to wait for the graph to initialize. Consider removing this fixed wait for better test stability.

@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-7.98% 64.10%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (bc38243) 102663 67461 65.71%
Head commit (ff728f2) 133278 (+30615) 76944 (+9483) 57.73% (-7.98%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3529) 156 100 64.10%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 51.28205% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.56%. Comparing base (bc38243) to head (ff728f2).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
.../com/arcadedb/server/grpc/ArcadeDbGrpcService.java 52.89% 47 Missing and 18 partials ⚠️
...a/com/arcadedb/remote/grpc/RemoteGrpcDatabase.java 38.88% 9 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

robfrank added a commit that referenced this pull request Mar 5, 2026
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