Fix cypress test for events from unsigned devices (#11636)

This commit is contained in:
Richard van der Hoff 2023-09-21 11:54:23 +02:00 committed by GitHub
parent d77b871769
commit f60ba1c29d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -404,9 +404,9 @@ describe("Cryptography", function () {
cy.get(".mx_EventTile_last") cy.get(".mx_EventTile_last")
.should("contain", "test encrypted from unverified") .should("contain", "test encrypted from unverified")
.find(".mx_EventTile_e2eIcon", { timeout: 100000 }) .find(".mx_EventTile_e2eIcon")
.should("have.class", "mx_EventTile_e2eIcon_warning") .should("have.class", "mx_EventTile_e2eIcon_warning")
.should("have.attr", "aria-label", "Encrypted by an unverified user."); .should("have.attr", "aria-label", "Encrypted by a device not verified by its owner.");
/* Should show a grey padlock for a message from an unknown device */ /* Should show a grey padlock for a message from an unknown device */
@ -415,10 +415,12 @@ describe("Cryptography", function () {
.then(() => bobSecondDevice.logout(true)) .then(() => bobSecondDevice.logout(true))
.then(() => cy.log(`Bob logged out second device`)); .then(() => cy.log(`Bob logged out second device`));
// some debate over whether this should have a red or a grey shield. Legacy crypto shows a grey shield,
// Rust crypto a red one.
cy.get(".mx_EventTile_last") cy.get(".mx_EventTile_last")
.should("contain", "test encrypted from unverified") .should("contain", "test encrypted from unverified")
.find(".mx_EventTile_e2eIcon") .find(".mx_EventTile_e2eIcon")
.should("have.class", "mx_EventTile_e2eIcon_normal") //.should("have.class", "mx_EventTile_e2eIcon_normal")
.should("have.attr", "aria-label", "Encrypted by an unknown or deleted device."); .should("have.attr", "aria-label", "Encrypted by an unknown or deleted device.");
}); });
@ -437,7 +439,7 @@ describe("Cryptography", function () {
// no e2e icon // no e2e icon
.should("not.have.descendants", ".mx_EventTile_e2eIcon"); .should("not.have.descendants", ".mx_EventTile_e2eIcon");
/* log out, and back i */ /* log out, and back in */
logOutOfElement(); logOutOfElement();
cy.get<string>("@securityKey").then((securityKey) => { cy.get<string>("@securityKey").then((securityKey) => {
logIntoElement(homeserver.baseUrl, aliceCredentials.username, aliceCredentials.password, securityKey); logIntoElement(homeserver.baseUrl, aliceCredentials.username, aliceCredentials.password, securityKey);