Skip to content

Commit

Permalink
Importing GhostDriver 1.1.0 in PhantomJS.
Browse files Browse the repository at this point in the history
CHANGELOG for v1.1.0 (https://github.com/detro/ghostdriver/issues?labels=1.1.0&state=closed)

JavaScript Driver (Core)
* ENHANCEMENT: `/maximize` window will set the window size to 1336x768,
currently most common resolution online (see http://gs.statcounter.com/#resolution-ww-monthly-201307-201312)
* ENHANCEMENT detro#275: Implemented Browser and Network (HAR) Logging types
* FIXED #284: Attempt to wait for Page to Load if input causes form submit
* FIXED #291: Throw exception when attempting to set invalid timeout value
* FIXED detro#259: Fix issue regarding mouse clicks
* ENHANCEMENT detro#290: Enabled support for "Keep Alive" HTTP connections
* ENHANCEMENT detro#262: Allow access to PhantomJS API from WebDriver (Driver part)
* ENHANCEMENT #293: Import Selenium 2.39.0 WebDriver Atoms

Java Binding
* MINOR detro#251: Minor compilation issues for Binding
* ENHANCEMENT detro#262: Allow access to PhantomJS API from WebDriver (Java Binding part)

Tested using GhostDriver validation tests (https://github.com/detro/ghostdriver/tree/master/test).

ariya/phantomjs#11877
  • Loading branch information
detro authored and ariya committed Jan 4, 2014
1 parent b70ff89 commit a9a219e
Show file tree
Hide file tree
Showing 80 changed files with 3,308 additions and 19,075 deletions.
4 changes: 2 additions & 2 deletions src/ghostdriver/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -92,7 +92,7 @@ exports.init = function(cliArgs) {
// Apply/Normalize the Configuration before returning
apply();

_log.debug("init", "Configuration => " + JSON.stringify(config));
_log.debug("config.init", JSON.stringify(config));
};

exports.get = function() {
Expand Down
6 changes: 3 additions & 3 deletions src/ghostdriver/errors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -61,7 +61,7 @@ exports.createInvalidReqEH = function(errorName, req) {
var e = new Error();

e.name = errorName;
e.message = "Request => " + JSON.stringify(req);
e.message = JSON.stringify(req);
e.handle = _invalidReqHandle;

return e;
Expand Down Expand Up @@ -216,7 +216,7 @@ exports.createFailedCommandEH = function(errorName, errorMsg, req, session, clas
var e = new Error();

e.name = errorName;
e.message = "Error Message => '" + errorMsg + "'\n" + " caused by Request => " + JSON.stringify(req);
e.message = JSON.stringify({ "errorMessage" : errorMsg, "request" : req });
e.errorStatusCode = exports.FAILED_CMD_STATUS_CODES[errorName] || 13; //< '13' Unkown Error
e.errorSessionId = session.getId() || null;
e.errorClassName = className || "unknown";
Expand Down
13 changes: 1 addition & 12 deletions src/ghostdriver/ghostdriver.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
<file>request_handlers/webelement_request_handler.js</file>
<file>session.js</file>
<file>third_party/console++.js</file>
<file>third_party/har.js</file>
<file>third_party/parseuri.js</file>
<file>third_party/uuid.js</file>
<file>third_party/webdriver-atoms/active_element.js</file>
<file>third_party/webdriver-atoms/clear.js</file>
<file>third_party/webdriver-atoms/clear_local_storage.js</file>
<file>third_party/webdriver-atoms/clear_session_storage.js</file>
<file>third_party/webdriver-atoms/click.js</file>
<file>third_party/webdriver-atoms/default_content.js</file>
<file>third_party/webdriver-atoms/deps.js</file>
<file>third_party/webdriver-atoms/double_click.js</file>
<file>third_party/webdriver-atoms/drag.js</file>
<file>third_party/webdriver-atoms/execute_async_script.js</file>
Expand All @@ -32,15 +31,10 @@
<file>third_party/webdriver-atoms/find_element.js</file>
<file>third_party/webdriver-atoms/find_elements.js</file>
<file>third_party/webdriver-atoms/focus_on_element.js</file>
<file>third_party/webdriver-atoms/frame_by_id_or_name.js</file>
<file>third_party/webdriver-atoms/frame_by_index.js</file>
<file>third_party/webdriver-atoms/get_appcache_status.js</file>
<file>third_party/webdriver-atoms/get_attribute.js</file>
<file>third_party/webdriver-atoms/get_attribute_value.js</file>
<file>third_party/webdriver-atoms/get_current_position.js</file>
<file>third_party/webdriver-atoms/get_element_from_cache.js</file>
<file>third_party/webdriver-atoms/get_frame_window.js</file>
<file>third_party/webdriver-atoms/get_in_view_location.js</file>
<file>third_party/webdriver-atoms/get_local_storage_item.js</file>
<file>third_party/webdriver-atoms/get_local_storage_keys.js</file>
<file>third_party/webdriver-atoms/get_local_storage_size.js</file>
Expand All @@ -51,10 +45,7 @@
<file>third_party/webdriver-atoms/get_session_storage_size.js</file>
<file>third_party/webdriver-atoms/get_size.js</file>
<file>third_party/webdriver-atoms/get_text.js</file>
<file>third_party/webdriver-atoms/get_top_left_coordinates.js</file>
<file>third_party/webdriver-atoms/get_value_of_css_property.js</file>
<file>third_party/webdriver-atoms/get_window_position.js</file>
<file>third_party/webdriver-atoms/get_window_size.js</file>
<file>third_party/webdriver-atoms/is_displayed.js</file>
<file>third_party/webdriver-atoms/is_enabled.js</file>
<file>third_party/webdriver-atoms/is_online.js</file>
Expand All @@ -70,8 +61,6 @@
<file>third_party/webdriver-atoms/scroll_mouse.js</file>
<file>third_party/webdriver-atoms/set_local_storage_item.js</file>
<file>third_party/webdriver-atoms/set_session_storage_item.js</file>
<file>third_party/webdriver-atoms/set_window_position.js</file>
<file>third_party/webdriver-atoms/set_window_size.js</file>
<file>third_party/webdriver-atoms/submit.js</file>
<file>third_party/webdriver-atoms/swipe.js</file>
<file>third_party/webdriver-atoms/tap.js</file>
Expand Down
2 changes: 1 addition & 1 deletion src/ghostdriver/hub_register.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down
3 changes: 2 additions & 1 deletion src/ghostdriver/inputs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2010, Jim Evans <[email protected]> - Salesforce.com
Copyright (c) 2014, Jim Evans <[email protected]> - Salesforce.com
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down
8 changes: 4 additions & 4 deletions src/ghostdriver/lastupdate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2013-07-25 23:22:39
2014-01-04 16:44:10

commit e3c255e66f99fd34fbf03269b8dc44bafdda940a (HEAD, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/heads/master)
commit 491a60b0adf78e6d7a4eff980de81bb3eb8c764d (HEAD, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/heads/master)
Author: Ivan De Marino <[email protected]>
Date: Thu Jul 25 00:21:44 2013 +0100
Date: Thu Jan 2 23:02:21 2014 +0000

Log "page.onError".
Updated CHANGELOG to mention upgraded Atoms in 1.1.0
2 changes: 1 addition & 1 deletion src/ghostdriver/logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down
8 changes: 4 additions & 4 deletions src/ghostdriver/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -35,7 +35,7 @@ ghostdriver = {
hub : require("./hub_register.js"),
logger : require("./logger.js"),
config : null, //< this will be set below
version : "1.0.4"
version : "1.1.0"
};

// create logger
Expand Down Expand Up @@ -66,7 +66,7 @@ try {
router = new ghostdriver.RouterReqHand();

// Start the server
if (server.listen(ghostdriver.config.port, router.handle)) {
if (server.listen(ghostdriver.config.port, { "keepAlive" : true }, router.handle)) {
_log.info("Main", "running on port " + server.port);

// If a Selenium Grid HUB was provided, register to it!
Expand All @@ -83,6 +83,6 @@ try {
phantom.exit(1);
}
} catch (e) {
_log.error("Main", e.message + " => "+ JSON.stringify(e, null, " "));
_log.error("main.fail", JSON.stringify(e));
phantom.exit(1);
}
4 changes: 1 addition & 3 deletions src/ghostdriver/request_handlers/request_handler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -96,8 +96,6 @@ ghostdriver.RequestHandler = function() {
},

_respondBasedOnResultDecorator = function(session, req, result) {
//console.log("respondBasedOnResult => "+JSON.stringify(result));

// Convert string to JSON
if (typeof(result) === "string") {
try {
Expand Down
6 changes: 3 additions & 3 deletions src/ghostdriver/request_handlers/router_request_handler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -56,7 +56,7 @@ ghostdriver.RouterReqHand = function() {
// Invoke parent implementation
_protoParent.handle.call(this, req, res);

_log.debug("_handle", "Request => " + JSON.stringify(req, null, " "));
_log.debug("_handle", JSON.stringify(req));

try {
if (req.urlParsed.chunks.length === 1 && req.urlParsed.file === _const.STATUS) { // GET '/status'
Expand All @@ -83,7 +83,7 @@ ghostdriver.RouterReqHand = function() {
throw _errors.createInvalidReqUnknownCommandEH(req);
}
} catch (e) {
_log.error("_handle", "Thrown => " + JSON.stringify(e, null, " "));
_log.error("_handle.error", JSON.stringify(e));

if (typeof(e.handle) === "function") {
e.handle(res);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>.
Copyright (c) 2012, Ivan De Marino <http://ivandemarino.me>
Copyright (c) 2014, Ivan De Marino <http://ivandemarino.me>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down
Loading

0 comments on commit a9a219e

Please sign in to comment.