Introduce Page Object Model for UI test suite (#600)#606
Merged
Conversation
Add a page object layer under src/test/pages/ to encapsulate VS Code UI interactions, and refactor the LSP/snippet/diagnostic, hover, and dev-mode action tests to use it. Page objects expose intent-revealing methods and return data; assertions remain in the test files. Page objects added: - EditorPage: open/clear a file, move cursor to end, replace text on a line, hover, and expose the raw editor for generic operations (getEditor). - ProblemsPage: hasDiagnostic() to check the Problems view for a message. - CodeAssistPage: insertSnippet() wrapping the content-assist trigger/select/ close flow, including the null guard and settle delay. - QuickFixPage: applyFix() wrapping the quick-fix menu keystroke and option selection. - DashboardPage: runAction()/getSection()/getProjectItem() wrapping the Liberty Tools sidebar section+item fetch and launchDashboardAction, with fresh re-fetch each call to avoid stale-element errors and the mac/non-mac action pairing hidden internally. Tests refactored to use the page objects: - MavenTestLSPRestSnippetAndDiagnostic.ts - GradleTestLSPRestSnippetAndDiagnostic.ts - MavenTestLSPHover.ts / GradleTestLSPHover.ts - MavenTestDevModeActions.ts / GradleTestDevModeActions.ts UI mechanics (drivers, selectors, command IDs, section/item bookkeeping) move out of the test files into the page objects. Test behavior is unchanged; existing test cases, timeouts, and logging are preserved.
This was referenced Jun 22, 2026
mattbsox
requested changes
Jun 24, 2026
goldenryan
requested changes
Jun 24, 2026
goldenryan
left a comment
There was a problem hiding this comment.
Awesome work on this :) Just one comment
EditorPage now only models the page object (openFile, getEditor). The utility methods clear, moveCursorToEnd, replaceTextWithinLineContaining, and hoverOver have been moved to src/test/utils/editorUtils.ts as standalone exported functions, per code review feedback.
mattbsox
requested changes
Jun 24, 2026
mattbsox
left a comment
Member
There was a problem hiding this comment.
Can add some missing file copyrights too
/*
* IBM Confidential
* Copyright IBM Corp. 2026
*/
goldenryan
approved these changes
Jun 24, 2026
mattbsox
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added src/test/pages/ to encapsulate VS Code UI interactions, and refactored the LSP/snippet/diagnostic, hover, and dev-mode action tests to use it. Assertions remain in the test files.
Page objects added:
Tests refactored to use the page objects:
Test behavior is unchanged; existing test cases, timeouts, and logging are preserved.
#600