Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 885d509

Browse files
authored
Fix flaky test crypto/decryption-failure.spec.ts "Decryption Failure Bar" (#10092)
1 parent 39fe72e commit 885d509

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cypress/e2e/crypto/decryption-failure.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const handleVerificationRequest = (request: VerificationRequest): Chainable<Emoj
5252
verifier.on("show_sas", onShowSas);
5353
verifier.verify();
5454
}),
55+
// extra timeout, as this sometimes takes a while
56+
{ timeout: 30_000 },
5557
);
5658
};
5759

@@ -111,9 +113,8 @@ describe("Decryption Failure Bar", () => {
111113
})
112114
.then(() => {
113115
cy.botSendMessage(bot, roomId, "test");
114-
cy.wait(5000);
115-
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
116-
"have.text",
116+
cy.contains(
117+
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
117118
"Verify this device to access all messages",
118119
);
119120

@@ -124,6 +125,7 @@ describe("Decryption Failure Bar", () => {
124125

125126
const verificationRequestPromise = waitForVerificationRequest(otherDevice);
126127
cy.get(".mx_CompleteSecurity_actionRow .mx_AccessibleButton").click();
128+
cy.contains("To proceed, please accept the verification request on your other device.");
127129
cy.wrap(verificationRequestPromise).then((verificationRequest: VerificationRequest) => {
128130
cy.wrap(verificationRequest.accept());
129131
handleVerificationRequest(verificationRequest).then((emojis) => {
@@ -170,9 +172,8 @@ describe("Decryption Failure Bar", () => {
170172
);
171173

172174
cy.botSendMessage(bot, roomId, "test");
173-
cy.wait(5000);
174-
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
175-
"have.text",
175+
cy.contains(
176+
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
176177
"Reset your keys to prevent future decryption errors",
177178
);
178179

cypress/support/bot.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ function setupBotClient(
163163
}
164164
})
165165
.then(() => cli),
166+
// extra timeout, as this sometimes takes a while
167+
{ timeout: 30_000 },
166168
);
167169
});
168170
}

0 commit comments

Comments
 (0)