New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various improvements. #30
Changes from 4 commits
2d08b7e
2d26591
a668306
b232236
3f145ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
This file is part of the GhostDriver project from Neustar inc. | ||
|
||
Copyright (c) 2012, Ivan De Marino <ivan.de.marino@gmail.com> - Neustar inc. | ||
Copyright (c) 2012, Ivan De Marino <ivan.de.marino@gmail.com> - Neustar inc. and other authors. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
|
@@ -35,7 +35,8 @@ ghostdriver.WebElementReqHand = function(id, session) { | |
_protoParent = ghostdriver.WebElementReqHand.prototype, | ||
_const = { | ||
VALUE : "value", | ||
SUBMIT : "submit" | ||
SUBMIT : "submit", | ||
DISPLAYED : "displayed" | ||
}, | ||
_errors = require("./errors.js"), | ||
|
||
|
@@ -50,13 +51,24 @@ ghostdriver.WebElementReqHand = function(id, session) { | |
} else if (req.urlParsed.file === _const.SUBMIT && req.method === "POST") { | ||
_submitCommand(req, res); | ||
return; | ||
} else if (req.urlParsed.file === _const.DISPLAYED && req.method === "GET") { | ||
_getDisplayedCommand(req, res); | ||
return; | ||
} // else ... | ||
|
||
// TODO lots to do... | ||
|
||
throw _errors.createInvalidReqInvalidCommandMethodEH(req); | ||
}, | ||
|
||
_getDisplayedCommand = function(req, res) { | ||
var isDisplayedAtom = require("./webdriver_atoms.js").get("is_displayed"); | ||
var displayed = _session.getCurrentWindow().evaluate(isDisplayedAtom, _getJSON()); | ||
displayed = JSON.parse(displayed).value; | ||
res.success(_session.getId(), displayed); | ||
// TODO handle StaleElementReference | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes me think that I need to migrate "_respondBasedOnResult" to the "session decoration". I will. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will take a look. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You want to give this a go? I have reviewed your code: if you are going to add this, I'll wait to merge so that I can also review that and do one big merge :) Otherwise, tomorrow I shall resume my work on GhostDriver (I was away from this code for the last 4/5 days) and I'll do it. I'm based in Europe (to give a time reference). |
||
}, | ||
|
||
_valueCommand = function(req, res) { | ||
var i, ilen, | ||
postObj = JSON.parse(req.post), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you want to enter "and other authors" right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's appropriate.