Simplify weather-compliments test, increase timeWaitout for it

This commit is contained in:
rejas 2021-02-11 21:20:16 +01:00
parent ef2fd16b69
commit b46160bcbc

View File

@ -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");
}); });
}); });