|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +/* global $ */ |
| 4 | +/* global $$ */ |
| 5 | +/* global by */ |
| 6 | + |
| 7 | +var PlayerLocationElement = function(browser, playerLocation) { |
| 8 | + this.playerLocation = playerLocation; |
| 9 | + var _this = this; |
| 10 | + this.click = function() { |
| 11 | + return this.playerLocation.click(); |
| 12 | + }; |
| 13 | + |
| 14 | + this.selectPlayer = function(playerIndex) { |
| 15 | + return this.click().then(function() { |
| 16 | + return $$('.player-list a').get(playerIndex).click(); |
| 17 | + }); |
| 18 | + }; |
| 19 | + |
| 20 | + this.getPlayerName = function() { |
| 21 | + return this.playerLocation.findElement(by.css('.player-name big')).getText(); |
| 22 | + }; |
| 23 | + |
| 24 | + this.goal = function() { |
| 25 | + return this.click().then(function() { |
| 26 | + return $('.btn-goal').click(); |
| 27 | + }); |
| 28 | + }; |
| 29 | + |
| 30 | + this.autogoal = function() { |
| 31 | + return _this.click().then(function() { |
| 32 | + return $('.btn-autogoal').click(); |
| 33 | + }); |
| 34 | + }; |
| 35 | +}; |
| 36 | + |
1 | 37 | var BabitchGamePage = function(browser) { |
2 | 38 | browser.get(browser.baseUrl + '#/game?nobackend'); |
3 | 39 |
|
@@ -38,34 +74,4 @@ var BabitchGamePage = function(browser) { |
38 | 74 | }; |
39 | 75 | }; |
40 | 76 |
|
41 | | -var PlayerLocationElement = function(browser, playerLocation) { |
42 | | - this.playerLocation = playerLocation; |
43 | | - var _this = this; |
44 | | - this.click = function() { |
45 | | - return this.playerLocation.click(); |
46 | | - }; |
47 | | - |
48 | | - this.selectPlayer = function(playerIndex) { |
49 | | - return this.click().then(function() { |
50 | | - return $$('.player-list a').get(playerIndex).click(); |
51 | | - }); |
52 | | - }; |
53 | | - |
54 | | - this.getPlayerName = function() { |
55 | | - return this.playerLocation.findElement(by.css('.player-name big')).getText(); |
56 | | - }; |
57 | | - |
58 | | - this.goal = function() { |
59 | | - return this.click().then(function() { |
60 | | - return $('.btn-goal').click(); |
61 | | - }); |
62 | | - }; |
63 | | - |
64 | | - this.autogoal = function() { |
65 | | - return _this.click().then(function() { |
66 | | - return $('.btn-autogoal').click(); |
67 | | - }); |
68 | | - }; |
69 | | -}; |
70 | | - |
71 | 77 | module.exports = BabitchGamePage; |
0 commit comments