-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4dfdc95
commit d59ff4f
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
playwright/e2e/settings/encryption-user-tab/advanced.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright 2025 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial | ||
* Please see LICENSE files in the repository root for full details. | ||
*/ | ||
|
||
import { test, expect } from "./index"; | ||
import { checkDeviceIsCrossSigned } from "../../crypto/utils"; | ||
import { bootstrapCrossSigningForClient } from "../../../pages/client"; | ||
|
||
test.describe("Advanced section in Encryption tab", () => { | ||
test.beforeEach(async ({ page, app, homeserver, credentials, util }) => { | ||
const clientHandle = await app.client.prepareClient(); | ||
// Reset cross signing in order to have a verified session | ||
await bootstrapCrossSigningForClient(clientHandle, credentials, true); | ||
}); | ||
|
||
test("should show the encryption details", { tag: "@screenshot" }, async ({ page, app, util }) => { | ||
await util.openEncryptionTab(); | ||
const section = util.getEncryptionDetailsSection(); | ||
|
||
const deviceId = await page.evaluate(() => window.mxMatrixClientPeg.get().getDeviceId()); | ||
await expect(section.getByText(deviceId)).toBeVisible(); | ||
|
||
await expect(section).toMatchScreenshot("encryption-details.png", { | ||
mask: [section.getByTestId("deviceId"), section.getByTestId("sessionKey")], | ||
}); | ||
}); | ||
|
||
test("should show the import room keys dialog", async ({ page, app, util }) => { | ||
await util.openEncryptionTab(); | ||
const section = util.getEncryptionDetailsSection(); | ||
|
||
await section.getByRole("button", { name: "Import keys" }).click(); | ||
await expect(page.getByRole("heading", { name: "Import room keys" })).toBeVisible(); | ||
}); | ||
|
||
test("should show the export room keys dialog", async ({ page, app, util }) => { | ||
await util.openEncryptionTab(); | ||
const section = util.getEncryptionDetailsSection(); | ||
|
||
await section.getByRole("button", { name: "Export keys" }).click(); | ||
await expect(page.getByRole("heading", { name: "Export room keys" })).toBeVisible(); | ||
}); | ||
|
||
test( | ||
"should reset the cryptographic identity", | ||
{ tag: "@screenshot" }, | ||
async ({ page, app, credentials, util }) => { | ||
const tab = await util.openEncryptionTab(); | ||
const section = util.getEncryptionDetailsSection(); | ||
|
||
await section.getByRole("button", { name: "Reset cryptographic identity" }).click(); | ||
await expect(util.getEncryptionTabContent()).toMatchScreenshot("reset-cryptographic-identity.png"); | ||
await tab.getByRole("button", { name: "Continue" }).click(); | ||
|
||
// Fill password dialog and validate | ||
const dialog = page.locator(".mx_InteractiveAuthDialog"); | ||
await dialog.getByRole("textbox", { name: "Password" }).fill(credentials.password); | ||
await dialog.getByRole("button", { name: "Continue" }).click(); | ||
|
||
await expect(section.getByRole("button", { name: "Reset cryptographic identity" })).toBeVisible(); | ||
|
||
// After resetting the identity, the user should set up a new recovery key | ||
await expect( | ||
util.getEncryptionRecoverySection().getByRole("button", { name: "Set up recovery" }), | ||
).toBeVisible(); | ||
|
||
await checkDeviceIsCrossSigned(app); | ||
}, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+15 KB
...hots/settings/encryption-user-tab/advanced.spec.ts/encryption-details-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.9 KB
...ngs/encryption-user-tab/advanced.spec.ts/reset-cryptographic-identity-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.