Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 061f178

Browse files
committed
WIP: add sample tests
1 parent e120f88 commit 061f178

File tree

5 files changed

+40
-6
lines changed

5 files changed

+40
-6
lines changed

protractor-e2e-jenkins.conf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ exports.config = {
44
allScriptsTimeout: 11000,
55

66
specs: [
7-
'test/e2e/tests/**/*.js'
7+
'test/e2e/tests/helpers/**/*.js',
8+
'test/e2e/tests/**/*Spec.js'
89
],
910

1011
capabilities: {
1112
'browserName': 'chrome'
1213
},
1314

14-
baseUrl: 'http://localhost:8000/e2e/',
15+
baseUrl: 'http://localhost:8000/',
1516

1617
framework: 'jasmine',
1718

protractor-e2e-travis.conf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ config.multiCapabilities = [{
2828
}];
2929

3030
config.specs = [
31-
'test/e2e/tests/**/*.js'
31+
'test/e2e/tests/helpers/**/*.js',
32+
'test/e2e/tests/**/*Spec.js'
3233
];
3334

34-
config.baseUrl = 'http://localhost:8000/e2e/';
35+
config.baseUrl = 'http://localhost:8000/';
3536

3637
config.allScriptsTimeout = 30000;
3738
config.getPageTimeout = 30000;

protractor-e2e.conf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
var config = require('./protractor-shared-conf').config;
44

55
config.specs = [
6-
'test/e2e/tests/**/*.js'
6+
'test/e2e/tests/helpers/**/*.js',
7+
'test/e2e/tests/**/*Spec.js'
78
];
89

9-
config.baseUrl = 'http://localhost:8000/e2e/';
10+
config.baseUrl = 'http://localhost:8000/';
1011

1112
config.capabilities = {
1213
browserName: 'chrome',

test/e2e/tests/helpers/main.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var helper = {
2+
andWaitForAngular: function() {
3+
browser.waitForAngular();
4+
},
5+
loadFixture: function(fixture) {
6+
var i = 0;
7+
while (fixture[i] === '/') ++i;
8+
fixture = fixture.slice(i);
9+
if (!/\/(index\.html)?$/.test(fixture)) {
10+
fixture += '/';
11+
}
12+
13+
browser.get('/e2e/fixtures/' + fixture);
14+
return helper;
15+
}
16+
};
17+
18+
global.test = helper;
19+
global.loadFixture = helper.loadFixture;

test/e2e/tests/sampleSpec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Sample E2E test:
2+
//
3+
describe('Sample', function() {
4+
beforeEach(function() {
5+
loadFixture("sample").andWaitForAngular();
6+
});
7+
8+
it('should have the interpolated text', function() {
9+
expect(element(by.binding('text')).getText())
10+
.toBe('Hello, world!');
11+
});
12+
});

0 commit comments

Comments
 (0)