Created
August 25, 2015 16:51
-
-
Save iegik/1a70af5c7f33a054749c to your computer and use it in GitHub Desktop.
Protractor e2e tests
This file contains hidden or 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
| 'use strict'; | |
| var SomePage = require('../pages/SomePage'); | |
| describe('some', function () { | |
| it('feature', function () { | |
| var somePage = new SomePage(); | |
| expect(somePage.items.then(function (items) { | |
| items[0].button.click(); | |
| return items[0].pane.isDisplayed(); | |
| })).toBe(true); | |
| }); | |
| }); |
This file contains hidden or 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
| 'use strict'; | |
| var SomePageItem = function (item) { | |
| this.button = item.$('.btn'); | |
| this.pane = item.$('.pane'); | |
| }; | |
| module.exports = SomePageItem; |
This file contains hidden or 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
| 'use strict'; | |
| var SomePageItem = require('./items/SomePageItem'); | |
| function SomePage() { | |
| browser.get('items'); | |
| } | |
| SomePage.prototype = { | |
| get items() { | |
| return $$('.item').then(function (items) { | |
| return items.map(function (item) { | |
| return new SomePageItem(item); | |
| }); | |
| }); | |
| }, | |
| header: $('header'), | |
| description: $('.description') | |
| }; | |
| module.exports = SomePage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment