mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user