Skip to content

Conversation

@shouples
Copy link
Contributor

@shouples shouples commented Dec 15, 2025

Summary of Changes

The current .scrollIntoViewIfNeeded() doesn't work for virtualized views, since all tree items aren't loaded into the Electron DOM after the initial getChildren and subsequent getTreeItem calls. As a result, we need a dedicated way to look up specific items in a view when there may be many.

This PR extends the View page object model with a new SearchableView class with some helper functions to invoke the *.search command from the nav area, complete the text input, and return a ViewItem after asserting the searched item is found, reducing boilerplate needed for callers to access their targeted tree items.

(The first iteration of this attempted to manually scroll through the view and hope the target item eventually appeared, but that grew slower over time / as more items were added to the view, so the most straightforward implementation was to go with the existing search functionality, which also indirectly adds more test coverage.)

Closes #3136

Optional: Any additional details or context that should be provided?

  • This also includes more explicit waiting for views' loading states through the progressIndicator getter method. Without it, we would occasionally see race conditions in the test where an action would be invoked for a tree item before/during a loading state, and the command wouldn't receive the corresponding tree item resource (e.g. a KafkaTopic when trying to produce messages, delete the topic, etc)
    • We may want to put these kinds of calls behind a helper method, but I opted toward keeping it more explicit for now since sometimes we just want to make sure the progress indicator isn't visible, and other times we want to make sure it shows up and then disappears:
      // progress indicator should be visible while the view reloads, then disappear when done
      await expect(this.progressIndicator).toBeVisible();
      await expect(this.progressIndicator).toBeHidden();
  • Logging updates in baseTest.ts are to avoid the additional noise when 1) tests failed to save extension/sidecar logs, and 2) the electron context timed out when closing (which we typically see in CI)

Pull request checklist

Please check if your PR fulfills the following (if applicable):

Tests

  • Added new
  • Updated existing
  • Deleted existing

Release notes

  • Does anything in this PR need to be mentioned in the user-facing CHANGELOG?

…or `getItemByLabel` to use search behavior for new SearchableView subclass on supporting views
…logging full playwright error for sidebar closing or extension/sidecar log saving issues
Comment on lines -17 to -20
/** Get the placeholder text from the input field. */
get placeholder(): Locator {
return this.input;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need for this since we can just use .input directly

@shouples shouples changed the title fix: use explicit scrolling for E2E tests navigating tree items in views fix(E2E): integrate view searching into tests instead of scrolling for specific tree items Dec 23, 2025
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.

E2E bug: handle scrolling in virtualized views

2 participants