Skip to content

Commit

Permalink
Add logout to e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
stasbamiza committed Oct 11, 2016
1 parent 92b281a commit a5a9e36
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 523 deletions.
3 changes: 1 addition & 2 deletions modules/admin/src/app/dashboards/dashboard.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ describe('Dashboard', () => {
});

it('should logout', () => {
//WaitUntil.logout(prot);
//expect(true).toBeTruthy();
this.dashboard.login.logout();
});
});
2 changes: 1 addition & 1 deletion modules/admin/src/app/dashboards/dashboard.page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { browser } from "protractor/built/index";
import { LoginPage } from "../pages/login.page";
import WebElement = webdriver.WebElement;
import { EC } from "../common/expectedConditions";
import {LoginPage} from "../login/login.page";

export class Dashboard {
public dashboard = element(by.css('.dashboard'));
Expand Down
22 changes: 17 additions & 5 deletions modules/admin/src/app/login/login.page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LoginModel } from './login.model';
import { EC } from "../common/expectedConditions";
import { EC } from '../common/expectedConditions';

export class LoginPage {
public elemNotFound = element(by.tagName('notfound'));
Expand All @@ -8,6 +8,9 @@ export class LoginPage {
public loginWindow = element(by.id('login'));
public usernameField = element(by.css('.username input'));
public passwordField = element(by.css('.password input'));
public logoutBtn = element(by.id('logout'));
public loginComponent = element(by.tagName('login'));


constructor() {
}
Expand Down Expand Up @@ -36,9 +39,9 @@ export class LoginPage {
}

fillLoginForm(loginModel: LoginModel) {
var isClickableUsername = EC.elementToBeClickable(this.usernameField);
var isClickablePassword = EC.elementToBeClickable(this.passwordField);
var isClickableSubmit = EC.elementToBeClickable(this.passwordField);
let isClickableUsername = EC.elementToBeClickable(this.usernameField);
let isClickablePassword = EC.elementToBeClickable(this.passwordField);
let isClickableSubmit = EC.elementToBeClickable(this.passwordField);

browser.wait(EC.and(isClickableUsername, isClickablePassword, isClickableSubmit), 5000);

Expand All @@ -51,5 +54,14 @@ export class LoginPage {
let loginModel: LoginModel = new LoginModel('admin', 'admin', false);
this.fillLoginForm(loginModel);
}
}

logout() {
browser.wait(EC.elementToBeClickable(this.logoutBtn), 5000);
this.logoutBtn.click();
}

isPresentLogin() {
browser.wait(EC.presenceOf(this.loginComponent), 5000);
return this.loginComponent.isPresent();
}
}
19 changes: 0 additions & 19 deletions modules/admin/src/app/pages/app.page.js

This file was deleted.

1 change: 0 additions & 1 deletion modules/admin/src/app/pages/app.page.js.map

This file was deleted.

24 changes: 0 additions & 24 deletions modules/admin/src/app/pages/common/waitUntilReady.js

This file was deleted.

1 change: 0 additions & 1 deletion modules/admin/src/app/pages/common/waitUntilReady.js.map

This file was deleted.

68 changes: 0 additions & 68 deletions modules/admin/src/app/pages/crud.page.js

This file was deleted.

1 change: 0 additions & 1 deletion modules/admin/src/app/pages/crud.page.js.map

This file was deleted.

161 changes: 0 additions & 161 deletions modules/admin/src/app/pages/crud/crud.create.page.js

This file was deleted.

Loading

0 comments on commit a5a9e36

Please sign in to comment.