Fixed some E2E tests that broke on v5.2 (#2453)

* Fixing some E2E tests

* Fixed a couple flaky ones

* Fixed some issues on Windows
This commit is contained in:
Devin Binnie
2022-12-06 08:40:56 -04:00
committed by GitHub
parent c37d1ba308
commit 865fd2522f
14 changed files with 64 additions and 77 deletions

View File

@@ -56,7 +56,7 @@ describe('MM-T2633 Back button should behave as expected', function desc() {
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("OneLogin")');
await firstServer.click('a:has-text("Okta")');
backButton = await mainWindow.waitForSelector('button:has-text("Back")');
});
@@ -67,10 +67,10 @@ describe('MM-T2633 Back button should behave as expected', function desc() {
await env.clearElectronInstances();
});
it('MM-T2633_1 after clicking OneLogin, back button should appear', async () => {
it('MM-T2633_1 after clicking Okta, back button should appear', async () => {
backButton.should.not.be.null;
const poweredByOneLogin = await firstServer.waitForSelector('a:has-text("Powered by OneLogin")');
poweredByOneLogin.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 () => {
@@ -80,26 +80,26 @@ describe('MM-T2633 Back button should behave as expected', function desc() {
await mainWindow.waitForSelector('button:has-text("Back")', {state: 'hidden'});
});
it('MM-T2633_3 on the OneLogin screen, should still allow links to be clicked and still show the Back button', async () => {
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 oneLoginUrl = firstServer.url();
await firstServer.click('a:has-text("OneLogin")');
const poweredByOneLogin = await firstServer.waitForSelector('a:has-text("Powered by OneLogin")');
poweredByOneLogin.click();
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(oneLoginUrl);
frameUrl.should.not.equal(OktaUrl);
isNewWindow.should.be.false;
await firstServer.waitForSelector('a:has-text("Powered by OneLogin")', {state: 'hidden'});
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.onelogin.com/**');
await firstServer.waitForURL('https://mattermost.okta.com/**');
await backButton.click();
const loginPrompt = await firstServer.waitForSelector('#input_loginId');
loginPrompt.should.not.be.null;