From 54a1aefe52bb276d011c9eae74685659367148bf Mon Sep 17 00:00:00 2001 From: Suneet Srivastava Date: Tue, 8 Feb 2022 20:01:13 +0530 Subject: [PATCH] test:MM-T809/MM-T810/MM-T811 Cut/Copy/Paste in the Menu Bar (#1978) --- e2e/specs/menu_bar/edit_menu.test.js | 90 ++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/e2e/specs/menu_bar/edit_menu.test.js b/e2e/specs/menu_bar/edit_menu.test.js index dd33d3e4..bae58d56 100644 --- a/e2e/specs/menu_bar/edit_menu.test.js +++ b/e2e/specs/menu_bar/edit_menu.test.js @@ -80,6 +80,96 @@ describe('edit_menu', function desc() { } }); + it('MM-T809 Cut in the Menu Bar', async () => { + if (process.platform === 'win32' || process.platform === 'linux') { + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + 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'); + + // click on sint channel + await firstServer.click('#sidebarItem_suscipit-4'); + await firstServer.click('#post_textbox'); + await firstServer.type('#post_textbox', 'Mattermost'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('s'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('c'); + robot.keyTap('enter'); + const content = await firstServer.inputValue('#post_textbox'); + content.should.be.equal(''); + } + }); + + it('MM-T810 Copy in the Menu Bar', async () => { + if (process.platform === 'win32' || process.platform === 'linux') { + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + 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'); + + // click on sint channel + await firstServer.click('#sidebarItem_suscipit-4'); + await firstServer.click('#post_textbox'); + await firstServer.type('#post_textbox', 'Mattermost'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('s'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('c'); + robot.keyTap('c'); + robot.keyTap('enter'); + await firstServer.click('#post_textbox'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('p'); + robot.keyTap('enter'); + const content = await firstServer.inputValue('#post_textbox'); + content.should.be.equal('MattermostMattermost'); + } + }); + + it('MM-T811 Paste in the Menu Bar', async () => { + if (process.platform === 'win32' || process.platform === 'linux') { + const mainWindow = this.app.windows().find((window) => window.url().includes('index')); + 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'); + + // click on sint channel + await firstServer.click('#sidebarItem_suscipit-4'); + await firstServer.click('#post_textbox'); + await firstServer.type('#post_textbox', 'Mattermost'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('s'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('c'); + robot.keyTap('c'); + robot.keyTap('enter'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('s'); + robot.keyTap('backspace'); + await mainWindow.click('button.three-dot-menu'); + robot.keyTap('e'); + robot.keyTap('p'); + robot.keyTap('enter'); + const content = await firstServer.inputValue('#post_textbox'); + content.should.be.equal('Mattermost'); + } + }); + it('MM-T812 Select All in the Menu Bar', async () => { const mainWindow = this.app.windows().find((window) => window.url().includes('index')); const loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen'));