Edit file attachment e2e tests (#29797)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
528026d6fb
Коммит
f9cff5c8d6
@@ -0,0 +1,351 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {test} from '@e2e-support/test_fixture';
|
||||
import {expect} from '@playwright/test';
|
||||
import {duration, wait} from '@e2e-support/util';
|
||||
import {moveMouseToCenter} from '@e2e-support/test_action';
|
||||
|
||||
test('MM-T5654_1 should be able to add attachments while editing a post', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
|
||||
// open the dot menu
|
||||
await post.postMenu.dotMenuButton.click();
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.writeMessage('Edited message');
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
const updatedPost = await channelsPage.centerView.getLastPost();
|
||||
await updatedPost.toBeVisible();
|
||||
await updatedPost.toContainText('Edited message');
|
||||
});
|
||||
|
||||
test('MM-T5654_2 should be able to add attachments while editing a threaded post', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage, page} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
|
||||
// open the dot menu
|
||||
await post.postMenu.dotMenuButton.click();
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.replyMenuItem.click();
|
||||
await channelsPage.sidebarRight.toBeVisible();
|
||||
await channelsPage.sidebarRight.postCreate.toBeVisible();
|
||||
await channelsPage.sidebarRight.postCreate.postMessage('Replying to the post');
|
||||
await channelsPage.sidebarRight.toContainText('Replying to the post');
|
||||
|
||||
const replyPost = await channelsPage.sidebarRight.getLastPost();
|
||||
await replyPost.toBeVisible();
|
||||
await replyPost.hover();
|
||||
await replyPost.postMenu.toBeVisible();
|
||||
await replyPost.postMenu.dotMenuButton.click();
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.sidebarRight.postEdit.toBeVisible();
|
||||
await channelsPage.sidebarRight.postEdit.writeMessage('Edited reply message');
|
||||
await channelsPage.sidebarRight.postEdit.sendMessage();
|
||||
|
||||
let updatedReplyPost = await channelsPage.sidebarRight.getLastPost();
|
||||
await updatedReplyPost.toBeVisible();
|
||||
await updatedReplyPost.toContainText('Edited reply message');
|
||||
|
||||
// now we'll edit the reply post and files to it
|
||||
await updatedReplyPost.hover();
|
||||
await updatedReplyPost.postMenu.toBeVisible();
|
||||
await updatedReplyPost.postMenu.dotMenuButton.click();
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.sidebarRight.postEdit.toBeVisible();
|
||||
await channelsPage.sidebarRight.postEdit.writeMessage('Edited reply message with files');
|
||||
await channelsPage.sidebarRight.postEdit.addFiles(['sample_text_file.txt', 'mattermost.png']);
|
||||
await wait(duration.half_sec);
|
||||
await channelsPage.sidebarRight.postEdit.sendMessage();
|
||||
await wait(duration.half_sec);
|
||||
await channelsPage.sidebarRight.postEdit.toNotBeVisible();
|
||||
await updatedReplyPost.toBeVisible();
|
||||
await updatedReplyPost.toContainText('Edited reply message with files');
|
||||
await updatedReplyPost.toContainText('sample_text_file.txt');
|
||||
await updatedReplyPost.toContainText('mattermost.png');
|
||||
|
||||
// now we'll remove the files
|
||||
await updatedReplyPost.hover();
|
||||
await updatedReplyPost.postMenu.toBeVisible();
|
||||
await updatedReplyPost.postMenu.clickOnDotMenu();
|
||||
await moveMouseToCenter(page);
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.sidebarRight.postEdit.toBeVisible();
|
||||
await channelsPage.sidebarRight.postEdit.removeFile('sample_text_file.txt');
|
||||
await wait(duration.half_sec);
|
||||
await channelsPage.sidebarRight.postEdit.removeFile('mattermost.png');
|
||||
await wait(duration.half_sec);
|
||||
await channelsPage.sidebarRight.postEdit.sendMessage();
|
||||
|
||||
updatedReplyPost = await channelsPage.sidebarRight.getLastPost();
|
||||
await updatedReplyPost.toBeVisible();
|
||||
await updatedReplyPost.toContainText('Edited reply message with files');
|
||||
expect(updatedReplyPost).not.toContain('sample_text_file.txt');
|
||||
expect(updatedReplyPost).not.toContain('mattermost.png');
|
||||
});
|
||||
|
||||
test('MM-T5654_3 should be able to edit post message originally containing files', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage, ['sample_text_file.txt']);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
|
||||
// open the dot menu
|
||||
await post.postMenu.dotMenuButton.click();
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.writeMessage('Edited message');
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
const updatedPost = await channelsPage.centerView.getLastPost();
|
||||
await updatedPost.toBeVisible();
|
||||
await updatedPost.toContainText('Edited message');
|
||||
});
|
||||
|
||||
test('MM-T5654_4 should be able to add files when editing a post', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
|
||||
// open the dot menu
|
||||
await post.postMenu.dotMenuButton.click();
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.writeMessage('Edited message');
|
||||
await channelsPage.centerView.postEdit.addFiles(['sample_text_file.txt']);
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
const updatedPost = await channelsPage.centerView.getLastPost();
|
||||
await updatedPost.toBeVisible();
|
||||
await updatedPost.toContainText('Edited message');
|
||||
await updatedPost.toContainText('sample_text_file.txt');
|
||||
|
||||
// now we'll add multiple files
|
||||
await post.postMenu.dotMenuButton.click();
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.addFiles(['mattermost.png', 'archive.zip']);
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
const secondUpdatedPost = await channelsPage.centerView.getLastPost();
|
||||
await secondUpdatedPost.toBeVisible();
|
||||
await secondUpdatedPost.toContainText('Edited message');
|
||||
await secondUpdatedPost.toContainText('sample_text_file.txt');
|
||||
await secondUpdatedPost.toContainText('mattermost.png');
|
||||
await secondUpdatedPost.toContainText('archive.zip');
|
||||
});
|
||||
|
||||
test('MM-5654_5 should be able to remove attachments while editing a post', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage, page} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage, [
|
||||
'sample_text_file.txt',
|
||||
'mattermost.png',
|
||||
'archive.zip',
|
||||
]);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.toContainText(originalMessage);
|
||||
await post.toContainText('sample_text_file.txt');
|
||||
await post.toContainText('mattermost.png');
|
||||
await post.toContainText('archive.zip');
|
||||
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
await post.postMenu.clickOnDotMenu();
|
||||
await moveMouseToCenter(page);
|
||||
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.removeFile('sample_text_file.txt');
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
const updatedPost = await channelsPage.centerView.getLastPost();
|
||||
await updatedPost.toBeVisible();
|
||||
await updatedPost.toContainText(originalMessage);
|
||||
await updatedPost.toContainText('mattermost.png');
|
||||
await updatedPost.toContainText('archive.zip');
|
||||
expect(updatedPost).not.toContain('archive.zip');
|
||||
});
|
||||
|
||||
test('MM-T5655_1 removing message content and files should delete the post', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage, ['sample_text_file.txt']);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.toContainText(originalMessage);
|
||||
await post.toContainText('sample_text_file.txt');
|
||||
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
await post.postMenu.dotMenuButton.click();
|
||||
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.removeFile('sample_text_file.txt');
|
||||
await channelsPage.centerView.postEdit.writeMessage('');
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
await channelsPage.centerView.postEdit.deleteConfirmationDialog.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.deleteConfirmationDialog.confirmDeletion();
|
||||
await channelsPage.centerView.postEdit.deleteConfirmationDialog.notToBeVisible();
|
||||
|
||||
expect(channelsPage).not.toContain(originalMessage);
|
||||
expect(channelsPage).not.toContain('sample_text_file.txt');
|
||||
});
|
||||
|
||||
test('MM-T5655_2 should be able to remove all files when editing a post', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage, page} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage, [
|
||||
'sample_text_file.txt',
|
||||
'mattermost.png',
|
||||
'archive.zip',
|
||||
]);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.toContainText(originalMessage);
|
||||
await post.toContainText('sample_text_file.txt');
|
||||
await post.toContainText('mattermost.png');
|
||||
await post.toContainText('archive.zip');
|
||||
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
await post.postMenu.clickOnDotMenu();
|
||||
await moveMouseToCenter(page);
|
||||
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.removeFile('sample_text_file.txt');
|
||||
await channelsPage.centerView.postEdit.removeFile('mattermost.png');
|
||||
await channelsPage.centerView.postEdit.removeFile('archive.zip');
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
const updatedPost = await channelsPage.centerView.getLastPost();
|
||||
await updatedPost.toBeVisible();
|
||||
await updatedPost.toContainText(originalMessage);
|
||||
expect(updatedPost).not.toContain('archive.zip');
|
||||
expect(updatedPost).not.toContain('mattermost.png');
|
||||
expect(updatedPost).not.toContain('sample_text_file.txt');
|
||||
});
|
||||
|
||||
test('MM-T5656_1 should be able to restore previously edited post version that contains attachments', async ({pw}) => {
|
||||
const originalMessage = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
|
||||
const newMessage = 'New Message';
|
||||
|
||||
const {user} = await pw.initSetup();
|
||||
const {channelsPage} = await pw.testBrowser.login(user);
|
||||
|
||||
await channelsPage.goto();
|
||||
await channelsPage.toBeVisible();
|
||||
await channelsPage.centerView.postCreate.postMessage(originalMessage, ['sample_text_file.txt']);
|
||||
|
||||
const post = await channelsPage.centerView.getLastPost();
|
||||
await post.toBeVisible();
|
||||
await post.toContainText(originalMessage);
|
||||
await post.toContainText('sample_text_file.txt');
|
||||
|
||||
await post.hover();
|
||||
await post.postMenu.toBeVisible();
|
||||
await post.postMenu.dotMenuButton.click();
|
||||
|
||||
await channelsPage.postDotMenu.toBeVisible();
|
||||
await channelsPage.postDotMenu.editMenuItem.click();
|
||||
await channelsPage.centerView.postEdit.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.removeFile('sample_text_file.txt');
|
||||
await channelsPage.centerView.postEdit.writeMessage(newMessage);
|
||||
await channelsPage.centerView.postEdit.sendMessage();
|
||||
|
||||
const updatedPost = await channelsPage.centerView.getLastPost();
|
||||
await updatedPost.toBeVisible();
|
||||
await updatedPost.toContainText(newMessage);
|
||||
expect(updatedPost).not.toContain('sample_text_file.txt');
|
||||
|
||||
const postID = await channelsPage.centerView.getLastPostID();
|
||||
await channelsPage.centerView.clickOnLastEditedPost(postID);
|
||||
|
||||
await channelsPage.sidebarRight.toBeVisible();
|
||||
await channelsPage.sidebarRight.verifyCurrentVersionPostMessage(postID, newMessage);
|
||||
|
||||
await channelsPage.sidebarRight.restorePreviousPostVersion();
|
||||
|
||||
await channelsPage.centerView.postEdit.restorePostConfirmationDialog.toBeVisible();
|
||||
await channelsPage.centerView.postEdit.restorePostConfirmationDialog.confirmRestore();
|
||||
await channelsPage.centerView.postEdit.restorePostConfirmationDialog.notToBeVisible();
|
||||
|
||||
const restoredPost = await channelsPage.centerView.getLastPost();
|
||||
await restoredPost.toBeVisible();
|
||||
expect(restoredPost.toContainText('sample_text_file.txt'));
|
||||
});
|
||||
@@ -1,16 +1,19 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {expect, Page} from '@playwright/test';
|
||||
import {test} from '@e2e-support/test_fixture';
|
||||
import {ChannelsPage, ScheduledDraftPage} from '@e2e-support/ui/pages';
|
||||
import {duration, wait} from '@e2e-support/util';
|
||||
|
||||
test.fixme('MM-T5643_1 should create a scheduled message from a channel', async ({pw}) => {
|
||||
test.setTimeout(120000);
|
||||
test('MM-T5643_1 should create a scheduled message from a channel', async ({pw}) => {
|
||||
test.setTimeout(duration.four_min);
|
||||
|
||||
const draftMessage = 'Scheduled Draft';
|
||||
// # Skip test if no license
|
||||
await pw.skipIfNoLicense();
|
||||
|
||||
const {user, team} = await pw.initSetup();
|
||||
const {user} = await pw.initSetup();
|
||||
const {page, channelsPage, scheduledDraftPage} = await pw.testBrowser.login(user);
|
||||
|
||||
await setupChannelPage(channelsPage, draftMessage);
|
||||
@@ -32,21 +35,18 @@ test.fixme('MM-T5643_1 should create a scheduled message from a channel', async
|
||||
await expect(channelsPage.centerView.scheduledDraftChannelInfoMessage).not.toBeVisible();
|
||||
await expect(channelsPage.sidebarLeft.scheduledDraftCountonLHS).not.toBeVisible();
|
||||
await expect(await channelsPage.getLastPost()).toHaveText(draftMessage);
|
||||
|
||||
await verifyNoscheduledDraftsPending(channelsPage, team, scheduledDraftPage, draftMessage);
|
||||
await channelsPage.sidebarLeft.assertNoPendingScheduledDraft();
|
||||
});
|
||||
|
||||
test.fixme('MM-T5643_6 should create a scheduled message under a thread post ', async ({pw}) => {
|
||||
test.setTimeout(120000);
|
||||
|
||||
test('MM-T5643_6 should create a scheduled message under a thread post ', async ({pw}) => {
|
||||
const draftMessage = 'Scheduled Threaded Message';
|
||||
// # Skip test if no license
|
||||
await pw.skipIfNoLicense();
|
||||
|
||||
const {user, team} = await pw.initSetup();
|
||||
const {user} = await pw.initSetup();
|
||||
|
||||
// # Log in as a user in new browser context
|
||||
const {page, channelsPage, scheduledDraftPage} = await pw.testBrowser.login(user);
|
||||
const {channelsPage, scheduledDraftPage} = await pw.testBrowser.login(user);
|
||||
|
||||
// # Visit default channel page
|
||||
await channelsPage.goto();
|
||||
@@ -94,22 +94,17 @@ test.fixme('MM-T5643_6 should create a scheduled message under a thread post ',
|
||||
// # Hover and verify options
|
||||
await scheduledDraftPage.verifyOnHoverActionItems(draftMessage);
|
||||
|
||||
await goBackToChannelAndWaitForMessageToArrive(page);
|
||||
await scheduledDraftPage.sendScheduledMessage(draftMessage);
|
||||
|
||||
await replyToLastPost(post);
|
||||
await sidebarRight.toBeVisible();
|
||||
(await sidebarRight.getLastPost()).toContainText(draftMessage);
|
||||
|
||||
// * Verify the message has been sent and there's no more scheduled messages
|
||||
await expect(channelsPage.sidebarRight.scheduledDraftChannelInfoMessage).not.toBeVisible();
|
||||
await expect(channelsPage.sidebarLeft.scheduledDraftCountonLHS).not.toBeVisible();
|
||||
|
||||
const lastPost = channelsPage.sidebarRight.rhsPostBody.last();
|
||||
await expect(lastPost).toHaveText(draftMessage);
|
||||
await expect(scheduledDraftPage.scheduledDraftPanel(draftMessage)).not.toBeVisible();
|
||||
|
||||
await verifyNoscheduledDraftsPending(channelsPage, team, scheduledDraftPage, draftMessage);
|
||||
await channelsPage.sidebarLeft.assertNoPendingScheduledDraft();
|
||||
});
|
||||
|
||||
test.fixme('MM-T5644 should reschedule a scheduled message', async ({pw}) => {
|
||||
test('MM-T5644 should reschedule a scheduled message', async ({pw}) => {
|
||||
const draftMessage = 'Scheduled Draft';
|
||||
await pw.skipIfNoLicense();
|
||||
|
||||
@@ -141,7 +136,7 @@ test.fixme('MM-T5644 should reschedule a scheduled message', async ({pw}) => {
|
||||
await compareMessageTimestamps(rescheduledDraftChannelInfo, scheduledDraftPageInfo, scheduledDraftPage);
|
||||
});
|
||||
|
||||
test.fixme('MM-T5645 should delete a scheduled message', async ({pw}) => {
|
||||
test('MM-T5645 should delete a scheduled message', async ({pw}) => {
|
||||
const draftMessage = 'Scheduled Draft';
|
||||
await pw.skipIfNoLicense();
|
||||
|
||||
@@ -160,7 +155,7 @@ test.fixme('MM-T5645 should delete a scheduled message', async ({pw}) => {
|
||||
await expect(scheduledDraftPage.noscheduledDraftIcon).toBeVisible();
|
||||
});
|
||||
|
||||
test.fixme('MM-T5643_9 should send a scheduled message immediately', async ({pw}) => {
|
||||
test('MM-T5643_9 should send a scheduled message immediately', async ({pw}) => {
|
||||
const draftMessage = 'Scheduled Draft';
|
||||
await pw.skipIfNoLicense();
|
||||
|
||||
@@ -174,6 +169,7 @@ test.fixme('MM-T5643_9 should send a scheduled message immediately', async ({pw}
|
||||
await verifyScheduledDraft(channelsPage, scheduledDraftPage, draftMessage, postBoxIndicator);
|
||||
|
||||
await scheduledDraftPage.sendScheduledMessage(draftMessage);
|
||||
await wait(duration.two_sec);
|
||||
|
||||
await expect(scheduledDraftPage.scheduledDraftPanel(draftMessage)).not.toBeVisible();
|
||||
|
||||
@@ -183,9 +179,7 @@ test.fixme('MM-T5643_9 should send a scheduled message immediately', async ({pw}
|
||||
await expect(await channelsPage.getLastPost()).toHaveText(draftMessage);
|
||||
});
|
||||
|
||||
test.fixme('MM-T5643_3 should create a scheduled message from a DM', async ({pw}) => {
|
||||
test.setTimeout(120000);
|
||||
|
||||
test('MM-T5643_3 should create a scheduled message from a DM', async ({pw}) => {
|
||||
const draftMessage = 'Scheduled Draft';
|
||||
// # Skip test if no license
|
||||
await pw.skipIfNoLicense();
|
||||
@@ -207,20 +201,18 @@ test.fixme('MM-T5643_3 should create a scheduled message from a DM', async ({pw}
|
||||
// # Hover and verify options
|
||||
await scheduledDraftPage.verifyOnHoverActionItems(draftMessage);
|
||||
|
||||
// # Go back and wait for message to arrive
|
||||
await goBackToChannelAndWaitForMessageToArrive(page);
|
||||
await scheduledDraftPage.sendScheduledMessage(draftMessage);
|
||||
await page.waitForSelector(channelsPage.centerView.scheduledDraftChannelInfoMessageLocator, {state: 'hidden'});
|
||||
|
||||
// * Verify the message has been sent and there's no more scheduled messages
|
||||
await expect(channelsPage.centerView.scheduledDraftChannelInfoMessage).not.toBeVisible();
|
||||
await expect(channelsPage.sidebarLeft.scheduledDraftCountonLHS).not.toBeVisible();
|
||||
await expect(await channelsPage.getLastPost()).toHaveText(draftMessage);
|
||||
|
||||
await verifyNoscheduledDraftsPending(channelsPage, team, scheduledDraftPage, draftMessage);
|
||||
await channelsPage.sidebarLeft.assertNoPendingScheduledDraft();
|
||||
});
|
||||
|
||||
test('MM-T5648 should create a draft and then schedule it', async ({pw}) => {
|
||||
test.setTimeout(120000);
|
||||
|
||||
const draftMessage = 'Draft to be Scheduled';
|
||||
await pw.skipIfNoLicense();
|
||||
|
||||
@@ -250,14 +242,12 @@ test('MM-T5648 should create a draft and then schedule it', async ({pw}) => {
|
||||
await scheduledDraftPage.assertscheduledDraftBody(draftMessage);
|
||||
});
|
||||
|
||||
test.fixme('MM-T5644 should edit scheduled message', async ({pw}) => {
|
||||
test.setTimeout(120000);
|
||||
|
||||
test('MM-T5644 should edit scheduled message', async ({pw}) => {
|
||||
const draftMessage = 'Scheduled Draft';
|
||||
// # Skip test if no license
|
||||
await pw.skipIfNoLicense();
|
||||
|
||||
const {user, team} = await pw.initSetup();
|
||||
const {user} = await pw.initSetup();
|
||||
const {page, channelsPage, scheduledDraftPage} = await pw.testBrowser.login(user);
|
||||
|
||||
await setupChannelPage(channelsPage, draftMessage);
|
||||
@@ -275,20 +265,18 @@ test.fixme('MM-T5644 should edit scheduled message', async ({pw}) => {
|
||||
const updatedText = 'updated text';
|
||||
await scheduledDraftPage.editText(updatedText);
|
||||
|
||||
// # Go back and wait for message to arrive
|
||||
await goBackToChannelAndWaitForMessageToArrive(page);
|
||||
await scheduledDraftPage.sendScheduledMessage(updatedText);
|
||||
|
||||
// * Verify the message has been sent and there's no more scheduled messages
|
||||
await page.waitForSelector(channelsPage.centerView.scheduledDraftChannelInfoMessageLocator, {state: 'hidden'});
|
||||
await expect(channelsPage.centerView.scheduledDraftChannelInfoMessage).not.toBeVisible();
|
||||
await expect(channelsPage.sidebarLeft.scheduledDraftCountonLHS).not.toBeVisible();
|
||||
await expect(await channelsPage.getLastPost()).toHaveText(draftMessage);
|
||||
await expect(await channelsPage.getLastPost()).toHaveText(updatedText);
|
||||
|
||||
await verifyNoscheduledDraftsPending(channelsPage, team, scheduledDraftPage, draftMessage);
|
||||
await channelsPage.sidebarLeft.assertNoPendingScheduledDraft();
|
||||
});
|
||||
|
||||
test.fixme('MM-T5650 should copy scheduled message', async ({pw, browserName}) => {
|
||||
test.setTimeout(120000);
|
||||
|
||||
test('MM-T5650 should copy scheduled message', async ({pw, browserName}) => {
|
||||
// Skip this test in Firefox clipboard permissions are not supported
|
||||
test.skip(browserName === 'firefox', 'Test not supported in Firefox');
|
||||
|
||||
@@ -315,28 +303,17 @@ test.fixme('MM-T5650 should copy scheduled message', async ({pw, browserName}) =
|
||||
|
||||
await channelsPage.centerView.postCreate.input.focus();
|
||||
|
||||
await page.keyboard.down('Meta');
|
||||
await page.keyboard.down('ControlOrMeta');
|
||||
await page.keyboard.press('V');
|
||||
await page.keyboard.up('Meta');
|
||||
await page.keyboard.up('ControlOrMeta');
|
||||
|
||||
// * Assert the message typed is same as the copied message
|
||||
await expect(channelsPage.centerView.postCreate.input).toHaveText(draftMessage);
|
||||
});
|
||||
|
||||
async function verifyNoscheduledDraftsPending(
|
||||
channelsPage: ChannelsPage,
|
||||
team: any,
|
||||
scheduledDraftPage: ScheduledDraftPage,
|
||||
draftMessage: string,
|
||||
): Promise<void> {
|
||||
await channelsPage.goto(team.name, 'scheduled_posts');
|
||||
await expect(scheduledDraftPage.scheduledDraftPanel(draftMessage)).not.toBeVisible();
|
||||
await expect(scheduledDraftPage.noscheduledDraftIcon).toBeVisible();
|
||||
}
|
||||
|
||||
async function goBackToChannelAndWaitForMessageToArrive(page: Page): Promise<void> {
|
||||
await page.goBack();
|
||||
await wait(duration.half_min);
|
||||
await wait(duration.two_min);
|
||||
await page.reload();
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user