improve end to end tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-05-27 13:23:49 +01:00
parent d9552c7f5c
commit 37c875b863
2 changed files with 14 additions and 3 deletions

View file

@ -16,6 +16,11 @@ limitations under the License.
const assert = require('assert');
async function assertNoToasts(session) {
const toast = await session.query('.mx_Toast_toast');
assert(!toast, 'toast found when none expected');
}
async function assertToast(session, expectedTitle) {
const h2Element = await session.query('.mx_Toast_title h2');
const toastTitle = await session.innerText(h2Element);
@ -34,4 +39,4 @@ async function rejectToast(session, expectedTitle) {
await btn.click();
}
module.exports = {assertToast, acceptToast, rejectToast};
module.exports = {assertNoToasts, assertToast, acceptToast, rejectToast};