forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- created index file with remote function
- added mocha tests and travis.yml
- Loading branch information
1 parent
e954d16
commit dea2bd6
Showing
6 changed files
with
95 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "0.8" | ||
|
||
before_script: | ||
- npm install -g mocha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* webdriverjs | ||
* https://github.com/Camme/webdriverjs | ||
* | ||
* A WebDriver module for nodejs. Either use the super easy help commands or use the base | ||
* Webdriver wire protocol commands. Its totally inspired by jellyfishs webdriver, but the | ||
* goal is to make all the webdriver protocol items available, as near the original as possible. | ||
* | ||
* Copyright (c) 2013 Camilo Tapia <[email protected]> | ||
* Licensed under the MIT license. | ||
* | ||
* Contributors: | ||
* Dan Jenkins <[email protected]> | ||
* Christian Bromann <[email protected]> | ||
*/ | ||
|
||
var singletonInstance = null, | ||
WebdriverJS = require('./lib/webdriverjs'); | ||
|
||
// expose the man function | ||
// if we need a singleton, we provide the option here | ||
exports.remote = function(options) { | ||
|
||
// make sure we have a default options if none are provided | ||
options = options || {}; | ||
console.log(WebdriverJS); | ||
if (options.singleton) { | ||
if (!singletonInstance) { | ||
singletonInstance = new WebdriverJS(options); | ||
} | ||
return singletonInstance; | ||
} else { | ||
return new WebdriverJS(options); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "webdriverjs", | ||
"description": "A nodejs bindings implementation for selenium 2.0/webdriver", | ||
"version": "0.7", | ||
"version": "0.6.9", | ||
"homepage": "https://github.com/Camme/webdriverjs", | ||
"author": "camilo tapia <[email protected]>", | ||
"contributors": [ | ||
|
@@ -21,10 +21,13 @@ | |
"url": "https://github.com/Camme/webdriverjs/blob/master/LICENSE-MIT" | ||
} | ||
], | ||
"main": "./lib/webdriverjs", | ||
"main": "./index", | ||
"engines": { | ||
"node": ">= 0.8.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"optionalDependencies": {}, | ||
|
@@ -39,5 +42,5 @@ | |
"webdriverjs", | ||
"selenium", | ||
"saucelabs" | ||
], | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var assert = require("assert"); | ||
describe('Array', function(){ | ||
describe('#indexOf()', function(){ | ||
it('should return -1 when the value is not present', function(){ | ||
assert.equal(-1, [1,2,3].indexOf(5)); | ||
assert.equal(-1, [1,2,3].indexOf(0)); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var assert = require("assert"), | ||
webdriverjs = require("../index"); | ||
|
||
describe('Test command getCssProperty(cssSelector, cssProperty, callback)', function(){ | ||
|
||
this.timeout(99999999); | ||
|
||
var client = {}; | ||
|
||
before(function(){ | ||
// init client | ||
var capabilities = { | ||
'browserName': 'chrome', | ||
'chrome.binary': '/Applications/Browser/Google Chrome.app/Contents/MacOS/Google Chrome' | ||
}; | ||
client = webdriverjs.remote({desiredCapabilities:capabilities}); | ||
}); | ||
|
||
beforeEach(function(){ | ||
client | ||
.init() | ||
.url('https://github.com/Camme/webdriverjs'); | ||
}); | ||
|
||
describe('check CSS property of several tags', function(){ | ||
it('should return #777777 as font-color', function(done){ | ||
client | ||
.getElementCssProperty('id', 'footer', 'color', function(result) { | ||
console.log('result: rgba(119,119,119,1) === ' + result); | ||
assert('rgba(119,119,119,1)' === result); | ||
}) | ||
.end(done); | ||
}); | ||
}); | ||
}); |