Refactor Appium tests for per-test isolation and improved structure - #22
Merged
Conversation
- Split the monolithic MainWindowShellIntegrationTests.cs into per-feature
test classes (MainWindowLaunchIntegrationTests, FileMenuIntegrationTests,
ViewMenuIntegrationTests, QueryDialogIntegrationTests,
HelpMenuIntegrationTests) built on a new AppiumTestBase that gives every
[Fact] its own dedicated per-test application launch and WebDriver
session via StartApp(args), replacing the old shared-session
[Collection("AppFixture")] pattern so no test's state can leak into
another.
- Add a generic, cross-platform --startup-source <path> CLI argument
(App.axaml.cs's ApplyStartupSourceArgumentsForTesting) to preload a
workspace at launch without driving the unautomatable native OS "Open
File" dialog, replacing the old SYSML2WORKBENCH_STARTUP_FILE env-var
hook (removed from build.ps1, .github/workflows/build.yaml, and
App.axaml.cs).
- Fix a Mac2 AppFixture.ApplyStartupArguments bug where naive space
splitting left literal quote characters in defensively-quoted,
space-free argument values.
- Disable xUnit's default cross-collection parallelization
(GlobalUsings.cs) since each test class is now an implicit collection
that launches a real desktop app - without this, multiple app instances
launch simultaneously and fight for OS focus.
- Merge same-menu discoverability checks (File menu's 3 tests, View
menu's 4 tests) into one test each per menu, and add
AssertMenuItemsAreDiscoverableAndEnabled to AppiumTestBase so the merged
tests open the menu once, check every item in place, and close once,
instead of reopening/closing the menu once per item.
- Merge the Query dialog's round-trip test and its add-type-filter-button
screenshot test into one, capturing the screenshot inline during the
existing open/click/assert/close round trip instead of a separate
open/close cycle and application launch.
- Fix HelpMenuIntegrationTests to verify the About dialog actually closes
after clicking OK, not just that it opens.
- Update docs/verification/ots/appium.md and
docs/reqstream/ots/appium.yaml to match the new test structure, merged
tests, and fixes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
This pull request refactors how integration tests preload workspace sources in the application, replacing the single-use
SYSML2WORKBENCH_STARTUP_FILEenvironment variable with a more flexible command-line argument approach. It updates documentation and test fixtures to reflect this, improves per-test isolation for Appium integration tests, and consolidates several menu-item discoverability tests for better reliability and maintainability.Test infrastructure and application launch improvements:
--startup-source <path>command-line arguments, parsed inApplyStartupSourceArgumentsForTesting, instead of using theSYSML2WORKBENCH_STARTUP_FILEenvironment variable. This enables per-test customization of the workspace and avoids cross-test contamination. (src/DemaConsulting.SysML2Workbench/App.axaml.cs)SYSML2WORKBENCH_STARTUP_FILE, and instead pass startup sources as command-line arguments, ensuring each test can control its launch environment independently. (build.ps1,.github/workflows/build.yaml,AppFixture.cs) [1] [2] [3]Test isolation and reliability:
docs/verification/ots/appium.md) [1] [2]Test consolidation and documentation updates:
docs/reqstream/ots/appium.yaml,docs/verification/ots/appium.md) [1] [2]Minor improvements:
.cspell.yaml)test/DemaConsulting.SysML2Workbench.IntegrationTests/AppFixture.cs)