mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-19 17:14:45 +00:00
add wait for app to load
This commit is contained in:
parent
b690805a8b
commit
4040e80db7
e2e/pages
@ -49,7 +49,10 @@ export class LoginPage extends Page {
|
||||
|
||||
loginWith(username: string, password?: string): promise.Promise<void> {
|
||||
const pass = password || username;
|
||||
return this.login.enterCredentials(username, pass).submit();
|
||||
return this.login.enterCredentials(username, pass).submit()
|
||||
.then(() => {
|
||||
super.waitForApp();
|
||||
});
|
||||
}
|
||||
|
||||
loginWithAdmin(): promise.Promise<any> {
|
||||
|
@ -15,18 +15,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, element, by, ElementFinder, promise } from 'protractor';
|
||||
import { browser, element, by, ElementFinder, promise, ExpectedConditions as EC } from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT } from './../configs';
|
||||
|
||||
export abstract class Page {
|
||||
private static USE_HASH_STRATEGY = false;
|
||||
|
||||
private locators = {
|
||||
app: by.css('app-root'),
|
||||
layout: by.css('app-layout'),
|
||||
overlay: by.css('.cdk-overlay-container'),
|
||||
snackBar: by.css('simple-snack-bar')
|
||||
};
|
||||
|
||||
public app: ElementFinder = element(this.locators.app);
|
||||
public layout: ElementFinder = element(this.locators.layout);
|
||||
public overlay: ElementFinder = element(this.locators.overlay);
|
||||
public snackBar: ElementFinder = element(this.locators.snackBar);
|
||||
|
||||
@ -43,6 +46,10 @@ export abstract class Page {
|
||||
return browser.get(path);
|
||||
}
|
||||
|
||||
waitForApp() {
|
||||
return browser.wait(EC.presenceOf(this.layout), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
refresh(): promise.Promise<void> {
|
||||
return browser.refresh();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user