nightwatch-custom-commands-assertions
nightwatch-custom-commands-assertions copied to clipboard
waitForText default time
is there a defautl time set in waitForText() function?
if i dont set a max time i get this error Expression wasn't true in 10000 ms. - expected "expression true" but got: expression false
if i set a max time to 10000 the element was found after 49ms
Yes there is, what you see in the output:
Expression wasn't true in 10000 ms. - expected "expression true" but got: expression false
is the variabile (timeoutInMilliseconds) that is used as timeout:
this.check(elementSelector, checker, (result, loadedTimeInMilliseconds) => {
if (result) {
var message = `waitForText: ${elementSelector}. Expression was true after ${loadedTimeInMilliseconds - this.startTimeInMilliseconds} ms.`;
} else {
var message = `waitForText: ${elementSelector}. Expression wasn't true in ${timeoutInMilliseconds} ms.`;
}
this.client.assertion(result, 'expression false', 'expression true', message, true);
return this.emit('complete');
}, timeoutInMilliseconds);
Can you share your code?
this was the code before i add my default waitForConditionTiemout
upgrade.waitForText('@deploy-status', (text) => {
return text === 'done';
});
there i get the error, and if i use
upgrade.waitForText('@deploy-status', (text) => {
return text === 'done';
}client.globals.waitForConditionTimeout);
it works fine for me
Does it work if you're not using page objects?
yes without page object it is working
i called now this
upgradeall.waitForText('div.dialog__content div:nth-child(1).grid__row div:last-child span', (text) => {
return text === 'done';
});
upgradeall.waitForText('@download-status', (text) => {
return text === 'done';
});
it is the same selector and the first (with out page object call) is working and the second not