[ACA-4264] refactor page load and loginWith methods (#1952)

* update extensions json files

* no message

* on login, sign out if anyone is already logged in

* one more selector override needed by ACA-4262
This commit is contained in:
Adina Parpalita
2021-01-29 14:27:32 +02:00
committed by GitHub
parent bd81f52cfe
commit 2f8d3d58c4
16 changed files with 6666 additions and 4417 deletions

View File

@@ -25,8 +25,9 @@
import { browser, by, ElementFinder } from 'protractor';
import { BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { USE_HASH_STRATEGY } from './../configs';
import { APP_ROUTES, USE_HASH_STRATEGY } from './../configs';
import { Utils, waitElement, waitForPresence, isPresentAndDisplayed } from '../utilities/utils';
import { Header } from '../components';
export abstract class Page {
appRoot = 'app-root';
@@ -60,6 +61,12 @@ export abstract class Page {
await waitForPresence(this.layout);
}
async signOut(): Promise<void> {
await new Header().openMoreMenu();
await new Header().menu.clickMenuItem('Sign out');
await BrowserVisibility.waitUntilElementIsPresent(browser.element(by.css('[class*="login-content"] input#username')));
}
async waitForDialog() {
await BrowserVisibility.waitUntilElementIsVisible(this.dialogContainer);
}
@@ -102,4 +109,9 @@ export abstract class Page {
Logger.error(e, '.......failed on click snack bar action.........');
}
}
async isLoggedIn(): Promise<boolean> {
const url = await browser.driver.getCurrentUrl();
return !url.includes(APP_ROUTES.LOGIN);
}
}