Last active
July 7, 2017 14:37
-
-
Save wingsuitist/9e689ec64359dcaaf3be621a4a52f43b to your computer and use it in GitHub Desktop.
angular 4 protractor end 2 end testing - e2e tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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