Skip to content

Commit

Permalink
finished e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
maheedhar1998 committed Apr 28, 2020
1 parent 61d542e commit 3d46e2d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 9 additions & 4 deletions e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { browser } from 'protractor';
import { AppPage } from './app.po';

describe('new App', () => {
Expand All @@ -12,9 +13,13 @@ describe('new App', () => {
console.log(page.checkPage());
expect(page.checkPage()).toBe('http://localhost:4200/login');
});
it('should login with valid credentials', () => {
page.navigateToRoot();
page.login();
expect(page.checkPage()).toBe('http://localhost:4200/home');
it('goes to sign up page', () => {
page.navigateToSignUp();
expect(page.checkPage()).toBe('http://localhost:4200/signup');
});
// it('should navigate back to login page form home page if a user is not logged in', () => {
// page.navigateToHome();
// browser.sleep(1000);
// expect(page.checkPage()).toBe('http://localhost:4200/login');
// });
});
6 changes: 6 additions & 0 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ export class AppPage {
navigateToRoot() {
return browser.get('/login');
}
navigateToSignUp() {
return browser.get('/signup');
}
navigateToHome() {
return browser.get('/home');
}
// inputLoginCredentialsAndLogin() {
// delay(30000);
// var email = element(by.css(`${'ion-content'}${'#email'}`));
Expand Down

0 comments on commit 3d46e2d

Please sign in to comment.