mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Simplify weather-compliments test, increase timeWaitout for it
This commit is contained in:
parent
ef2fd16b69
commit
b46160bcbc
@ -15,7 +15,8 @@ describe("Weather module", function () {
|
|||||||
|
|
||||||
async function setup(responses) {
|
async function setup(responses) {
|
||||||
app = await helpers.startApplication({
|
app = await helpers.startApplication({
|
||||||
args: ["js/electron.js"]
|
args: ["js/electron.js"],
|
||||||
|
waitTimeout: 100000
|
||||||
});
|
});
|
||||||
|
|
||||||
wdajaxstub.init(app.client, responses);
|
wdajaxstub.init(app.client, responses);
|
||||||
@ -101,16 +102,7 @@ describe("Weather module", function () {
|
|||||||
const weather = generateWeather();
|
const weather = generateWeather();
|
||||||
await setup({ template, data: weather });
|
await setup({ template, data: weather });
|
||||||
|
|
||||||
const wait = (time) => new Promise((resolve) => setTimeout(resolve, time));
|
return app.client.waitUntilTextExists(".compliments .module-content span", "snow");
|
||||||
|
|
||||||
var text = "";
|
|
||||||
do {
|
|
||||||
await wait(3000);
|
|
||||||
elem = await app.client.$(".compliments");
|
|
||||||
text = await elem.getText(".compliments .module-content span");
|
|
||||||
} while (text === "");
|
|
||||||
|
|
||||||
return expect(text.trim()).to.equal("snow");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user