Fix tests: "NVDA restarts on quit" and first time opening notepad failing (#18631)
Fixes some issues from #18597
Summary of the issue:
- Our timeout for waiting for NVDA exit when a crash is triggered is
only 3 seconds. Our timeout is 10 seconds for when testing for testing
NVDA to restart normally. This is causing the test to fail regularly
- Starting notepad is fragile. If notepad doesn't load before we open
task switcher, then it may fail to get focus. This results in the first
notepad test regularly failing.
Description of user facing changes:
none
Description of developer facing changes:
none
Description of development approach:
- The timeout for waiting for NVDA to exit after a crash is triggered is
increased.
- When starting notepad, we first wait to see if it gets focus normally.
If not, we try to task switch to it. This gives ample time for notepad
to load, and avoids task switching if its not necessary
Testing strategy:
Ran each test 50 times. results:
17 failures out of 50 runs of 4 test suites.
This is around the same rate as #18597, however there is an increase to
timeout issues (likely due to reduced resources for 50x4 matrix jobs).
It is likely that these timeout issues will occur with a lower frequency
on normal builds.
Test failures:
- "Speech did not finish before timeout" - 7
- "Timed out waiting for key to be processed" - 4
- "Timed out waiting for core to sleep again" - 2
- "Unable to get chrome window" - 1
- "Unable to get notepad window" - 1
- "Unable to connect to nvdaSpyLib" - 1
- "Focus mode: report content editable with details braille Actual !=
Expected: Focus mode != The word hlght has cmnt cat hlght end has a
comment tied to it." - 1
Note that the failures noted in #18597 and targeted by this fix do not
occur:
Startup/shutdown:
- 5x: Ensure NVDA restarts on crash: Old NVDA is still running.
- 3x: symbolInSpeechUI :: Ensure symbols aren't substituted within NVDA.
Unable to focus Notepad.
Known issues with pull request:
see test failures