Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[browser tests] Misc improvements in test infrastructure
Re-use puppeteer's empty Chrome tab: Puppeteer at some point started to open the Chrome browser with an empty tab by default. Then, when we create a new page for our tests, a new tab would be added. At least When running the tests with UI (option --test-inspect), sometimes the empty tab would be selected and apparently cause many tests to fail. It's possible that this also sometimes happened in headless mode. To avoid this, now re-use the empty tab instead of creating a new one. Make sure the Theia test app has focus and clear local browser storage: When launching in non-headless mode (with a UI and dev-tools open), it looks-like the dev-tools have focus, which interferes with some tests that query the UI, expecting our app to be in focus. Simply clicking on the app before starting the tests fixes it. Also clear the local browser storage, to possibly avoid starting the app with some state from the previous run. This could help when running the tests locally, since CI should in theory always start with a clean environment. Disable retry for failed tests in mocha config: It only seems to make things worse. Allow vieport to take available space instead of default 800x600: This gives much more space for the Theia app, specially when running in non-headless mode, where the editors can have very little real-estate when views on the sides are open. Delay exit after test finish: When running the suite in headless mode, it exits as soon as the mocha tests are done executing. In some cases, where there are lots of errors to report[1], the final report did not have the chance to be printed-out, and so we were left wondering about the details of what caused the failures. [1]: basically the final pass/not pass/skip count as well as details about the failed tests. note: includes a review suggestion by paul-marechal. Signed-off-by: Marc Dumais <[email protected]>
- Loading branch information