Spin server when Tests start (#3316)
This commit is contained in:
@@ -32,29 +32,28 @@ describe('copylink', function desc() {
|
||||
await env.clearElectronInstances();
|
||||
});
|
||||
|
||||
it('MM-T125 Copy Link can be used from channel LHS', async () => {
|
||||
const firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win;
|
||||
await env.loginToMattermost(firstServer);
|
||||
await asyncSleep(2000);
|
||||
await firstServer.waitForSelector('#sidebarItem_town-square', {timeout: 5000});
|
||||
await firstServer.click('#sidebarItem_town-square', {button: 'right'});
|
||||
await asyncSleep(2000);
|
||||
switch (process.platform) {
|
||||
case 'linux':
|
||||
robot.keyTap('c');
|
||||
break;
|
||||
case 'win32':
|
||||
robot.keyTap('down');
|
||||
robot.keyTap('down');
|
||||
break;
|
||||
case 'darwin':
|
||||
robot.keyTap('c');
|
||||
break;
|
||||
}
|
||||
robot.keyTap('enter');
|
||||
await firstServer.click('#sidebarItem_town-square');
|
||||
await firstServer.click('#post_textbox');
|
||||
const clipboardText = clipboard.readText();
|
||||
clipboardText.should.contain('/channels/town-square');
|
||||
});
|
||||
if (process.platform !== 'linux') {
|
||||
it('MM-T125 Copy Link can be used from channel LHS', async () => {
|
||||
const firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win;
|
||||
await env.loginToMattermost(firstServer);
|
||||
await asyncSleep(2000);
|
||||
await firstServer.waitForSelector('#sidebarItem_town-square', {timeout: 5000});
|
||||
await firstServer.click('#sidebarItem_town-square', {button: 'right'});
|
||||
await asyncSleep(2000);
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
robot.keyTap('down');
|
||||
robot.keyTap('down');
|
||||
break;
|
||||
case 'darwin':
|
||||
robot.keyTap('c');
|
||||
break;
|
||||
}
|
||||
robot.keyTap('enter');
|
||||
await firstServer.click('#sidebarItem_town-square');
|
||||
await firstServer.click('#post_textbox');
|
||||
const clipboardText = clipboard.readText();
|
||||
clipboardText.should.contain('/channels/town-square');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -34,16 +34,27 @@ describe('history_menu', function desc() {
|
||||
await env.loginToMattermost(firstServer);
|
||||
await firstServer.waitForSelector('#sidebarItem_off-topic');
|
||||
|
||||
// click on Off topic channel
|
||||
// Click on Off-Topic channel
|
||||
await firstServer.click('#sidebarItem_off-topic');
|
||||
|
||||
// click on town square channel
|
||||
// Click on Town Square channel
|
||||
await firstServer.click('#sidebarItem_town-square');
|
||||
await firstServer.locator('[aria-label="Back"]').click();
|
||||
let channelHeaderText = await firstServer.$eval('#channelHeaderTitle', (el) => el.firstChild.innerHTML);
|
||||
|
||||
// Wait for navigation
|
||||
await firstServer.waitForSelector('#channelHeaderTitle');
|
||||
|
||||
// Get channel header text
|
||||
let channelHeaderText = await firstServer.$eval('#channelHeaderTitle', (el) => el.textContent.trim());
|
||||
channelHeaderText.should.equal('Off-Topic');
|
||||
|
||||
await firstServer.locator('[aria-label="Forward"]').click();
|
||||
channelHeaderText = await firstServer.$eval('#channelHeaderTitle', (el) => el.firstChild.innerHTML);
|
||||
await asyncSleep(3000);
|
||||
|
||||
// Wait for navigation
|
||||
await firstServer.waitForSelector('#channelHeaderTitle');
|
||||
|
||||
channelHeaderText = await firstServer.$eval('#channelHeaderTitle', (el) => el.textContent.trim());
|
||||
channelHeaderText.should.equal('Town Square');
|
||||
});
|
||||
});
|
||||
|
@@ -187,31 +187,33 @@ describe('menu/view', function desc() {
|
||||
});
|
||||
});
|
||||
|
||||
it('MM-T820 should open Developer Tools For Application Wrapper for main window', async () => {
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index.html'));
|
||||
const browserWindow = await this.app.browserWindow(mainWindow);
|
||||
if (process.platform !== 'linux') {
|
||||
it('MM-T820 should open Developer Tools For Application Wrapper for main window', async () => {
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index.html'));
|
||||
const browserWindow = await this.app.browserWindow(mainWindow);
|
||||
|
||||
let isDevToolsOpen = await browserWindow.evaluate((window) => {
|
||||
return window.webContents.isDevToolsOpened();
|
||||
let isDevToolsOpen = await browserWindow.evaluate((window) => {
|
||||
return window.webContents.isDevToolsOpened();
|
||||
});
|
||||
isDevToolsOpen.should.be.false;
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
// Press Command + Option + I
|
||||
robot.keyTap('i', ['command', 'alt']);
|
||||
await asyncSleep(3000);
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
robot.keyToggle('shift', 'down');
|
||||
robot.keyToggle('control', 'down');
|
||||
robot.keyTap('i');
|
||||
}
|
||||
|
||||
await asyncSleep(1000);
|
||||
isDevToolsOpen = await browserWindow.evaluate((window) => {
|
||||
return window.webContents.isDevToolsOpened();
|
||||
});
|
||||
isDevToolsOpen.should.be.true;
|
||||
});
|
||||
isDevToolsOpen.should.be.false;
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
// Press Command + Option + I
|
||||
robot.keyTap('i', ['command', 'alt']);
|
||||
await asyncSleep(3000);
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
robot.keyToggle('shift', 'down');
|
||||
robot.keyToggle('control', 'down');
|
||||
robot.keyTap('i');
|
||||
}
|
||||
|
||||
await asyncSleep(1000);
|
||||
isDevToolsOpen = await browserWindow.evaluate((window) => {
|
||||
return window.webContents.isDevToolsOpened();
|
||||
});
|
||||
isDevToolsOpen.should.be.true;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -147,39 +147,42 @@ describe('Menu/window_menu', function desc() {
|
||||
await afterFunc();
|
||||
});
|
||||
|
||||
it('MM-T824 should be minimized when keyboard shortcuts are pressed', async () => {
|
||||
await beforeFunc();
|
||||
if (process.platform !== 'linux') {
|
||||
it('MM-T824 should be minimized when keyboard shortcuts are pressed', async () => {
|
||||
await beforeFunc();
|
||||
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const browserWindow = await this.app.browserWindow(mainWindow);
|
||||
if (process.platform === 'darwin') {
|
||||
robot.keyTap('m', [env.cmdOrCtrl]);
|
||||
} else {
|
||||
await mainWindow.click('button.three-dot-menu');
|
||||
robot.keyTap('w');
|
||||
robot.keyTap('m');
|
||||
robot.keyTap('enter');
|
||||
}
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const browserWindow = await this.app.browserWindow(mainWindow);
|
||||
if (process.platform === 'darwin') {
|
||||
robot.keyTap('m', [env.cmdOrCtrl]);
|
||||
} else {
|
||||
await mainWindow.click('button.three-dot-menu');
|
||||
robot.keyTap('w');
|
||||
robot.keyTap('m');
|
||||
robot.keyTap('enter');
|
||||
}
|
||||
|
||||
await asyncSleep(2000);
|
||||
const isMinimized = await browserWindow.evaluate((window) => window.isMinimized());
|
||||
isMinimized.should.be.true;
|
||||
await asyncSleep(2000);
|
||||
const isMinimized = await browserWindow.evaluate((window) => window.isMinimized());
|
||||
isMinimized.should.be.true;
|
||||
|
||||
await afterFunc();
|
||||
});
|
||||
await afterFunc();
|
||||
});
|
||||
}
|
||||
if (process.platform !== 'linux') {
|
||||
it('MM-T825 should be hidden when keyboard shortcuts are pressed', async () => {
|
||||
await beforeFunc();
|
||||
|
||||
it('MM-T825 should be hidden when keyboard shortcuts are pressed', async () => {
|
||||
await beforeFunc();
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const browserWindow = await this.app.browserWindow(mainWindow);
|
||||
robot.keyTap('w', [env.cmdOrCtrl]);
|
||||
await asyncSleep(2000);
|
||||
const isVisible = await browserWindow.evaluate((window) => window.isVisible());
|
||||
isVisible.should.be.false;
|
||||
const isDestroyed = await browserWindow.evaluate((window) => window.isDestroyed());
|
||||
isDestroyed.should.be.false;
|
||||
|
||||
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
|
||||
const browserWindow = await this.app.browserWindow(mainWindow);
|
||||
robot.keyTap('w', [env.cmdOrCtrl]);
|
||||
await asyncSleep(2000);
|
||||
const isVisible = await browserWindow.evaluate((window) => window.isVisible());
|
||||
isVisible.should.be.false;
|
||||
const isDestroyed = await browserWindow.evaluate((window) => window.isDestroyed());
|
||||
isDestroyed.should.be.false;
|
||||
|
||||
await afterFunc();
|
||||
});
|
||||
await afterFunc();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -37,13 +37,15 @@ describe('header', function desc() {
|
||||
await env.clearElectronInstances();
|
||||
});
|
||||
|
||||
it('MM-T2637_1 should maximize on double-clicking the header', async () => {
|
||||
const headerBounds = await header.boundingBox();
|
||||
await header.dblclick({position: {x: headerBounds.width / 2, y: headerBounds.y / 2}});
|
||||
await asyncSleep(1000);
|
||||
const isMaximized = await browserWindow.evaluate((window) => window.isMaximized());
|
||||
isMaximized.should.be.equal(true);
|
||||
});
|
||||
if (process.platform !== 'linux') {
|
||||
it('MM-T2637_1 should maximize on double-clicking the header', async () => {
|
||||
const headerBounds = await header.boundingBox();
|
||||
await header.dblclick({position: {x: headerBounds.width / 2, y: headerBounds.y / 2}});
|
||||
await asyncSleep(1000);
|
||||
const isMaximized = await browserWindow.evaluate((window) => window.isMaximized());
|
||||
isMaximized.should.be.equal(true);
|
||||
});
|
||||
}
|
||||
|
||||
it('MM-T2637_2 should restore on double-clicking the header when maximized', async () => {
|
||||
const maximizedHeaderBounds = await header.boundingBox();
|
||||
|
Reference in New Issue
Block a user