Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-05-27 15:05:40 +01:00
parent 63ac1cb4ab
commit cb07fa53f4
1 changed files with 12 additions and 36 deletions

View File

@ -20,25 +20,13 @@ module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
// alice.log.step(`accepts desktop notifications toast`);
// await acceptToast(alice, "Notifications");
// alice.log.done();
//
// alice.log.step(`accepts analytics toast`);
// await acceptToast(alice, "Help us improve Riot");
// alice.log.done();
alice.log.step(`accepts desktop notifications toast`);
await acceptToast(alice, "Notifications");
alice.log.done();
while (true) {
try {
const h2Element = await alice.query('.mx_Toast_title h2');
const toastTitle = await alice.innerText(h2Element);
console.log("DEBUG closing", toastTitle);
const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
await toastDismissButton.click();
} catch (e) {
break;
}
}
alice.log.step(`rejects analytics toast`);
await rejectToast(alice, "Help us improve Riot");
alice.log.done();
alice.log.step(`checks no remaining toasts`);
await assertNoToasts(alice);
@ -46,25 +34,13 @@ module.exports = async function toastScenarios(alice, bob) {
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
// bob.log.step(`reject desktop notifications toast`);
// await rejectToast(bob, "Notifications");
// bob.log.done();
//
// bob.log.step(`reject analytics toast`);
// await rejectToast(bob, "Help us improve Riot");
// bob.log.done();
bob.log.step(`reject desktop notifications toast`);
await rejectToast(bob, "Notifications");
bob.log.done();
while (true) {
try {
const h2Element = await bob.query('.mx_Toast_title h2');
const toastTitle = await bob.innerText(h2Element);
console.log("DEBUG closing", toastTitle);
const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
await toastDismissButton.click();
} catch (e) {
break;
}
}
bob.log.step(`reject analytics toast`);
await rejectToast(bob, "Help us improve Riot");
bob.log.done();
bob.log.step(`checks no remaining toasts`);
await assertNoToasts(bob);