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.
- Loading branch information
1 parent
3f946d2
commit 562643a
Showing
15 changed files
with
282 additions
and
131 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 buster = require("buster"), | ||
webdriverjs = require('../index'); | ||
|
||
buster.testCase("my webdriverjs tests", { | ||
|
||
'setUp': function() { | ||
this.timeout = 9999999; | ||
|
||
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} }); | ||
client.init(); | ||
}, | ||
|
||
'test it': function (done) { | ||
client | ||
.url('https://github.com/') | ||
.getElementSize('.header-logo-wordmark', function(err, result) { | ||
assert(err === null); | ||
assert(result.height === 30); | ||
assert(result.width === 68); | ||
}) | ||
.getTitle(function(err, title) { | ||
assert(err === null); | ||
assert(title === 'GitHub · Build software better, together.'); | ||
}) | ||
.getElementCssProperty('class name','subheading', 'color', function(err, result){ | ||
assert(err === null); | ||
assert(result === 'rgba(136, 136, 136, 1)'); | ||
}) | ||
.call(done); | ||
}, | ||
|
||
'tearDown': function(done) { | ||
client.end(done); | ||
} | ||
}); |
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 webdriverjs = require('../index'); | ||
|
||
describe('my webdriverjs tests', function() { | ||
|
||
var client = {}; | ||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999; | ||
|
||
beforeEach(function() { | ||
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} }); | ||
client.init(); | ||
}); | ||
|
||
it('test it', function(done) { | ||
client | ||
.url('https://github.com/') | ||
.getElementSize('.header-logo-wordmark', function(err, result) { | ||
expect(err).toBe(null); | ||
expect(result.height).toBe(30); | ||
expect(result.width).toBe(68); | ||
}) | ||
.getTitle(function(err, title) { | ||
expect(err).toBe(null); | ||
expect(title).toBe('GitHub · Build software better, together.'); | ||
}) | ||
.getElementCssProperty('class name','subheading', 'color', function(err, result){ | ||
expect(err).toBe(null); | ||
expect(result).toBe('rgba(136, 136, 136, 1)'); | ||
}) | ||
.call(done); | ||
}); | ||
|
||
afterEach(function(done) { | ||
client.end(done); | ||
}); | ||
}); |
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,42 @@ | ||
/* jshint -W024 */ | ||
/* jshint expr:true */ | ||
|
||
var chai = require('chai'), | ||
assert = chai.assert, | ||
should = chai.should(), | ||
expect = chai.expect, | ||
webdriverjs = require('../index'); | ||
|
||
describe('my webdriverjs tests', function(){ | ||
|
||
this.timeout(99999999); | ||
var client = {}; | ||
|
||
before(function(){ | ||
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} }); | ||
client.init(); | ||
}); | ||
|
||
it('Github test',function(done) { | ||
client | ||
.url('https://github.com/') | ||
.getElementSize('.header-logo-wordmark', function(err, result) { | ||
expect(err).to.be.null; | ||
assert.strictEqual(result.height , 30); | ||
assert.strictEqual(result.width, 68); | ||
}) | ||
.getTitle(function(err, title) { | ||
expect(err).to.be.null; | ||
assert.strictEqual(title,'GitHub · Build software better, together.'); | ||
}) | ||
.getElementCssProperty('class name','subheading', 'color', function(err, result){ | ||
expect(err).to.be.null; | ||
assert.strictEqual(result, 'rgba(136, 136, 136, 1)'); | ||
}) | ||
.call(done); | ||
}); | ||
|
||
after(function(done) { | ||
client.end(done); | ||
}); | ||
}); |
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,39 @@ | ||
/* jshint -W024 */ | ||
/* jshint expr:true */ | ||
|
||
var webdriverjs = require('../index'), | ||
assert = require('assert'); | ||
|
||
describe('my webdriverjs tests', function(){ | ||
|
||
this.timeout(99999999); | ||
var client = {}; | ||
|
||
before(function(){ | ||
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} }); | ||
client.init(); | ||
}); | ||
|
||
it('Github test',function(done) { | ||
client | ||
.url('https://github.com/') | ||
.getElementSize('.header-logo-wordmark', function(err, result) { | ||
assert(err === null); | ||
assert(result.height === 30); | ||
assert(result.width === 68); | ||
}) | ||
.getTitle(function(err, title) { | ||
assert(err === null); | ||
assert(title === 'GitHub · Build software better, together.'); | ||
}) | ||
.getElementCssProperty('class name','subheading', 'color', function(err, result){ | ||
assert(err === null); | ||
assert(result === 'rgba(136, 136, 136, 1)'); | ||
}) | ||
.call(done); | ||
}); | ||
|
||
after(function(done) { | ||
client.end(done); | ||
}); | ||
}); |
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,38 @@ | ||
/* jshint -W024 */ | ||
/* jshint expr:true */ | ||
|
||
var webdriverjs = require('../index'), | ||
assert = require('assert'); | ||
|
||
module.exports = { | ||
|
||
setUp: function (callback) { | ||
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} }); | ||
client.init(); | ||
|
||
callback(); | ||
}, | ||
test1: function (test) { | ||
client | ||
.url('https://github.com/') | ||
.getElementSize('.header-logo-wordmark', function(err, result) { | ||
test.ok(err === null, 'getElementSize() should cause no error'); | ||
test.ok(result.height === 30, 'logo height should be 30px'); | ||
test.ok(result.width === 68, 'logo width should be 68px'); | ||
}) | ||
.getTitle(function(err, title) { | ||
test.ok(err === null, 'getTitle() should cause no error'); | ||
test.ok(title === 'GitHub · Build software better, together.', 'title should be "GitHub · Build software better, together."'); | ||
}) | ||
.getElementCssProperty('class name','subheading', 'color', function(err, result){ | ||
test.ok(err === null, 'getElementCssProperty() should cause no error'); | ||
test.ok(result === 'rgba(136, 136, 136, 1)', 'color should be rgba(136, 136, 136, 1)'); | ||
}); | ||
|
||
test.done(); | ||
}, | ||
tearDown: function (callback) { | ||
// clean up | ||
client.end(callback); | ||
} | ||
}; |
Oops, something went wrong.