(cherry picked from commit 6fbb9234af
)
Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
parent
f4cab1e92b
commit
aee4855712
|
@ -1,107 +0,0 @@
|
||||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
||||||
// See LICENSE.txt for license information.
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const env = require('../../modules/environment');
|
|
||||||
const {asyncSleep} = require('../../modules/utils');
|
|
||||||
|
|
||||||
describe('MM-T2633 Back button should behave as expected', function desc() {
|
|
||||||
this.timeout(30000);
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
...env.demoConfig,
|
|
||||||
teams: [
|
|
||||||
{
|
|
||||||
name: 'community',
|
|
||||||
url: 'https://community.mattermost.com',
|
|
||||||
order: 0,
|
|
||||||
tabs: [
|
|
||||||
{
|
|
||||||
name: 'TAB_MESSAGING',
|
|
||||||
order: 0,
|
|
||||||
isOpen: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TAB_FOCALBOARD',
|
|
||||||
order: 1,
|
|
||||||
isOpen: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'TAB_PLAYBOOKS',
|
|
||||||
order: 2,
|
|
||||||
isOpen: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
lastActiveTab: 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
let mainWindow;
|
|
||||||
let firstServer;
|
|
||||||
let backButton;
|
|
||||||
|
|
||||||
before(async () => {
|
|
||||||
env.cleanDataDir();
|
|
||||||
env.createTestUserDataDir();
|
|
||||||
env.cleanTestConfig();
|
|
||||||
fs.writeFileSync(env.configFilePath, JSON.stringify(config));
|
|
||||||
await asyncSleep(1000);
|
|
||||||
this.app = await env.getApp();
|
|
||||||
this.serverMap = await env.getServerMap(this.app);
|
|
||||||
|
|
||||||
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'});
|
|
||||||
firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win;
|
|
||||||
await firstServer.click('a:has-text("Okta")');
|
|
||||||
backButton = await mainWindow.waitForSelector('button:has-text("Back")');
|
|
||||||
});
|
|
||||||
|
|
||||||
after(async () => {
|
|
||||||
if (this.app) {
|
|
||||||
await this.app.close();
|
|
||||||
}
|
|
||||||
await env.clearElectronInstances();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('MM-T2633_1 after clicking Okta, back button should appear', async () => {
|
|
||||||
backButton.should.not.be.null;
|
|
||||||
const poweredByOkta = await firstServer.waitForSelector('p:has-text("Powered by Okta")');
|
|
||||||
poweredByOkta.should.not.be.null;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('MM-T2633_2 after clicking Back, should be back on the login screen', async () => {
|
|
||||||
await backButton.click();
|
|
||||||
const loginPrompt = await firstServer.waitForSelector('#input_loginId');
|
|
||||||
loginPrompt.should.not.be.null;
|
|
||||||
await mainWindow.waitForSelector('button:has-text("Back")', {state: 'hidden'});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('MM-T2633_3 on the Okta screen, should still allow links to be clicked and still show the Back button', async () => {
|
|
||||||
let isNewWindow = false;
|
|
||||||
this.app.on('window', () => {
|
|
||||||
isNewWindow = true;
|
|
||||||
});
|
|
||||||
const OktaUrl = firstServer.url();
|
|
||||||
await firstServer.click('a:has-text("Okta")');
|
|
||||||
const poweredByOkta = await firstServer.waitForSelector('p:has-text("Powered by Okta") a:has-text("Okta")');
|
|
||||||
poweredByOkta.click();
|
|
||||||
backButton = await mainWindow.waitForSelector('button:has-text("Back")');
|
|
||||||
backButton.should.not.be.null;
|
|
||||||
const frameUrl = firstServer.url();
|
|
||||||
frameUrl.should.not.equal(OktaUrl);
|
|
||||||
isNewWindow.should.be.false;
|
|
||||||
await firstServer.waitForSelector('p:has-text("Powered by Okta")', {state: 'hidden'});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('MM-T2633_4 after click Back twice, user should be on the main login screen again', async () => {
|
|
||||||
await backButton.click();
|
|
||||||
await firstServer.waitForURL('https://mattermost.okta.com/**');
|
|
||||||
await backButton.click();
|
|
||||||
const loginPrompt = await firstServer.waitForSelector('#input_loginId');
|
|
||||||
loginPrompt.should.not.be.null;
|
|
||||||
});
|
|
||||||
});
|
|
16
package-lock.json
generated
16
package-lock.json
generated
|
@ -6,7 +6,7 @@
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mattermost-desktop",
|
"name": "mattermost-desktop",
|
||||||
"version": "5.5.0-develop.1",
|
"version": "5.5.0-rc.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
"mocha-circleci-reporter": "0.0.3",
|
"mocha-circleci-reporter": "0.0.3",
|
||||||
"mochawesome": "7.1.3",
|
"mochawesome": "7.1.3",
|
||||||
"nan": "2.17.0",
|
"nan": "2.17.0",
|
||||||
"node-abi": "3.40.0",
|
"node-abi": "3.47.0",
|
||||||
"node-jq": "2.3.4",
|
"node-jq": "2.3.4",
|
||||||
"node-loader": "2.0.0",
|
"node-loader": "2.0.0",
|
||||||
"npm-run-all": "4.1.5",
|
"npm-run-all": "4.1.5",
|
||||||
|
@ -25946,9 +25946,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/node-abi": {
|
"node_modules/node-abi": {
|
||||||
"version": "3.40.0",
|
"version": "3.47.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.40.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
|
||||||
"integrity": "sha512-zNy02qivjjRosswoYmPi8hIKJRr8MpQyeKT6qlcq/OnOgA3Rhoae+IYOqsM9V5+JnHWmxKnWOT2GxvtqdtOCXA==",
|
"integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": "^7.3.5"
|
"semver": "^7.3.5"
|
||||||
|
@ -53846,9 +53846,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node-abi": {
|
"node-abi": {
|
||||||
"version": "3.40.0",
|
"version": "3.47.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.40.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
|
||||||
"integrity": "sha512-zNy02qivjjRosswoYmPi8hIKJRr8MpQyeKT6qlcq/OnOgA3Rhoae+IYOqsM9V5+JnHWmxKnWOT2GxvtqdtOCXA==",
|
"integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"semver": "^7.3.5"
|
"semver": "^7.3.5"
|
||||||
|
|
|
@ -198,7 +198,7 @@
|
||||||
"mocha-circleci-reporter": "0.0.3",
|
"mocha-circleci-reporter": "0.0.3",
|
||||||
"mochawesome": "7.1.3",
|
"mochawesome": "7.1.3",
|
||||||
"nan": "2.17.0",
|
"nan": "2.17.0",
|
||||||
"node-abi": "3.40.0",
|
"node-abi": "3.47.0",
|
||||||
"node-jq": "2.3.4",
|
"node-jq": "2.3.4",
|
||||||
"node-loader": "2.0.0",
|
"node-loader": "2.0.0",
|
||||||
"npm-run-all": "4.1.5",
|
"npm-run-all": "4.1.5",
|
||||||
|
|
Loading…
Reference in a new issue