Modify run conditions for nightly e2e job to create test cycle and post in channel. (#2971)

This commit is contained in:
yasserfaraazkhan
2024-03-19 22:18:29 +05:30
committed by GitHub
parent d3b43b5b64
commit 7c2b4ec502
18 changed files with 480 additions and 268 deletions

View File

@@ -43,7 +43,10 @@ describe('focus', function desc() {
],
};
beforeEach(async () => {
let firstServer;
let loadingScreen;
before(async () => {
env.cleanDataDir();
env.createTestUserDataDir();
env.cleanTestConfig();
@@ -51,9 +54,16 @@ describe('focus', function desc() {
await asyncSleep(1000);
this.app = await env.getApp();
this.serverMap = await env.getServerMap(this.app);
loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen'));
await loadingScreen.waitForSelector('.LoadingScreen', {state: 'hidden'});
firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win;
await env.loginToMattermost(firstServer);
const textbox = await firstServer.waitForSelector('#post_textbox');
textbox.focus();
});
afterEach(async () => {
after(async () => {
if (this.app) {
await this.app.close();
}
@@ -61,17 +71,6 @@ describe('focus', function desc() {
});
describe('Focus textbox tests', () => {
let firstServer;
beforeEach(async () => {
const loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen'));
await loadingScreen.waitForSelector('.LoadingScreen', {state: 'hidden'});
firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win;
await env.loginToMattermost(firstServer);
const textbox = await firstServer.waitForSelector('#post_textbox');
textbox.focus();
});
it('MM-T1315 should return focus to the message box when closing the settings window', async () => {
this.app.evaluate(({ipcMain}, showWindow) => {
ipcMain.emit(showWindow);
@@ -85,6 +84,8 @@ describe('focus', function desc() {
const isTextboxFocused = await firstServer.$eval('#post_textbox', (el) => el === document.activeElement);
isTextboxFocused.should.be.true;
await firstServer.fill('#post_textbox', '');
// Make sure you can just start typing and it'll go in the post textbox
await asyncSleep(500);
robot.typeString('Mattermost');
@@ -108,6 +109,8 @@ describe('focus', function desc() {
const isTextboxFocused = await firstServer.$eval('#post_textbox', (el) => el === document.activeElement);
isTextboxFocused.should.be.true;
await firstServer.fill('#post_textbox', '');
// Make sure you can just start typing and it'll go in the post textbox
await asyncSleep(500);
robot.typeString('Mattermost');
@@ -132,6 +135,8 @@ describe('focus', function desc() {
const isTextboxFocused = await firstServer.$eval('#post_textbox', (el) => el === document.activeElement);
isTextboxFocused.should.be.true;
await firstServer.fill('#post_textbox', '');
// Make sure you can just start typing and it'll go in the post textbox
await asyncSleep(500);
robot.typeString('Mattermost');