Fix flaky test crypto/decryption-failure.spec.ts "Decryption Failure Bar" (#10092)

This commit is contained in:
Michael Weimann 2023-02-07 08:45:13 +01:00 committed by GitHub
parent 39fe72e53a
commit 885d5098ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -52,6 +52,8 @@ const handleVerificationRequest = (request: VerificationRequest): Chainable<Emoj
verifier.on("show_sas", onShowSas);
verifier.verify();
}),
// extra timeout, as this sometimes takes a while
{ timeout: 30_000 },
);
};
@ -111,9 +113,8 @@ describe("Decryption Failure Bar", () => {
})
.then(() => {
cy.botSendMessage(bot, roomId, "test");
cy.wait(5000);
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
"have.text",
cy.contains(
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
"Verify this device to access all messages",
);
@ -124,6 +125,7 @@ describe("Decryption Failure Bar", () => {
const verificationRequestPromise = waitForVerificationRequest(otherDevice);
cy.get(".mx_CompleteSecurity_actionRow .mx_AccessibleButton").click();
cy.contains("To proceed, please accept the verification request on your other device.");
cy.wrap(verificationRequestPromise).then((verificationRequest: VerificationRequest) => {
cy.wrap(verificationRequest.accept());
handleVerificationRequest(verificationRequest).then((emojis) => {
@ -170,9 +172,8 @@ describe("Decryption Failure Bar", () => {
);
cy.botSendMessage(bot, roomId, "test");
cy.wait(5000);
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
"have.text",
cy.contains(
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
"Reset your keys to prevent future decryption errors",
);

View File

@ -163,6 +163,8 @@ function setupBotClient(
}
})
.then(() => cli),
// extra timeout, as this sometimes takes a while
{ timeout: 30_000 },
);
});
}