test:MM-T125 Copy Link can be used from channel LHS (#1966)
This commit is contained in:

committed by
GitHub

parent
6803310217
commit
089833f678
49
e2e/specs/mattermost/copy_link.test.js
Normal file
49
e2e/specs/mattermost/copy_link.test.js
Normal file
@@ -0,0 +1,49 @@
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const {clipboard} = require('electron');
|
||||
|
||||
const env = require('../../modules/environment');
|
||||
const {asyncSleep} = require('../../modules/utils');
|
||||
|
||||
describe('copylink', function desc() {
|
||||
this.timeout(40000);
|
||||
|
||||
const config = env.demoMattermostConfig;
|
||||
|
||||
beforeEach(async () => {
|
||||
env.cleanDataDir();
|
||||
env.createTestUserDataDir();
|
||||
env.cleanTestConfig();
|
||||
fs.writeFileSync(env.configFilePath, JSON.stringify(config));
|
||||
await asyncSleep(1000);
|
||||
this.app = await env.getApp();
|
||||
this.serverMap = await env.getServerMap(this.app);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (this.app) {
|
||||
await this.app.close();
|
||||
}
|
||||
});
|
||||
|
||||
it('MM-T125 Copy Link can be used from channel LHS', async () => {
|
||||
const loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen'));
|
||||
await loadingScreen.waitForSelector('.LoadingScreen', {state: 'hidden'});
|
||||
const firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win;
|
||||
await env.loginToMattermost(firstServer);
|
||||
await firstServer.waitForSelector('#sidebarItem_suscipit-4');
|
||||
await firstServer.click('#sidebarItem_suscipit-4');
|
||||
await firstServer.click('#sidebarItem_suscipit-4', {button: 'right'});
|
||||
await firstServer.click('text=Copy Linksint >> span');
|
||||
await firstServer.click('#sidebarItem_town-square');
|
||||
await firstServer.click('#post_textbox');
|
||||
const clipboardText = clipboard.readText();
|
||||
await firstServer.fill('#post_textbox', clipboardText);
|
||||
const content = await firstServer.locator('#post_textbox').textContent();
|
||||
content.should.be.equal('/ad-1/channels/suscipit-4');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user