Improved cucumber tests

This commit is contained in:
vjrj 2018-05-23 06:29:31 +02:00
parent b53e5d0e36
commit b54707f2dc
6 changed files with 49 additions and 18 deletions

View file

@ -11,6 +11,14 @@
this.waitForVisible(selector, timeout);
this.waitForEnabled(selector, timeout);
});
client.addCommand('waitUntilText', function waitUntilText(selector, text, ms) {
ms = ms || 5000;
this.waitForVisible(selector);
const self = this;
this.waitUntil(() => self.getText(selector).includes(text), ms, `expected text in ${selector} be different after ${ms / 1000}s. Obtained: '${self.getText(selector)}' expected: '${text}'`);
});
this.initMyCmds = true;
}