[MM-40051] MM-T4385 select tab from menu (#1962)

* MM-T4385 select tab from menu

* revert package-lock

* lint errors

* package revert

* test name corrected

* robot js keytap introduced

* package.json rever
This commit is contained in:
Ujjwal Sharma
2022-02-01 01:34:27 +05:30
committed by GitHub
parent aa9e177895
commit c49aadc563

View File

@@ -9,7 +9,7 @@ const robot = require('robotjs');
const env = require('../../modules/environment');
const {asyncSleep} = require('../../modules/utils');
describe('mattermost', function desc() {
describe('Menu/window_menu', function desc() {
this.timeout(30000);
const config = {
@@ -29,12 +29,12 @@ describe('mattermost', function desc() {
{
name: 'TAB_FOCALBOARD',
order: 1,
isOpen: false,
isOpen: true,
},
{
name: 'TAB_PLAYBOOKS',
order: 2,
isOpen: false,
isOpen: true,
},
],
lastActiveTab: 0,
@@ -76,4 +76,23 @@ describe('mattermost', function desc() {
dropdownButtonText = await mainWindow.innerText('.TeamDropdownButton');
dropdownButtonText.should.equal('example');
});
it('MM-T4385 select tab from menu', async () => {
const mainView = this.app.windows().find((window) => window.url().includes('index'));
let tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Channels');
robot.keyTap('2', [process.platform === 'darwin' ? 'command' : 'control']);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Boards');
robot.keyTap('3', [process.platform === 'darwin' ? 'command' : 'control']);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Playbooks');
robot.keyTap('1', [process.platform === 'darwin' ? 'command' : 'control']);
tabViewButton = await mainView.innerText('.active');
tabViewButton.should.equal('Channels');
});
});