Skip to content

Commit

Permalink
changed app.e2e with use protractor.ExpectedConditions
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakuba committed Oct 5, 2016
1 parent ada4f8d commit 58f2c08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions modules/admin/src/app/app.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AppTest } from './app.page';
import { WaitUntil } from './common/waitUntilReady';

describe('App', () => {
let ptor = protractor.wrapDriver(browser.driver);
Expand All @@ -17,17 +16,16 @@ describe('App', () => {
this.apptest.get();
let subject = browser.getTitle();
let result = 'SMSC Admin';

expect(subject).toEqual(result);
});

it('should have input username', () => {
WaitUntil.waitUntil(this.apptest.elemUsername, ptor);
let result = true;
expect(this.apptest.isPresentUsername()).toEqual(result);
});

it('should have input password', () => {
WaitUntil.waitUntil(this.apptest.elemPassword, ptor);
let result = true;
expect(this.apptest.isPresentPassword()).toEqual(result);
});
Expand Down
3 changes: 3 additions & 0 deletions modules/admin/src/app/app.page.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { EC } from "./common/expectedConditions";
export class AppTest {

public elemUsername = element(by.className('username'));
Expand All @@ -11,10 +12,12 @@ export class AppTest {
}

isPresentUsername() {
browser.wait(EC.presenceOf(this.elemUsername), 5000);
return this.elemUsername.isPresent();
}

isPresentPassword() {
browser.wait(EC.presenceOf(this.elemPassword), 5000);
return this.elemPassword.isPresent();
}

Expand Down

0 comments on commit 58f2c08

Please sign in to comment.