mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
improve electron tests (avoid errors in github workflows) (#2977)
Fix electron tests failing sometimes in github workflow.
This commit is contained in:
parent
3124b0a9c5
commit
2fec314ff5
@ -51,6 +51,7 @@ Special thanks to: @rejas, @sdetweil, @MagMar94
|
||||
- Possibility to change FontAwesome class in calendar, so icons like `fab fa-facebook-square` works.
|
||||
- Fix cors problems with newsfeed articles (as far as possible), allow disabling cors per feed with option `useCorsProxy: false` (#2840)
|
||||
- Tests not waiting for the application to start and stop before starting the next test
|
||||
- Fix electron tests failing sometimes in github workflow
|
||||
- Fixed gap in clock module when displayed on the left side with displayType=digital
|
||||
|
||||
## [2.21.0] - 2022-10-01
|
||||
|
@ -10,10 +10,14 @@ exports.startApplication = async (configFilename, systemDate = null, electronPar
|
||||
process.env.TZ = "GMT";
|
||||
jest.retryTimes(3);
|
||||
global.electronApp = await electron.launch({ args: electronParams });
|
||||
expect(global.electronApp);
|
||||
|
||||
if ((await global.electronApp.windows().length) === 1) {
|
||||
global.page = await global.electronApp.firstWindow();
|
||||
await global.electronApp.firstWindow();
|
||||
|
||||
for (const win of global.electronApp.windows()) {
|
||||
const title = await win.title();
|
||||
expect(["MagicMirror²", "DevTools"]).toContain(title);
|
||||
if (title === "MagicMirror²") {
|
||||
global.page = win;
|
||||
if (systemDate) {
|
||||
await global.page.evaluate((systemDate) => {
|
||||
Date.now = () => {
|
||||
@ -21,8 +25,7 @@ exports.startApplication = async (configFilename, systemDate = null, electronPar
|
||||
};
|
||||
}, systemDate);
|
||||
}
|
||||
expect(await global.page.title()).toBe("MagicMirror²");
|
||||
expect(await global.page.isVisible("body")).toBe(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user