Files
upstream-rocketchat/apps/meteor/tests/e2e/account-manage-devices.spec.ts
upstream-mirror 30810eecd7
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Failing after 2s
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:21:02 +05:00

67 lines
2.3 KiB
TypeScript

import type { Page } from 'playwright-core';
import { IS_EE } from './config/constants';
import { createAuxContext } from './fixtures/createAuxContext';
import injectInitialData from './fixtures/inject-initial-data';
import { Users } from './fixtures/userStates';
import { Login } from './page-objects';
import { AccountSectionsHref } from './page-objects/account';
import { AccountManageDevices } from './page-objects/account.manage-devices';
import { test, expect } from './utils/test';
test.describe('Account Manage Devices Page', () => {
test.skip(!IS_EE);
test.use({ storageState: Users.user1.state });
let page: Page;
let accountDevices: AccountManageDevices;
let poLogin: Login;
test.beforeEach(async ({ browser }) => {
({ page } = await createAuxContext(browser, Users.user1));
accountDevices = new AccountManageDevices(page);
poLogin = new Login(page);
await accountDevices.goto();
});
test.afterEach(async () => {
await page.close();
await injectInitialData();
});
test('should show Manage Devices page', async () => {
await expect(accountDevices.pageContent).toBeVisible();
});
test('should logout current device and redirect to login page', async () => {
await accountDevices.table.orderByLastLogin();
const deviceId = await accountDevices.getNthDeviceId(1);
await accountDevices.logoutDeviceById(deviceId);
await poLogin.waitForDisplay();
});
test('should logout other device successfully', async ({ browser }) => {
const context2 = await browser.newContext({ storageState: { cookies: [], origins: [] } });
const page2 = await context2.newPage();
const loginPage2 = new Login(page2);
const accountDevices2 = new AccountManageDevices(page2);
await test.step('should login same user in another session', async () => {
await loginPage2.goto(AccountSectionsHref.manageDevices);
await loginPage2.login('user1', 'password');
await expect(accountDevices2.pageContent).toBeVisible();
});
await test.step('should logout device 1 from session 2', async () => {
await accountDevices2.table.orderByLastLogin();
const device1Id = await accountDevices2.getNthDeviceId(2);
await accountDevices2.logoutDeviceById(device1Id);
await poLogin.waitForDisplay();
await expect(accountDevices2.table.getDeviceRowById(device1Id)).not.toBeVisible();
});
await context2.close();
});
});