Skip to content

Instantly share code, notes, and snippets.

@wingsuitist
Last active July 7, 2017 14:37
Show Gist options
  • Save wingsuitist/9e689ec64359dcaaf3be621a4a52f43b to your computer and use it in GitHub Desktop.
Save wingsuitist/9e689ec64359dcaaf3be621a4a52f43b to your computer and use it in GitHub Desktop.
angular 4 protractor end 2 end testing - e2e tests
import { LetslearnPage } from './app.po';
describe('letslearn App', () => {
let page: LetslearnPage;
beforeEach(() => {
page = new LetslearnPage();
});
it('Should display Letslearn title', () => {
page.navigateTo();
expect(page.getTitle()).toEqual('Letslearn');
});
it('Should start with 1 point', () => {
page.navigateTo();
expect(page.getPoints()).toEqual('1');
});
it('Should increase points by clicking plus1', () => {
page.navigateTo();
expect(page.getPoints()).toEqual('1');
page.getPlus1Button().click();
expect(page.getPoints()).toEqual('2');
page.getPlus1Button().click();
page.getPlus1Button().click();
page.getPlus1Button().click();
expect(page.getPoints()).toEqual('5');
});
it('Should rest points by clicking plus1', () => {
page.navigateTo();
page.getPlus1Button().click();
page.getPlus1Button().click();
page.getPlus1Button().click();
expect(page.getPoints()).toEqual('4');
page.getResetButton().click();
expect(page.getPoints()).toEqual('0');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment