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
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 2s
212 lines
7.0 KiB
TypeScript
212 lines
7.0 KiB
TypeScript
import { Users } from './fixtures/userStates';
|
|
import { HomeChannel } from './page-objects';
|
|
import { createTargetChannel } from './utils';
|
|
import { test, expect } from './utils/test';
|
|
|
|
test.use({ storageState: Users.user2.state });
|
|
|
|
test.describe.serial('permissions', () => {
|
|
let poHomeChannel: HomeChannel;
|
|
let targetChannel: string;
|
|
|
|
test.beforeAll(async ({ api }) => {
|
|
targetChannel = await createTargetChannel(api);
|
|
});
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
poHomeChannel = new HomeChannel(page);
|
|
|
|
await poHomeChannel.goto();
|
|
});
|
|
|
|
test.describe.serial('Edit message', () => {
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowEditing', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
|
|
test('expect option(edit) not be visible', async ({ page }) => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
|
|
await poHomeChannel.content.sendMessage('expect option(edit) not be visible');
|
|
|
|
await expect(page.locator('.rcx-message', { hasText: 'expect option(edit) not be visible' })).not.toHaveAttribute(
|
|
'aria-busy',
|
|
'true',
|
|
);
|
|
await poHomeChannel.content.openLastMessageMenu();
|
|
await expect(poHomeChannel.content.btnOptionEditMessage).toBeHidden();
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowEditing', { value: true })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
|
|
test.describe.serial('Delete message', () => {
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowDeleting', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
|
|
test('expect option(delete) not be visible', async ({ page }) => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
await poHomeChannel.content.sendMessage('expect option(delete) not be visible');
|
|
|
|
await expect(page.locator('.rcx-message', { hasText: 'expect option(delete) not be visible' })).not.toHaveAttribute(
|
|
'aria-busy',
|
|
'true',
|
|
);
|
|
|
|
await poHomeChannel.content.openLastMessageMenu();
|
|
|
|
await expect(poHomeChannel.content.btnOptionDeleteMessage).toBeHidden();
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowDeleting', { value: true })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
|
|
test.describe.serial('Pin message', () => {
|
|
test.use({ storageState: Users.admin.state });
|
|
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowPinning', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
|
|
test('expect option(pin) not be visible', async ({ page }) => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
await poHomeChannel.content.sendMessage('expect option(pin) not be visible');
|
|
|
|
await expect(page.locator('.rcx-message', { hasText: 'expect option(pin) not be visible' })).not.toHaveAttribute('aria-busy', 'true');
|
|
await poHomeChannel.content.openLastMessageMenu();
|
|
|
|
await expect(poHomeChannel.content.btnOptionPinMessage).toBeHidden();
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowPinning', { value: true })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
|
|
// FIXME: Wrong behavior in Rocket.chat, currently it shows the button
|
|
// and after a click a "not allowed" alert pops up
|
|
test.describe.skip('Star message', () => {
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowStarring', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
|
|
test('expect option(star) not be visible', async ({ page }) => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
await poHomeChannel.content.sendMessage('expect option(star) not be visible');
|
|
|
|
await expect(page.locator('.rcx-message', { hasText: 'expect option(star) not be visible' })).not.toHaveAttribute(
|
|
'aria-busy',
|
|
'true',
|
|
);
|
|
await poHomeChannel.content.openLastMessageMenu();
|
|
|
|
await expect(poHomeChannel.content.btnOptionStarMessage).toBeHidden();
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowStarring', { value: true })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
|
|
test.describe.serial('Upload file', () => {
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/FileUpload_Enabled', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
|
|
test('expect option (upload file) not be visible', async () => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
await expect(poHomeChannel.composer.btnOptionFileUpload).toBeDisabled();
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/FileUpload_Enabled', { value: true })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
|
|
test.describe.serial('Upload audio', () => {
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AudioRecorderEnabled', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
|
|
test('expect option (upload audio) not be visible', async () => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
await expect(poHomeChannel.composer.btnAudioMessage).toBeDisabled();
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AudioRecorderEnabled', { value: true })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
|
|
test.describe.serial('Upload video', () => {
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_VideoRecorderEnabled', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
|
|
test('expect option (upload video) not be visible', async () => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
await expect(poHomeChannel.composer.btnVideoMessage).toBeDisabled();
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_VideoRecorderEnabled', { value: true })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
|
|
test.describe.serial('Filter words', () => {
|
|
test.beforeAll(async ({ api }) => {
|
|
const statusCode1 = (await api.post('/settings/Message_AllowBadWordsFilter', { value: true })).status();
|
|
const statusCode2 = (await api.post('/settings/Message_BadWordsFilterList', { value: 'badword' })).status();
|
|
|
|
await expect(statusCode1).toBe(200);
|
|
await expect(statusCode2).toBe(200);
|
|
});
|
|
|
|
test('expect badword be censored', async () => {
|
|
await poHomeChannel.navbar.openChat(targetChannel);
|
|
await poHomeChannel.content.sendMessage('badword');
|
|
|
|
await expect(poHomeChannel.content.lastUserMessage).toContainText('*'.repeat(7));
|
|
});
|
|
|
|
test.afterAll(async ({ api }) => {
|
|
const statusCode = (await api.post('/settings/Message_AllowBadWordsFilter', { value: false })).status();
|
|
|
|
await expect(statusCode).toBe(200);
|
|
});
|
|
});
|
|
});
|