Skip to content
This repository was archived by the owner on Oct 10, 2018. It is now read-only.

Commit e38980e

Browse files
author
Jérémy Jourdin
committed
Add e2e tests to jshint:test task + fix cs
1 parent 34983b5 commit e38980e

File tree

11 files changed

+80
-36
lines changed

11 files changed

+80
-36
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ module.exports = function (grunt) {
9999
options: {
100100
jshintrc: 'test/.jshintrc'
101101
},
102-
src: ['test/spec/{,*/}*.js']
102+
src: ['test/spec/{,*/}*.js','test/e2e/{,*/}*.js']
103103
}
104104
},
105105

test/e2e/babitchStats.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
'use strict';
22

3+
/* global $$ */
4+
/* global xit */
5+
36
var BabitchStatsGamesPage = require('./page/statsGames.js');
47
var BabitchStatsGamePage = require('./page/statsGame.js');
58
var BabitchStatsPlayersPage = require('./page/statsPlayers.js');

test/e2e/mock/config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use strict';
22

3-
module.exports = function() {angular.module("babitchServer", [])
4-
.constant('CONFIG', {
5-
'BABITCH_WS_URL': "http://127.0.0.1:8081/app_dev.php/v1",
6-
'BABITCH_LIVE_FAYE_URL' :'http://localhost:9003/faye',
7-
'BABITCH_LIVE_FAYE_CHANNEL' :'/test-channeldfdfd-to-replace'
3+
module.exports = function() {
4+
angular.module('babitchServer', [])
5+
.constant('CONFIG', {
6+
'BABITCH_WS_URL': 'http://127.0.0.1:8081/app_dev.php/v1',
7+
'BABITCH_LIVE_FAYE_URL' :'http://localhost:9003/faye',
8+
'BABITCH_LIVE_FAYE_CHANNEL' :'/test-channeldfdfd-to-replace'
89
});
910
};

test/e2e/page/game.js

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
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+
137
var BabitchGamePage = function(browser) {
238
browser.get(browser.baseUrl + '#/game?nobackend');
339

@@ -38,34 +74,4 @@ var BabitchGamePage = function(browser) {
3874
};
3975
};
4076

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-
7177
module.exports = BabitchGamePage;

test/e2e/page/home.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
'use strict';
2+
3+
/* global $ */
4+
/* global $$ */
5+
16
var BabitchHomePage = function(browser) {
27
browser.get(browser.baseUrl + '#/?nobackend');
38
this.title = $('.navbar-brand');

test/e2e/page/live.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
'use strict';
2+
3+
/* global $ */
4+
15
var BabitchLivePage = function(browser) {
26
browser.get(browser.baseUrl + '#/live?nobackend');
37
this.score = $('.score');

test/e2e/page/statsGame.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
'use strict';
2+
3+
/* global $ */
4+
/* global $$ */
5+
16
var BabitchStatsGamePage = function(browser) {
27
browser.get(browser.baseUrl + '#/stats/games/252?nobackend');
38
this.navbarActive = $('ul.nav li.active');

test/e2e/page/statsGames.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
'use strict';
2+
3+
/* global $ */
4+
/* global $$ */
5+
16
var BabitchStatsGamesPage = function(browser) {
27
browser.get(browser.baseUrl + '#/stats/games?nobackend');
38
this.navbarActive = $('ul.nav li.active');

test/e2e/page/statsPlayer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
'use strict';
2+
3+
/* global $ */
4+
/* global $$ */
5+
16
var BabitchStatsPlayerPage = function(browser) {
27
browser.get(browser.baseUrl + '#/stats/players/9?nobackend');
38
this.navbarActive = $('ul.nav li.active');

test/e2e/page/statsPlayers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
'use strict';
2+
3+
/* global $ */
4+
/* global $$ */
5+
16
var BabitchStatsPlayersPage = function(browser) {
27
browser.get(browser.baseUrl + '#/stats/players?nobackend');
38
this.navbarActive = $('ul.nav li.active');

0 commit comments

Comments
 (0)