test: MM-T806 Exit in the Menu Bar (#1980)

This commit is contained in:
Md_ZubairAhmed
2022-01-31 21:09:49 +05:30
committed by GitHub
parent 5f489e28a0
commit 6702f41143

View File

@@ -14,16 +14,20 @@ describe('file_menu/dropdown', function desc() {
const config = env.demoConfig;
let skipAfterEach = false;
beforeEach(async () => {
env.createTestUserDataDir();
env.cleanTestConfig();
fs.writeFileSync(env.configFilePath, JSON.stringify(config));
await asyncSleep(1000);
this.app = await env.getApp();
skipAfterEach = false;
});
afterEach(async () => {
if (this.app) {
if (this.app && skipAfterEach === false) {
await this.app.close();
}
});
@@ -80,4 +84,21 @@ describe('file_menu/dropdown', function desc() {
settingsWindowFromMenu.should.not.be.null;
}
});
it('MM-T806 Exit in the Menu Bar', () => {
const mainWindow = this.app.windows().find((window) => window.url().includes('index'));
mainWindow.should.not.be.null;
if (process.platform === 'darwin') {
robot.keyTap('q', ['command']);
}
if (process.platform === 'linux' || process.platform === 'win32') {
robot.keyTap('q', ['control']);
}
this.app.windows().find((window) => window.url().should.not.include('index'));
skipAfterEach = true; // Need to skip closing in aftereach as apps execution context is destroyed above
});
});