1
0
Fork 0

DEV: Add waiting for inserted element to disappear

Dieser Commit ist enthalten in:
jumagura 2023-05-11 04:57:36 -04:00
Ursprung 69dc96562d
Commit 537ffeb883

Datei anzeigen

@ -34,7 +34,6 @@ acceptance("Admin | Manager", function (needs) {
}); });
}); });
async function waitForDestructionAndResetMessage() { async function waitForDestructionAndResetMessage() {
// Wait for the "Destruction complete" message to appear
await waitUntil( await waitUntil(
() => () =>
document.querySelector(".message-content")?.innerText === document.querySelector(".message-content")?.innerText ===
@ -42,11 +41,11 @@ acceptance("Admin | Manager", function (needs) {
{ timeout: 5000 } { timeout: 5000 }
); );
// Wait for the message to change back to the original text
await waitUntil( await waitUntil(
() => () =>
document.querySelector(".message-content")?.innerText === document.querySelector(".message-content")?.innerText ===
"Export, import or destroy wizards", "Export, import or destroy wizards" &&
!document.querySelector(".message-content")?.nextElementSibling,
{ timeout: 15000 } { timeout: 15000 }
); );
} }
@ -96,10 +95,10 @@ acceptance("Admin | Manager", function (needs) {
"the destroy button is enabled when destroy checkbox is clicked" "the destroy button is enabled when destroy checkbox is clicked"
); );
await click("#destroy-button"); await click("#destroy-button");
await waitForDestructionAndResetMessage();
assert.notOk( assert.notOk(
find('table tr[data-wizard-id="this-is-testing-wizard"]'), find('table tr[data-wizard-id="this-is-testing-wizard"]'),
"the wizard row is removed after destroy button is clicked" "the wizard row is removed after destroy button is clicked"
); );
await waitForDestructionAndResetMessage();
}); });
}); });