Skip to content

Conversation

brendanx67
Copy link
Contributor

  • Added keyboard help for grids
  • Replaced deprecated WebBrowser (IE-based) with WebView2 (Chromium based)
  • Enabled DocumentationViewer test in StandardTypeTest

Brendan MacLean and others added 3 commits October 4, 2025 10:17
- Added keyboard help for grids
- Replaced deprecated WebBrowser (IE-based) with WebView2 (Chromium based)
- Enabled DocumentationViewer test in StandardTypeTest
@brendanx67 brendanx67 requested a review from nickshulman October 4, 2025 17:58
@brendanx67
Copy link
Contributor Author

I have run the tests that bring up the DocumentationViewer many hundreds of times in all languages without failure. Though, this level of consistency was not easy to achieve, while still testing that the HTML shows up in the browser.


private void RunUI(Action act)
{
Invoke(act);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend using "CommonActionUtil.SafeBeginInvoke" here because it handles the case where the form has already been closed.
If it were important that you use "Invoke" instead of "BeginInvoke" then you would not want to use SafeBeginInvoke, but I don't think we care in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I also changed the function name to RunUIAsync to be clearer about what it is doing.

Invoke(act);
}

private void CleanupTestDataFolder()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this code into "DocumentationViewerHelper"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cursor/Claude left things a bit messy. I moved the DocumentationViewHelper the IDisposable I asked the LLM agent to create out to AbstractFunctionalTestEx fairly late in the process, and clearly didn't move everything I could have to it. After moving a bunch more, I was also able to get rid of the extra debug flags on the WebView2 environment. Much cleaner and simpler now without the complicating need of trying to clean up the test environment in Form_Closed(), and it ran thousands of times without a failure. The test code is now responsible for creating and deleting the environment temp folder, and tries the folder deletion in a WaitForCondition() loop.

public class KeyboardShortcutHelpTest : AbstractFunctionalTestEx
{
[TestMethod, NoParallelTesting(TestExclusionReason.WEB_BROWSER_USE)]
public void TestKeyboardShortcutHelp()
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should have two different [TestMethod]'s in this class: "TestKeyboardShortcutHelp" and "TestDebugKeyboardShortcutHelp" where only the "TestDebug" method sets "TestWebView2EnvironmentDirectory" and is able to assert more things about the HTML content.
The regular "TestKeyboardShortcutHelp" might not be able to assert as many things but would at least be able to verify that nothing bad happens when WebView2 is invoked without all those debug arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not in this PR. Willing to consider a PR from you later that improves on what I have done.

DocumentationViewer.TestWebView2EnvironmentDirectory = testContext.GetTestResultsPath(@"WebView2");
Directory.CreateDirectory(DocumentationViewer.TestWebView2EnvironmentDirectory);

DocViewer = ShowDialog<DocumentationViewer>(SkylineWindow.ShowKeyboardShortcutsDocumentation);
Copy link
Contributor

Choose a reason for hiding this comment

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

The passed-in Action "showViewer" should be used instead of SkylineWindow.ShowKeyboardShortcutsDocumentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops

@brendanx67 brendanx67 merged commit 7f02855 into master Oct 6, 2025
12 checks passed
@brendanx67 brendanx67 deleted the Skyline/work/20250930_keyboard_extra branch October 6, 2025 17:48
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.

2 participants