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

Commit c69bf23

Browse files
committed
Adding an external example spec, which connects to an existing website
(angularjs.org) for a super simple example.
1 parent fa34b02 commit c69bf23

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
angular-seed/
21
node_modules/

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ testapp/
22

33
.npmignore
44
httpspec.js
5+
externalhttpspec.js

externalhttpspec.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var webdriver = require('selenium-webdriver');
2+
var protractor = require('./protractor.js');
3+
var assert = require('assert');
4+
var util = require('util');
5+
6+
var driver = new webdriver.Builder().
7+
usingServer('http://localhost:4444/wd/hub').
8+
withCapabilities({
9+
'browserName': 'chrome',
10+
'version': '',
11+
'platform': 'ANY',
12+
'javascriptEnabled': true
13+
}).build();
14+
15+
driver.manage().timeouts().setScriptTimeout(10000);
16+
var ptor = protractor.wrapDriver(driver);
17+
18+
ptor.get('http://www.angularjs.org');
19+
20+
ptor.findElement(protractor.By.input("yourName")).sendKeys("Julie");
21+
22+
ptor.findElement(protractor.By.binding("Hello {{yourName}}!")).
23+
getText().then(function(text) {
24+
assert.equal('Hello Julie!', text);
25+
});
26+
27+
// Uncomment to see failures.
28+
// ptor.findElement(protractor.By.binding("Hello {{yourName}}!")).
29+
// getText().then(function(text) {
30+
// assert.equal('Hello Jack!', text);
31+
// });

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
"peerDependencies" : {
88
"selenium-webdriver" : "~2.32.1"
99
},
10+
"devDependencies" : {
11+
"jasmine-node" : "~1.8.0"
12+
},
1013
"repository" : {
1114
"type" : "git",
1215
"url" : "git://github.com/juliemr/protractor.git"
1316
},
1417
"main" : "protractor.js",
15-
"version" : "0.1.3"
18+
"version" : "0.1.4"
1619
}

0 commit comments

Comments
 (0)