Cypress: Run setting up secure key backup should work
test for both verified and unverified devices (#11119)
* Add `cypress-each` dev dependencies * Run `setting up secure key backup should work` test for both verified and unverified device.
This commit is contained in:
parent
8aa46b3005
commit
b84a230d58
4 changed files with 102 additions and 76 deletions
|
@ -174,7 +174,9 @@ describe("Cryptography", function () {
|
||||||
cy.stopHomeserver(this.homeserver);
|
cy.stopHomeserver(this.homeserver);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("setting up secure key backup should work", () => {
|
describe.each([{ isDeviceVerified: true }, { isDeviceVerified: false }])(
|
||||||
|
"setting up secure key backup should work %j",
|
||||||
|
({ isDeviceVerified }) => {
|
||||||
/**
|
/**
|
||||||
* Verify that the `m.cross_signing.${keyType}` key is available on the account data on the server
|
* Verify that the `m.cross_signing.${keyType}` key is available on the account data on the server
|
||||||
* @param keyType
|
* @param keyType
|
||||||
|
@ -204,6 +206,12 @@ describe("Cryptography", function () {
|
||||||
|
|
||||||
it("by recovery code", () => {
|
it("by recovery code", () => {
|
||||||
skipIfRustCrypto();
|
skipIfRustCrypto();
|
||||||
|
|
||||||
|
// Verified the device
|
||||||
|
if (isDeviceVerified) {
|
||||||
|
cy.bootstrapCrossSigning(aliceCredentials);
|
||||||
|
}
|
||||||
|
|
||||||
cy.openUserSettings("Security & Privacy");
|
cy.openUserSettings("Security & Privacy");
|
||||||
cy.findByRole("button", { name: "Set up Secure Backup" }).click();
|
cy.findByRole("button", { name: "Set up Secure Backup" }).click();
|
||||||
cy.get(".mx_Dialog").within(() => {
|
cy.get(".mx_Dialog").within(() => {
|
||||||
|
@ -213,12 +221,15 @@ describe("Cryptography", function () {
|
||||||
|
|
||||||
downloadKey();
|
downloadKey();
|
||||||
|
|
||||||
|
// When the device is verified, the `Setting up keys` step is skipped
|
||||||
|
if (!isDeviceVerified) {
|
||||||
cy.get(".mx_InteractiveAuthDialog").within(() => {
|
cy.get(".mx_InteractiveAuthDialog").within(() => {
|
||||||
cy.get(".mx_Dialog_title").within(() => {
|
cy.get(".mx_Dialog_title").within(() => {
|
||||||
cy.findByText("Setting up keys").should("exist");
|
cy.findByText("Setting up keys").should("exist");
|
||||||
cy.findByText("Setting up keys").should("not.exist");
|
cy.findByText("Setting up keys").should("not.exist");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
cy.findByText("Secure Backup successful").should("exist");
|
cy.findByText("Secure Backup successful").should("exist");
|
||||||
cy.findByRole("button", { name: "Done" }).click();
|
cy.findByRole("button", { name: "Done" }).click();
|
||||||
|
@ -233,6 +244,12 @@ describe("Cryptography", function () {
|
||||||
|
|
||||||
it("by passphrase", () => {
|
it("by passphrase", () => {
|
||||||
skipIfRustCrypto();
|
skipIfRustCrypto();
|
||||||
|
|
||||||
|
// Verified the device
|
||||||
|
if (isDeviceVerified) {
|
||||||
|
cy.bootstrapCrossSigning(aliceCredentials);
|
||||||
|
}
|
||||||
|
|
||||||
cy.openUserSettings("Security & Privacy");
|
cy.openUserSettings("Security & Privacy");
|
||||||
cy.findByRole("button", { name: "Set up Secure Backup" }).click();
|
cy.findByRole("button", { name: "Set up Secure Backup" }).click();
|
||||||
cy.get(".mx_Dialog").within(() => {
|
cy.get(".mx_Dialog").within(() => {
|
||||||
|
@ -259,7 +276,8 @@ describe("Cryptography", function () {
|
||||||
verifyKey("self_signing");
|
verifyKey("self_signing");
|
||||||
verifyKey("user_signing");
|
verifyKey("user_signing");
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
it("creating a DM should work, being e2e-encrypted / user verification", function (this: CryptoTestContext) {
|
it("creating a DM should work, being e2e-encrypted / user verification", function (this: CryptoTestContext) {
|
||||||
skipIfRustCrypto();
|
skipIfRustCrypto();
|
||||||
|
|
|
@ -16,6 +16,8 @@ limitations under the License.
|
||||||
|
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
|
import "cypress-each";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||||
namespace Cypress {
|
namespace Cypress {
|
||||||
|
|
|
@ -181,6 +181,7 @@
|
||||||
"chokidar": "^3.5.1",
|
"chokidar": "^3.5.1",
|
||||||
"cypress": "^12.0.0",
|
"cypress": "^12.0.0",
|
||||||
"cypress-axe": "^1.0.0",
|
"cypress-axe": "^1.0.0",
|
||||||
|
"cypress-each": "^1.13.3",
|
||||||
"cypress-multi-reporters": "^1.6.1",
|
"cypress-multi-reporters": "^1.6.1",
|
||||||
"cypress-real-events": "^1.7.1",
|
"cypress-real-events": "^1.7.1",
|
||||||
"eslint": "8.42.0",
|
"eslint": "8.42.0",
|
||||||
|
|
|
@ -3638,6 +3638,11 @@ cypress-axe@^1.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/cypress-axe/-/cypress-axe-1.4.0.tgz#e67482bfe9e740796bf77c7823f19781a8a2faff"
|
resolved "https://registry.yarnpkg.com/cypress-axe/-/cypress-axe-1.4.0.tgz#e67482bfe9e740796bf77c7823f19781a8a2faff"
|
||||||
integrity sha512-Ut7NKfzjyKm0BEbt2WxuKtLkIXmx6FD2j0RwdvO/Ykl7GmB/qRQkwbKLk3VP35+83hiIr8GKD04PDdrTK5BnyA==
|
integrity sha512-Ut7NKfzjyKm0BEbt2WxuKtLkIXmx6FD2j0RwdvO/Ykl7GmB/qRQkwbKLk3VP35+83hiIr8GKD04PDdrTK5BnyA==
|
||||||
|
|
||||||
|
cypress-each@^1.13.3:
|
||||||
|
version "1.13.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/cypress-each/-/cypress-each-1.13.3.tgz#c0f59628975164e23a3fd10090b587a66ed9438e"
|
||||||
|
integrity sha512-aNFoDuybFAQ7OObbeO5yxBGmXkGKVAcT1wLHLiL3+HQi+g+q3vECbn4J9cYOXJ7yYfbcBLh8dgQd/IG3Ls2z7A==
|
||||||
|
|
||||||
cypress-multi-reporters@^1.6.1:
|
cypress-multi-reporters@^1.6.1:
|
||||||
version "1.6.3"
|
version "1.6.3"
|
||||||
resolved "https://registry.yarnpkg.com/cypress-multi-reporters/-/cypress-multi-reporters-1.6.3.tgz#0f0da8db4caf8d7a21f94e5209148348416d7c71"
|
resolved "https://registry.yarnpkg.com/cypress-multi-reporters/-/cypress-multi-reporters-1.6.3.tgz#0f0da8db4caf8d7a21f94e5209148348416d7c71"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue