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.
- added own test html page - added tests for get* commands - fixed wrong implemented commands and protocol commands - use chai for assertion tests
- Loading branch information
1 parent
052ca7d
commit 6b0eb37
Showing
13 changed files
with
134 additions
and
95 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
.hg | ||
.hgignore | ||
/*.png | ||
|
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
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
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
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
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,41 +1,16 @@ | ||
exports.command = function (id, value, callback) { | ||
|
||
var commandOptionsPost = { | ||
var requestOptions = { | ||
path:"/session/:sessionId/element/:id/value", | ||
method:"POST" | ||
}; | ||
|
||
var commandOptionsGet = { | ||
path:"/session/:sessionId/element/:id/value", | ||
method:"GET" | ||
}; | ||
|
||
var requestOptions = {}; | ||
|
||
// set or get | ||
if (typeof value === "string") { | ||
|
||
requestOptions = commandOptionsPost; | ||
requestOptions.path = requestOptions.path.replace(/:id/gi, id); | ||
|
||
this.executeProtocolCommand( | ||
requestOptions, | ||
this.proxyResponseNoReturn(callback), | ||
{"value":value.split("")} | ||
); | ||
|
||
} else { | ||
|
||
callback = value; | ||
|
||
requestOptions = commandOptionsGet; | ||
requestOptions.path = requestOptions.path.replace(/:id/gi, id); | ||
requestOptions.path = requestOptions.path.replace(/:id/gi, id); | ||
|
||
this.executeProtocolCommand( | ||
requestOptions, | ||
this.proxyResponse(callback), | ||
{} | ||
); | ||
this.executeProtocolCommand( | ||
requestOptions, | ||
this.proxyResponseNoReturn(callback), | ||
{"value":value.split("")} | ||
); | ||
|
||
} | ||
}; |
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
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,41 @@ | ||
<!DOCTYPE html><html><head> | ||
<title>WebdriverJS Testpage</title> | ||
|
||
<style type="text/css"> | ||
.box { | ||
width: 100px; | ||
height: 100px; | ||
float: left; | ||
border: magenta 1px solid; | ||
margin-right: 10px; | ||
} | ||
#githubRepo { | ||
display:block; | ||
} | ||
.red { background: red; } | ||
.green { background: green; } | ||
.yellow { background: yellow; } | ||
.black { background: black; } | ||
.purple { background: purple; } | ||
</style> | ||
|
||
</head> | ||
<body> | ||
|
||
<h1>Test CSS Attributes</h1> | ||
<hr> | ||
<div class="box red"></div> | ||
<div class="box green"></div> | ||
<div class="box yellow"></div> | ||
<div class="box black"></div> | ||
<div class="box purple" id="purplebox"></div> | ||
|
||
<a href="https://github.com" id="githubRepo" class="clearfix">GitHub Repo</a> | ||
|
||
<div class="nested" style="text-transform: uppercase"> | ||
<h2>nested elements</h2> | ||
<div> | ||
<span>nested span</span> | ||
</div> | ||
</div> | ||
</body></html> |