Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Sessions to Devices throughout the app #12500

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions playwright/e2e/crypto/crypto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ test.describe("Cryptography", function () {
await rightPanel.getByText("Bob").click();
const sessionCountText = await rightPanel
.locator(".mx_UserInfo_devices")
.getByText(" session", { exact: false })
.getByText(" device", { exact: false })
.textContent();
// cf https://github.com/vector-im/element-web/issues/26279: Element-R uses the wrong text here
if (sessionCountText != "1 session" && sessionCountText != "1 verified session") {
if (sessionCountText != "1 device" && sessionCountText != "1 verified device") {
if (iterations >= 10) {
throw new Error(`Bob still has ${sessionCountText} after 10 iterations`);
}
Expand Down
2 changes: 1 addition & 1 deletion playwright/e2e/crypto/dehydration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ test.describe("Dehydration", () => {
// the dehydrated device gets created with the name "Dehydrated
// device". We want to make sure that it is not visible as a normal
// device.
const sessionsTab = await app.settings.openUserSettings("Sessions");
const sessionsTab = await app.settings.openUserSettings("Devices");
await expect(sessionsTab.getByText("Dehydrated device")).not.toBeVisible();

await app.settings.closeDialog();
Expand Down
2 changes: 1 addition & 1 deletion playwright/e2e/crypto/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export async function logOutOfElement(page: Page, discardKeys: boolean = false)
*/
export async function verifySession(app: ElementAppPage, securityKey: string) {
const settings = await app.settings.openUserSettings("Security & Privacy");
await settings.getByRole("button", { name: "Verify this session" }).click();
await settings.getByRole("button", { name: "Verify this device" }).click();
await app.page.getByRole("button", { name: "Verify with Security Key" }).click();
await app.page.locator(".mx_Dialog").locator('input[type="password"]').fill(securityKey);
await app.page.getByRole("button", { name: "Continue", disabled: false }).click();
Expand Down
2 changes: 1 addition & 1 deletion playwright/e2e/register/register.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test.describe("Registration", () => {
// check that the device considers itself verified
await page.getByRole("button", { name: "User menu", exact: true }).click();
await page.getByRole("menuitem", { name: "All settings", exact: true }).click();
await page.getByRole("tab", { name: "Sessions", exact: true }).click();
await page.getByRole("tab", { name: "Devices", exact: true }).click();
await expect(page.getByTestId("current-session-section").getByTestId("device-metadata-isVerified")).toHaveText(
"Verified",
);
Expand Down
22 changes: 11 additions & 11 deletions playwright/e2e/settings/device-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ test.describe("Device manager", () => {
});

test("should display sessions", async ({ page, app }) => {
await app.settings.openUserSettings("Sessions");
await app.settings.openUserSettings("Devices");
const tab = page.locator(".mx_SettingsTab");

await expect(tab.getByText("Current session", { exact: true })).toBeVisible();
await expect(tab.getByText("Current device", { exact: true })).toBeVisible();

const currentSessionSection = tab.getByTestId("current-session-section");
await expect(currentSessionSection.getByText("Unverified session")).toBeVisible();
await expect(currentSessionSection.getByText("Unverified device")).toBeVisible();

// current session details opened
await currentSessionSection.getByRole("button", { name: "Show details" }).click();
await expect(currentSessionSection.getByText("Session details")).toBeVisible();
await expect(currentSessionSection.getByText("Device details")).toBeVisible();

// close current session details
await currentSessionSection.getByRole("button", { name: "Hide details" }).click();
await expect(currentSessionSection.getByText("Session details")).not.toBeVisible();
await expect(currentSessionSection.getByText("Device details")).not.toBeVisible();

const securityRecommendationsSection = tab.getByTestId("security-recommendations-section");
await expect(securityRecommendationsSection.getByText("Security recommendations")).toBeVisible();
Expand All @@ -52,9 +52,9 @@ test.describe("Device manager", () => {
/**
* Other sessions section
*/
await expect(tab.getByText("Other sessions")).toBeVisible();
await expect(tab.getByText("Other Devices")).toBeVisible();
// filter applied after clicking through from security recommendations
await expect(tab.getByLabel("Filter devices")).toHaveText("Show: Unverified");
await expect(tab.getByLabel("Filter Devices")).toHaveText("Show: Unverified");
const filteredDeviceListItems = tab.locator(".mx_FilteredDeviceList_listItem");
await expect(filteredDeviceListItems).toHaveCount(3);

Expand All @@ -72,12 +72,12 @@ test.describe("Device manager", () => {
// security recommendation count updated
await expect(tab.getByRole("button", { name: "View all (1)" })).toBeVisible();

const sessionName = `Alice's device`;
const sessionName = `Alice's Device`;
// open the first session
const firstSession = filteredDeviceListItems.first();
await firstSession.getByRole("button", { name: "Show details" }).click();

await expect(firstSession.getByText("Session details")).toBeVisible();
await expect(firstSession.getByText("Device details")).toBeVisible();

await firstSession.getByRole("button", { name: "Rename" }).click();
await firstSession.getByTestId("device-rename-input").type(sessionName);
Expand All @@ -93,13 +93,13 @@ test.describe("Device manager", () => {
await expect(firstSession.locator(".mx_DeviceTile h4").getByText(sessionName)).toBeVisible();

// sign out using the device details sign out
await firstSession.getByRole("button", { name: "Sign out of this session" }).click();
await firstSession.getByRole("button", { name: "Sign out of this Device" }).click();

// confirm the signout
await page.getByRole("dialog").getByTestId("dialog-primary-button").click();

// no other sessions or security recommendations sections when only one session
await expect(tab.getByText("Other sessions")).not.toBeVisible();
await expect(tab.getByText("Other devices")).not.toBeVisible();
await expect(tab.getByTestId("security-recommendations-section")).not.toBeVisible();
});
});
2 changes: 1 addition & 1 deletion playwright/e2e/user-view/user-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test.describe("UserView", () => {

const rightPanel = page.locator("#mx_RightPanel");
await expect(rightPanel.getByRole("heading", { name: bot.credentials.displayName, exact: true })).toBeVisible();
await expect(rightPanel.getByText("1 session")).toBeVisible();
await expect(rightPanel.getByText("1 device")).toBeVisible();
await expect(rightPanel).toMatchScreenshot("user-info.png", {
mask: [page.locator(".mx_UserInfo_profile_mxid")],
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading