Skip to content

Commit 714f642

Browse files
author
Rahul Raut
authored
Merge pull request #127 from mllrsohn/spawn_to_fork
Spawn to fork
2 parents b3ccbc2 + 8fe9ebd commit 714f642

File tree

14 files changed

+449
-402
lines changed

14 files changed

+449
-402
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* text=auto
1+
* text=auto

.jshintrc

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
{
2-
"node": true,
3-
"esnext": true,
4-
"bitwise": true,
5-
"camelcase": true,
6-
"curly": true,
7-
"eqeqeq": true,
8-
"immed": true,
9-
"indent": 4,
10-
"latedef": true,
11-
"newcap": true,
12-
"noarg": true,
13-
"quotmark": "single",
14-
"regexp": true,
15-
"undef": true,
16-
"unused": true,
17-
"strict": true,
18-
"trailing": true,
19-
"smarttabs": true,
20-
"white": false
2+
"node": true,
3+
"esnext": true,
4+
"bitwise": true,
5+
"camelcase": true,
6+
"curly": true,
7+
"eqeqeq": true,
8+
"immed": true,
9+
"indent": 4,
10+
"latedef": true,
11+
"newcap": true,
12+
"noarg": true,
13+
"quotmark": "single",
14+
"regexp": true,
15+
"undef": true,
16+
"unused": true,
17+
"trailing": true,
18+
"smarttabs": true,
19+
"white": false,
20+
"globals": {
21+
"after": false,
22+
"afterEach": false,
23+
"angular": false,
24+
"before": false,
25+
"beforeEach": false,
26+
"browser": false,
27+
"describe": false,
28+
"expect": false,
29+
"inject": false,
30+
"strict": false,
31+
"it": false,
32+
"jasmine": false,
33+
"spyOn": false,
34+
"$": false,
35+
"element": true,
36+
"by": true
37+
}
2138
}

example/Gulpfile.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
var gulp = require('gulp');
23

34
// The protractor task
@@ -9,9 +10,9 @@ var webdriver_standalone = require('../').webdriver_standalone;
910
// Download and update the selenium driver
1011
var webdriver_update = require('../').webdriver_update_specific;
1112

12-
// Downloads the selenium webdriver
13+
// Downloads the selenium webdriver - stupid solution to pass extra args like ignore_ssl
1314
gulp.task('webdriver_update', webdriver_update({
14-
browsers: ['ignore_ssl']
15+
browsers: ['ignore_ssl']
1516
}));
1617

1718
// Start the standalone selenium server
@@ -21,10 +22,10 @@ gulp.task('webdriver_standalone', webdriver_standalone);
2122

2223

2324
// Setting up the test task
24-
gulp.task('protractor', ['webdriver_update'], function (cb) {
25-
gulp.src(['example_spec.js']).pipe(protractor({
26-
configFile: 'protractor.conf.js'
27-
})).on('error', function (e) {
28-
console.log(e)
29-
}).on('end', cb);
25+
gulp.task('protractor', ['webdriver_update'], function(cb) {
26+
gulp.src(['example_spec.js']).pipe(protractor({
27+
configFile: 'protractor.conf.js'
28+
})).on('error', function(e) {
29+
console.log(e);
30+
}).on('end', cb);
3031
});

example/example_spec.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
describe('angularjs homepage', function() {
2-
it('should greet the named user', function() {
3-
browser.get('http://www.angularjs.org');
2+
it('should greet the named user', function() {
3+
browser.get('http://www.angularjs.org');
44

5-
element(by.model('yourName')).sendKeys('Julie');
5+
element(by.model('yourName')).sendKeys('Julie');
66

7-
var greeting = element(by.binding('yourName'));
7+
var greeting = element(by.binding('yourName'));
88

9-
expect(greeting.getText()).toEqual('Hello Julie!');
10-
});
9+
expect(greeting.getText()).toEqual('Hello Julie!');
10+
});
1111

12-
describe('todo list', function() {
13-
var todoList;
12+
describe('todo list', function() {
13+
var todoList;
1414

15-
beforeEach(function() {
16-
browser.get('http://www.angularjs.org');
15+
beforeEach(function() {
16+
browser.get('http://www.angularjs.org');
1717

18-
todoList = element.all(by.repeater('todo in todoList.todos'));
19-
});
18+
todoList = element.all(by.repeater('todo in todoList.todos'));
19+
});
2020

21-
it('should list todos', function() {
22-
expect(todoList.count()).toEqual(2);
23-
expect(todoList.get(1).getText()).toEqual('build an AngularJS app');
24-
});
21+
it('should list todos', function() {
22+
expect(todoList.count()).toEqual(2);
23+
expect(todoList.get(1).getText()).toEqual('build an AngularJS app');
24+
});
2525

26-
it('should add a todo', function() {
27-
var addTodo = element(by.model('todoList.todoText'));
28-
var addButton = element(by.css('[value="add"]'));
26+
it('should add a todo', function() {
27+
var addTodo = element(by.model('todoList.todoText'));
28+
var addButton = element(by.css('[value="add"]'));
2929

30-
addTodo.sendKeys('write a protractor test');
31-
addButton.click();
30+
addTodo.sendKeys('write a protractor test');
31+
addButton.click();
3232

33-
expect(todoList.count()).toEqual(3);
34-
expect(todoList.get(2).getText()).toEqual('write a protractor test');
35-
});
36-
});
33+
expect(todoList.count()).toEqual(3);
34+
expect(todoList.get(2).getText()).toEqual('write a protractor test');
35+
});
36+
});
3737
});

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
},
88
"devDependencies": {
99
"gulp": "latest",
10+
"jasmine": "^2.5.3",
1011
"protractor": "latest"
1112
}
1213
}

example/protractor.conf.js

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
// An example configuration file.
22
// https://raw.github.com/angular/protractor/master/example/conf.js
33
exports.config = {
4-
// The address of a running selenium server.
5-
// Make sure you check the version in the folder
6-
// seleniumServerJar: './selenium-server-standalone-3.2.0.jar',
7-
8-
// webdriver-start can start on default port 4444
9-
//seleniumAddress: 'http://localhost:4444/wd/hub',
10-
11-
// Capabilities to be passed to the webdriver instance.
12-
capabilities: {
13-
'browserName': 'chrome'
14-
},
154

16-
allScriptsTimeout: 40000,
5+
directConnect: true,
176

18-
// Options to be passed to Jasmine-node.
19-
jasmineNodeOpts: {
20-
showColors: true,
21-
defaultTimeoutInterval: 30000
22-
}
23-
};
7+
// The address of a running selenium server.
8+
// Make sure you check the version in the folder
9+
// seleniumServerJar: './selenium-server-standalone-3.2.0.jar',
10+
11+
// webdriver-start can start on default port 4444
12+
//seleniumAddress: 'http://localhost:4444/wd/hub',
13+
14+
// Capabilities to be passed to the webdriver instance.
15+
capabilities: {
16+
'browserName': 'chrome'
17+
},
18+
19+
specs: ['example-spec.js'],
20+
21+
allScriptsTimeout: 60000,
22+
23+
// Options to be passed to Jasmine-node.
24+
jasmineNodeOpts: {
25+
showColors: true,
26+
defaultTimeoutInterval: 30000
27+
}
28+
};

example_2/Gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ gulp.task('e2etests:webdriver_manager_update', 'updates the selenium server stan
1414

1515
gulp.task('e2etests:run', 'runs e2etests using protractor.conf', ['e2etests:server', 'e2etests:webdriver_manager_update'], function(cb) {
1616

17-
gulp.src(['tests/e2e/**/*.js'], { read:false })
17+
gulp.src(['tests/e2e/**/*.js'], { read: false })
1818
.pipe(gp.protractor({
1919
configFile: 'protractor.conf.js',
2020
args: ['--baseUrl', 'http://' + server.address().address + ':' + server.address().port]
2121
})).on('error', function(e) {
2222
server.close();
23-
if(isCI) {
23+
if (isCI) {
2424
throw e;
2525
} else {
2626
console.log(e);

example_2/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
"version": "0.0.1",
44
"description": "example for gulp protractor",
55
"scripts": {
6-
"wd:update" : "webdriver-manager update",
7-
"wd:start" : "webdriver-manager start",
8-
"e2e" : "gulp e2etests:run"
6+
"wd:update": "webdriver-manager update",
7+
"wd:start": "webdriver-manager start",
8+
"e2e": "gulp e2etests:run"
99
},
1010
"devDependencies": {
11+
"express": "3.5.0",
1112
"gulp": "latest",
1213
"gulp-help": "^1.6.1",
13-
"gulp-protractor": "4.0.0",
14-
"express": "3.5.0",
14+
"gulp-protractor": "mllrsohn/gulp-protractor#spawn_to_fork",
15+
"jasmine": "^2.5.3",
1516
"yargs": "^1.2.1"
1617
}
1718
}

example_2/protractor.conf.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
exports.config = {
2-
//seleniumAddress: 'http://localhost:4444/wd/hub',
2+
//seleniumAddress: 'http://localhost:4444/wd/hub',
33

4-
// seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.2.0.jar',
4+
// seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.2.0.jar',
55

6-
// Capabilities to be passed to the webdriver instance.
7-
multiCapabilities: [
8-
{
9-
'browserName': 'chrome',
10-
'maxInstances': 2,
11-
shardTestFiles: true
12-
}
13-
],
6+
// Capabilities to be passed to the webdriver instance.
7+
multiCapabilities: [
8+
{
9+
'browserName': 'chrome',
10+
'maxInstances': 2,
11+
shardTestFiles: true
12+
}
13+
],
1414

15-
allScriptsTimeout: 60000,
15+
allScriptsTimeout: 60000,
1616

17-
specs: ['./tests/e2e/**/*.js'],
17+
specs: ['./tests/e2e/**/*.js'],
1818

19-
// Options to be passed to Jasmine-node.
20-
jasmineNodeOpts: {
21-
showColors: true,
22-
defaultTimeoutInterval: 30000
23-
}
19+
// Options to be passed to Jasmine-node.
20+
jasmineNodeOpts: {
21+
showColors: true,
22+
defaultTimeoutInterval: 30000
23+
}
2424
};
2525

example_2/tests/e2e/01-index-tests.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
describe('WebApp', function() {
22

3-
describe('index page', function(){
3+
describe('index page', function() {
44

5-
browser.get('/');
5+
browser.get('/');
66

7-
it('should show the page', function() {
8-
expect(element.all(by.css('h1')).
9-
first().getText()).toBe("Headline 2");
10-
});
7+
it('should show the page', function() {
8+
expect(element.all(by.css('h1')).
9+
first().getText()).toBe("Headline 2");
10+
});
1111

12-
});
12+
});
1313

1414
});
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
describe('angularjs homepage', function() {
2-
it('should greet the named user', function() {
3-
browser.get('http://www.angularjs.org');
2+
it('should greet the named user', function() {
3+
browser.get('http://www.angularjs.org');
44

5-
element(by.model('yourName')).sendKeys('Julie');
5+
element(by.model('yourName')).sendKeys('Julie');
66

7-
var greeting = element(by.binding('yourName'));
7+
var greeting = element(by.binding('yourName'));
88

9-
expect(greeting.getText()).toEqual('Hello Julie!');
10-
});
9+
expect(greeting.getText()).toEqual('Hello Julie!');
10+
});
1111

12-
describe('todo list', function() {
13-
var todoList;
12+
describe('todo list', function() {
13+
var todoList;
1414

15-
beforeEach(function() {
16-
browser.get('http://www.angularjs.org');
15+
beforeEach(function() {
16+
browser.get('http://www.angularjs.org');
1717

18-
todoList = element.all(by.repeater('todo in todoList.todos'));
19-
});
18+
todoList = element.all(by.repeater('todo in todoList.todos'));
19+
});
2020

21-
it('should list todos', function() {
22-
expect(todoList.count()).toEqual(2);
23-
expect(todoList.get(1).getText()).toEqual('build an AngularJS app');
24-
});
21+
it('should list todos', function() {
22+
expect(todoList.count()).toEqual(2);
23+
expect(todoList.get(1).getText()).toEqual('build an AngularJS app');
24+
});
2525

26-
it('should add a todo', function() {
27-
var addTodo = element(by.model('todoList.todoText'));
28-
var addButton = element(by.css('[value="add"]'));
26+
it('should add a todo', function() {
27+
var addTodo = element(by.model('todoList.todoText'));
28+
var addButton = element(by.css('[value="add"]'));
2929

30-
addTodo.sendKeys('write a protractor test');
31-
addButton.click();
30+
addTodo.sendKeys('write a protractor test');
31+
addButton.click();
3232

33-
expect(todoList.count()).toEqual(3);
34-
expect(todoList.get(2).getText()).toEqual('write a protractor test');
35-
});
36-
});
33+
expect(todoList.count()).toEqual(3);
34+
expect(todoList.get(2).getText()).toEqual('write a protractor test');
35+
});
36+
});
3737
});

0 commit comments

Comments
 (0)