Skip to content

Improve graphical editor UI test focus handling - #3004

Draft
lwrage wants to merge 10 commits into
masterfrom
2018_fix_ge_ui_test_focus
Draft

Improve graphical editor UI test focus handling#3004
lwrage wants to merge 10 commits into
masterfrom
2018_fix_ge_ui_test_focus

Conversation

@lwrage

@lwrage lwrage commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • run the GE PDE tests off the SWT UI thread
  • replace native JavaFX input with synthetic actions where tests open modal dialogs
  • explicitly synchronize editor activation, property focus changes, Outline selection, and context-menu targets
  • locate test dialogs by visible shell instead of requiring the OS-active shell
  • parent flow-tool dialogs to their editor shell so background execution does not encounter a null active shell
  • copy error-model type tokens during multi-selection updates to preserve EMF containment

Related to #2018.

Testing

Ran the GE test bundle from the root reactor using the local profile and with-ge-tests profile.

Result: 35 tests run, 33 passed, and 2 errors. PrototypeEndToEndTest, DiagramExporterTest, and TransientViewTest passed. ErrorModelTest.testErrorFlows timed out waiting for the created error-flow element, and PrimaryEndToEndTest timed out because the Create Flow Implementation OK button remained disabled.

lwrage added 10 commits August 5, 2026 15:15
Configure the PDE launch to execute tests on a worker thread. This matches the Tycho UI-test execution model and leaves the SWT display thread available while SWTBot waits for and interacts with widgets.
Copy the selected type tokens before adding them to each edited type set. This prevents EMF containment from moving the same token instances between type sets during multi-selection edits.
Fire palette controls directly and dispatch diagram mouse events asynchronously. This avoids native Robot input and allows modal dialogs opened by JavaFX handlers to be driven from the test thread.
Remember property text controls changed by tests and send their focus-out notification before returning to the diagram. This makes data-binding updates deterministic without depending on native window focus transitions.
Focus the Outline view and explicitly select an item before opening its context menu. This removes reliance on whichever workbench control previously held keyboard focus.
Wait for diagram editors to open, activate and focus them before selection, and retain explicit context-menu targets. This keeps editor and navigator interactions tied to the intended widget instead of incidental workbench focus.
Find visible initialized shells and scope SWTBot widget lookup to the intended workbench window or dialog instead of requiring the OS-active shell. Parent flow dialogs to their editor shell and position nested dialogs relative to their actual parent so background execution does not encounter a null active shell.
Activate the with-ge-tests Maven profile for pull-request and master product builds. This restores org.osate.ge.tests to both Jenkins reactor paths while retaining the existing Xvnc environment for UI execution.
Create the nested point-cloud flow as a source and use that source as the first segment of the enclosing source implementation. The previous test assembled a source implementation beginning with a sink, so validation correctly kept the dialog's OK button disabled.
@lwrage
lwrage marked this pull request as draft August 6, 2026 20:18
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