The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/e2e/file-upload.spec.ts

44 lines
1.5 KiB

import { Users } from './fixtures/userStates';
import { HomeChannel } from './page-objects';
import { createTargetChannel } from './utils';
import { expect, test } from './utils/test';
test.use({ storageState: Users.user1.state });
test.describe.serial('file-upload', () => {
let poHomeChannel: HomeChannel;
let targetChannel: string;
test.beforeAll(async ({ api }) => {
targetChannel = await createTargetChannel(api);
});
test.beforeEach(async ({ page }) => {
poHomeChannel = new HomeChannel(page);
await page.goto('/home');
await poHomeChannel.sidenav.openChat(targetChannel);
});
test('expect successfully cancel upload', async () => {
await poHomeChannel.content.dragAndDropFile();
await poHomeChannel.content.btnModalCancel.click();
await expect(poHomeChannel.content.modalFilePreview).not.toBeVisible();
});
test('expect send file not show modal', async () => {
await poHomeChannel.content.dragAndDropFile();
await poHomeChannel.content.btnModalConfirm.click();
await expect(poHomeChannel.content.modalFilePreview).not.toBeVisible();
});
test('expect send file with name/description updated', async () => {
await poHomeChannel.content.dragAndDropFile();
await poHomeChannel.content.descriptionInput.fill('any_description');
await poHomeChannel.content.fileNameInput.fill('any_file1.txt');
await poHomeChannel.content.btnModalConfirm.click();
await expect(poHomeChannel.content.getFileDescription).toHaveText('any_description');
await expect(poHomeChannel.content.lastMessageFileName).toContainText('any_file1.txt');
});
});