From bf940e51c835450577e5d42a47cd386170d0ef46 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Wed, 4 Nov 2015 14:38:01 -0500 Subject: [PATCH] Installed Selenium driver. --- composer.json | 1 + composer.lock | 339 +++-- vendor/behat/mink-selenium2-driver/.gitignore | 4 + .../behat/mink-selenium2-driver/.travis.yml | 43 + .../behat/mink-selenium2-driver/CHANGELOG.md | 55 + vendor/behat/mink-selenium2-driver/README.md | 60 + .../bin/run-phantomjs.sh | 13 + .../mink-selenium2-driver/bin/run-selenium.sh | 12 + .../behat/mink-selenium2-driver/composer.json | 49 + .../mink-selenium2-driver/phpunit.xml.dist | 30 + .../src/Resources/syn.js | 67 + .../src/Selenium2Driver.php | 1097 +++++++++++++++++ .../tests/Custom/TimeoutTest.php | 39 + .../tests/Custom/WebDriverTest.php | 19 + .../tests/Custom/WindowNameTest.php | 29 + .../tests/Selenium2Config.php | 80 ++ vendor/composer/autoload_namespaces.php | 1 + vendor/composer/autoload_psr4.php | 2 +- vendor/composer/installed.json | 123 ++ .../instaclick/php-webdriver/.coveralls.yml | 1 + vendor/instaclick/php-webdriver/.gitignore | 5 + vendor/instaclick/php-webdriver/.travis.yml | 17 + vendor/instaclick/php-webdriver/README.md | 25 + vendor/instaclick/php-webdriver/composer.json | 42 + vendor/instaclick/php-webdriver/doc/README.md | 202 +++ .../lib/WebDriver/AbstractWebDriver.php | 229 ++++ .../lib/WebDriver/AppCacheStatus.php | 42 + .../lib/WebDriver/ApplicationCache.php | 42 + .../php-webdriver/lib/WebDriver/Browser.php | 52 + .../lib/WebDriver/Capability.php | 67 + .../lib/WebDriver/ClassLoader.php | 85 ++ .../php-webdriver/lib/WebDriver/Container.php | 229 ++++ .../php-webdriver/lib/WebDriver/Element.php | 124 ++ .../php-webdriver/lib/WebDriver/Exception.php | 157 +++ .../lib/WebDriver/Exception/CurlExec.php | 33 + .../Exception/ElementIsNotSelectable.php | 33 + .../WebDriver/Exception/ElementNotVisible.php | 33 + .../Exception/IMEEngineActivationFailed.php | 33 + .../WebDriver/Exception/IMENotAvailable.php | 33 + .../Exception/InvalidCookieDomain.php | 33 + .../Exception/InvalidElementCoordinates.php | 33 + .../Exception/InvalidElementState.php | 33 + .../WebDriver/Exception/InvalidRequest.php | 33 + .../WebDriver/Exception/InvalidSelector.php | 33 + .../WebDriver/Exception/JavaScriptError.php | 33 + .../Exception/JsonParameterExpected.php | 33 + .../Exception/MoveTargetOutOfBounds.php | 33 + .../WebDriver/Exception/NoAlertOpenError.php | 33 + .../Exception/NoParametersExpected.php | 33 + .../lib/WebDriver/Exception/NoSuchDriver.php | 33 + .../lib/WebDriver/Exception/NoSuchElement.php | 33 + .../lib/WebDriver/Exception/NoSuchFrame.php | 33 + .../lib/WebDriver/Exception/NoSuchWindow.php | 33 + .../WebDriver/Exception/ObsoleteCommand.php | 33 + .../lib/WebDriver/Exception/ScriptTimeout.php | 33 + .../WebDriver/Exception/SessionNotCreated.php | 33 + .../Exception/StaleElementReference.php | 33 + .../lib/WebDriver/Exception/Timeout.php | 33 + .../WebDriver/Exception/UnableToSetCookie.php | 33 + .../Exception/UnexpectedAlertOpen.php | 33 + .../Exception/UnexpectedParameters.php | 33 + .../WebDriver/Exception/UnknownCommand.php | 33 + .../lib/WebDriver/Exception/UnknownError.php | 33 + .../Exception/UnknownLocatorStrategy.php | 33 + .../WebDriver/Exception/XPathLookupError.php | 33 + .../php-webdriver/lib/WebDriver/Frame.php | 42 + .../php-webdriver/lib/WebDriver/Ime.php | 50 + .../php-webdriver/lib/WebDriver/Key.php | 96 ++ .../lib/WebDriver/LocatorStrategy.php | 40 + .../php-webdriver/lib/WebDriver/Log.php | 42 + .../php-webdriver/lib/WebDriver/LogType.php | 42 + .../lib/WebDriver/SauceLabs/Capability.php | 76 ++ .../lib/WebDriver/SauceLabs/SauceRest.php | 310 +++++ .../lib/WebDriver/Service/CurlService.php | 110 ++ .../Service/CurlServiceInterface.php | 45 + .../lib/WebDriver/ServiceFactory.php | 108 ++ .../php-webdriver/lib/WebDriver/Session.php | 436 +++++++ .../php-webdriver/lib/WebDriver/Storage.php | 146 +++ .../php-webdriver/lib/WebDriver/Timeouts.php | 76 ++ .../php-webdriver/lib/WebDriver/Touch.php | 56 + .../php-webdriver/lib/WebDriver/WebDriver.php | 98 ++ .../php-webdriver/lib/WebDriver/Window.php | 89 ++ .../instaclick/php-webdriver/phpdoc.dist.xml | 31 + .../instaclick/php-webdriver/phpunit.xml.dist | 31 + .../test/Test/WebDriver/ExceptionTest.php | 52 + .../test/Test/WebDriver/StorageTest.php | 46 + .../test/Test/WebDriver/WebDriverTest.php | 100 ++ 87 files changed, 6416 insertions(+), 111 deletions(-) create mode 100644 vendor/behat/mink-selenium2-driver/.gitignore create mode 100644 vendor/behat/mink-selenium2-driver/.travis.yml create mode 100644 vendor/behat/mink-selenium2-driver/CHANGELOG.md create mode 100644 vendor/behat/mink-selenium2-driver/README.md create mode 100644 vendor/behat/mink-selenium2-driver/bin/run-phantomjs.sh create mode 100644 vendor/behat/mink-selenium2-driver/bin/run-selenium.sh create mode 100644 vendor/behat/mink-selenium2-driver/composer.json create mode 100644 vendor/behat/mink-selenium2-driver/phpunit.xml.dist create mode 100644 vendor/behat/mink-selenium2-driver/src/Resources/syn.js create mode 100644 vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php create mode 100644 vendor/behat/mink-selenium2-driver/tests/Custom/TimeoutTest.php create mode 100644 vendor/behat/mink-selenium2-driver/tests/Custom/WebDriverTest.php create mode 100644 vendor/behat/mink-selenium2-driver/tests/Custom/WindowNameTest.php create mode 100644 vendor/behat/mink-selenium2-driver/tests/Selenium2Config.php create mode 100644 vendor/instaclick/php-webdriver/.coveralls.yml create mode 100644 vendor/instaclick/php-webdriver/.gitignore create mode 100644 vendor/instaclick/php-webdriver/.travis.yml create mode 100644 vendor/instaclick/php-webdriver/README.md create mode 100644 vendor/instaclick/php-webdriver/composer.json create mode 100644 vendor/instaclick/php-webdriver/doc/README.md create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/AppCacheStatus.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/ApplicationCache.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Browser.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Capability.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/ClassLoader.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Container.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Element.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/CurlExec.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementIsNotSelectable.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementNotVisible.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMEEngineActivationFailed.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMENotAvailable.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidCookieDomain.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementCoordinates.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementState.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidRequest.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidSelector.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JavaScriptError.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JsonParameterExpected.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/MoveTargetOutOfBounds.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoAlertOpenError.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoParametersExpected.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchDriver.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchElement.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchFrame.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchWindow.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ObsoleteCommand.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ScriptTimeout.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/SessionNotCreated.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/StaleElementReference.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/Timeout.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnableToSetCookie.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedAlertOpen.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedParameters.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownCommand.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownError.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownLocatorStrategy.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Exception/XPathLookupError.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Frame.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Ime.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Key.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/LocatorStrategy.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Log.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/LogType.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/Capability.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/SauceRest.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlService.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlServiceInterface.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/ServiceFactory.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Session.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Storage.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Timeouts.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Touch.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/WebDriver.php create mode 100644 vendor/instaclick/php-webdriver/lib/WebDriver/Window.php create mode 100644 vendor/instaclick/php-webdriver/phpdoc.dist.xml create mode 100644 vendor/instaclick/php-webdriver/phpunit.xml.dist create mode 100644 vendor/instaclick/php-webdriver/test/Test/WebDriver/ExceptionTest.php create mode 100644 vendor/instaclick/php-webdriver/test/Test/WebDriver/StorageTest.php create mode 100644 vendor/instaclick/php-webdriver/test/Test/WebDriver/WebDriverTest.php diff --git a/composer.json b/composer.json index 1c305c09aec..d8ac6710510 100644 --- a/composer.json +++ b/composer.json @@ -54,6 +54,7 @@ }, "require-dev": { "behat/mink": "1.7.0", + "behat/mink-selenium2-driver": "1.3.0", "behat/mink-zombie-driver": "1.3.0" } } diff --git a/composer.lock b/composer.lock index 40bd1366fd8..4b8d070e19e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d9e4891b308b5a643f2e03962bb5a048", - "content-hash": "f626d06e9c07fc5d23349944b72d9fc0", + "hash": "9420a0bbc2e584b4023a6c43958b1a07", + "content-hash": "a0447b7d3321558bb291167cabb9097d", "packages": [ { "name": "aferrandini/phpqrcode", @@ -51,6 +51,125 @@ ], "time": "2013-07-08 09:39:08" }, + { + "name": "behat/mink", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "~2.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2015-09-20 20:24:03" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2015-09-21 21:02:54" + }, { "name": "cap60552/php-sip2", "version": "v1.0.0", @@ -86,6 +205,64 @@ "homepage": "https://github.com/cap60552/php-sip2", "time": "2015-11-03 04:42:39" }, + { + "name": "instaclick/php-webdriver", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2015-06-15 20:19:33" + }, { "name": "jasig/phpcas", "version": "1.3.3", @@ -614,6 +791,56 @@ "description": "Library for interacting with Serials Solutions' Summon API.", "time": "2013-11-13 19:07:09" }, + { + "name": "symfony/css-selector", + "version": "v2.7.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "e1b865b26be4a56d22a8dee398375044a80c865b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/e1b865b26be4a56d22a8dee398375044a80c865b", + "reference": "e1b865b26be4a56d22a8dee398375044a80c865b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2015-10-11 09:39:48" + }, { "name": "symfony/yaml", "version": "v2.7.6", @@ -1138,64 +1365,6 @@ } ], "packages-dev": [ - { - "name": "behat/mink", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/Mink.git", - "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/6c129030ec2cc029905cf969a56ca8f087b2dfdf", - "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": "~2.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "suggest": { - "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", - "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", - "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", - "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Mink\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Browser controller/emulator abstraction for PHP", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "testing", - "web" - ], - "time": "2015-09-20 20:24:03" - }, { "name": "behat/mink-zombie-driver", "version": "v1.3.0", @@ -1258,56 +1427,6 @@ ], "time": "2015-09-21 21:07:53" }, - { - "name": "symfony/css-selector", - "version": "v2.7.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "e1b865b26be4a56d22a8dee398375044a80c865b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/e1b865b26be4a56d22a8dee398375044a80c865b", - "reference": "e1b865b26be4a56d22a8dee398375044a80c865b", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" - }, { "name": "symfony/process", "version": "v2.7.6", diff --git a/vendor/behat/mink-selenium2-driver/.gitignore b/vendor/behat/mink-selenium2-driver/.gitignore new file mode 100644 index 00000000000..1d034f43f76 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/.gitignore @@ -0,0 +1,4 @@ +vendor +composer.phar +composer.lock +phpunit.xml diff --git a/vendor/behat/mink-selenium2-driver/.travis.yml b/vendor/behat/mink-selenium2-driver/.travis.yml new file mode 100644 index 00000000000..b66b25e32e4 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/.travis.yml @@ -0,0 +1,43 @@ +language: php + +sudo: false + +cache: + directories: + - $HOME/.composer/cache/files + +php: [5.3, 5.4, 5.5, 5.6, hhvm] + +env: + - WEBDRIVER=selenium + +matrix: + allow_failures: + - env: 'WEBDRIVER=phantomjs' + - env: WEBDRIVER=phantomjs PHANTOM_VERSION=2 + fast_finish: true + include: + - php: 5.5 + env: WEBDRIVER=phantomjs + - php: 5.5 + env: WEBDRIVER=phantomjs PHANTOM_VERSION=2 + +before_script: + - export WEB_FIXTURES_HOST=http://localhost:8000 + - export WEB_FIXTURES_BROWSER=firefox + + - sh bin/run-"$WEBDRIVER".sh + + - composer install --prefer-source + + # Start a webserver for web fixtures. Force using PHP 5.6 to be able to run it on PHP 5.3 and HHVM jobs too + - ~/.phpenv/versions/5.6/bin/php -S localhost:8000 -t vendor/behat/mink/driver-testsuite/web-fixtures > /dev/null 2>&1 & + +script: phpunit -v --coverage-clover=coverage.clover + +after_script: + - wget https://scrutinizer-ci.com/ocular.phar + - php ocular.phar code-coverage:upload --format=php-clover coverage.clover + +after_failure: + - cat /tmp/webdriver_output.txt diff --git a/vendor/behat/mink-selenium2-driver/CHANGELOG.md b/vendor/behat/mink-selenium2-driver/CHANGELOG.md new file mode 100644 index 00000000000..ccee61cd173 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/CHANGELOG.md @@ -0,0 +1,55 @@ +1.3.0 / 2015-09-21 +================== + +New features: + +* Updated the driver to use findElementsXpaths for Mink 1.7 and forward compatibility with Mink 2 + +Testsuite: + +* Fixed the window name test for the chrome driver +* Add testing on PhantomJS 2 + +Misc: + +* Updated the repository structure to PSR-4 + +1.2.0 / 2014-09-29 +================== + +BC break: + +* Changed the behavior of `getValue` for checkboxes according to the BC break in Mink 1.6 + +New features: + +* Added the support of the `chromeOptions` argument in capabilities +* Added the support of select elements in `setValue` +* Added the support of checbox and radio elements in `setValue` +* Added the support of HTML5 input types in `setValue` (for those supported by WebDriver itself) +* Added `getWebDriverSessionId` to get the WebDriver session id +* Added a way to configure the webdriver timeouts +* Implemented `getOuterHtml` +* Implemented `getWindowNames` and `getWindowName` +* Implemented `maximizeWindow` +* Implemented `submitForm` +* Implemented `isSelected` + +Bug fixes: + +* Fixed the selection of options for radio groups +* Fixed `getValue` for radio groups +* Fixed the selection of options for multiple selects to ensure the change event is triggered only once +* Fixed mouse interactions to use the webDriver API rather than using JS and emulating events +* Fixed duplicate change events being triggered when setting the value +* Fixed the code to throw exceptions for invalid usages of the driver +* Fixed the implementation of `mouseOver` +* Fixed `evaluateScript` and `executeScript` to support all syntaxes required by the Mink API +* Fixed the retrieval of HTML attributes in `getAttribute` +* Fixed form interactions to use the webDriver API rather than using JS and emulating change events +* Fixed the clearing of the value when the caret is at the beginning of the field in `setValue` + +Testing: + +* Updated the testsuite to use the new Mink 1.6 driver testsuite +* Added testing on HHVM diff --git a/vendor/behat/mink-selenium2-driver/README.md b/vendor/behat/mink-selenium2-driver/README.md new file mode 100644 index 00000000000..3c9fec0be3e --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/README.md @@ -0,0 +1,60 @@ +Mink Selenium2 (webdriver) Driver +================================= +[](https://packagist.org/packages/behat/mink-selenium2-driver) +[](https://packagist.org/packages/behat/mink-selenium2-driver) +[](https://packagist.org/packages/behat/mink-selenium2-driver) +[](https://travis-ci.org/minkphp/MinkSelenium2Driver) +[](https://scrutinizer-ci.com/g/minkphp/MinkSelenium2Driver/) +[](https://scrutinizer-ci.com/g/minkphp/MinkSelenium2Driver/) +[](https://packagist.org/packages/behat/mink-selenium2-driver) + +Usage Example +------------- + +``` php +<?php + +use Behat\Mink\Mink, + Behat\Mink\Session, + Behat\Mink\Driver\Selenium2Driver; + +use Selenium\Client as SeleniumClient; + +$url = 'http://example.com'; + +$mink = new Mink(array( + 'selenium2' => new Session(new Selenium2Driver($browser, null, $url)), +)); + +$mink->getSession('selenium2')->getPage()->findLink('Chat')->click(); +``` + +Please refer to [MinkExtension-example](https://github.com/Behat/MinkExtension-example) for an executable example. + +Installation +------------ + +``` json +{ + "require": { + "behat/mink": "~1.5", + "behat/mink-selenium2-driver": "~1.1" + } +} +``` + +``` bash +$> curl -sS http://getcomposer.org/installer | php +$> php composer.phar install +``` + +Copyright +--------- + +Copyright (c) 2012 Pete Otaqui <pete@otaqui.com>. + +Maintainers +----------- + +* Christophe Coevoet [stof](https://github.com/stof) +* Pete Otaqui [pete-otaqui](http://github.com/pete-otaqui) diff --git a/vendor/behat/mink-selenium2-driver/bin/run-phantomjs.sh b/vendor/behat/mink-selenium2-driver/bin/run-phantomjs.sh new file mode 100644 index 00000000000..717b9ec1eaa --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/bin/run-phantomjs.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +set -e + +if [ "2" = "$PHANTOM_VERSION" ]; then + mkdir travis-phantomjs + wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 + tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs + export PATH=$PWD/travis-phantomjs:$PATH +fi + +phantomjs --version +echo ' Running PhantomJS' +phantomjs --webdriver=4444 > /tmp/webdriver_output.txt & diff --git a/vendor/behat/mink-selenium2-driver/bin/run-selenium.sh b/vendor/behat/mink-selenium2-driver/bin/run-selenium.sh new file mode 100644 index 00000000000..13d1aaeb90a --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/bin/run-selenium.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh +set -e + +echo ' Starting XVFB' +sh -e /etc/init.d/xvfb start +export DISPLAY=:99.0 +sleep 4 + +echo ' Downloading selenium' +curl -L http://selenium-release.storage.googleapis.com/2.46/selenium-server-standalone-2.46.0.jar > selenium.jar +echo ' Running selenium' +java -jar selenium.jar > /dev/null 2>&1 & diff --git a/vendor/behat/mink-selenium2-driver/composer.json b/vendor/behat/mink-selenium2-driver/composer.json new file mode 100644 index 00000000000..948b295237a --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/composer.json @@ -0,0 +1,49 @@ +{ + "name": "behat/mink-selenium2-driver", + "description": "Selenium2 (WebDriver) driver for Mink framework", + "keywords": ["selenium", "webdriver", "javascript", "ajax", "testing", "browser"], + "homepage": "http://mink.behat.org/", + "type": "mink-driver", + "license": "MIT", + + "authors": [ + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + }, + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + + "require": { + "php": ">=5.3.1", + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1" + }, + + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + + "autoload-dev": { + "psr-4": { + "Behat\\Mink\\Tests\\Driver\\": "tests" + } + }, + + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + } +} diff --git a/vendor/behat/mink-selenium2-driver/phpunit.xml.dist b/vendor/behat/mink-selenium2-driver/phpunit.xml.dist new file mode 100644 index 00000000000..13e8087464f --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/phpunit.xml.dist @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit colors="true" bootstrap="vendor/behat/mink/driver-testsuite/bootstrap.php"> + <testsuites> + <testsuite name="Driver test suite"> + <directory>tests</directory> + <directory>vendor/behat/mink/driver-testsuite/tests</directory> + </testsuite> + </testsuites> + + <php> + <var name="driver_config_factory" value="Behat\Mink\Tests\Driver\Selenium2Config::getInstance" /> + + <!--server name="WEB_FIXTURES_HOST" value="http://test.mink.dev" /--> + <!--server name="WEB_FIXTURES_BROWSER" value="firefox" /--> + + <!-- where driver will connect to --> + <server name="DRIVER_URL" value="http://localhost:4444/wd/hub" /> + + <!-- where DocumentRoot of 'Test Machine' is mounted to on 'Driver Machine' (only if these are 2 different machines) --> + <!--server name="DRIVER_MACHINE_BASE_PATH" value="" /--> + <!--server name="TEST_MACHINE_BASE_PATH" value="" /--> + </php> + + <filter> + <whitelist> + <directory>./src</directory> + </whitelist> + </filter> +</phpunit> diff --git a/vendor/behat/mink-selenium2-driver/src/Resources/syn.js b/vendor/behat/mink-selenium2-driver/src/Resources/syn.js new file mode 100644 index 00000000000..8c07bf89595 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/src/Resources/syn.js @@ -0,0 +1,67 @@ +/* +Syn - a Standalone Synthetic Event Library. + +Syn is used to simulate user actions such as typing, clicking, dragging +the mouse. It creates synthetic events and performs default event behavior. + +http://jupiterjs.com/news/syn-a-standalone-synthetic-event-library + +*/(function(){var e=function(k,a){for(var b in a)k[b]=a[b];return k},j={msie:!(!window.attachEvent||window.opera),opera:!!window.opera,webkit:-1<navigator.userAgent.indexOf("AppleWebKit/"),safari:-1<navigator.userAgent.indexOf("AppleWebKit/")&&-1===navigator.userAgent.indexOf("Chrome/"),gecko:-1<navigator.userAgent.indexOf("Gecko"),mobilesafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/),rhino:navigator.userAgent.match(/Rhino/)&&!0},m=function(k,a,b){k=b.ownerDocument.createEventObject();return e(k, +a)},h={},i=1,a="_synthetic"+(new Date).getTime(),b,d,g=/keypress|keyup|keydown/,c=/load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll/,l,f=function(k,a,b,g){return new f.init(k,a,b,g)};b=function(k,a,b){return k.addEventListener?k.addEventListener(a,b,!1):k.attachEvent("on"+a,b)};d=function(k,a,b){return k.addEventListener?k.removeEventListener(a,b,!1):k.detachEvent("on"+a,b)};e(f,{init:function(k,a,b,g){var c=f.args(a,b,g),d=this;this.queue=[];this.element=c.element;if("function"=== +typeof this[k])this[k](c.options,c.element,function(k,a){c.callback&&c.callback.apply(d,arguments);d.done.apply(d,arguments)});else this.result=f.trigger(k,c.options,c.element),c.callback&&c.callback.call(this,c.element,this.result)},jquery:function(k){return window.FuncUnit&&window.FuncUnit.jquery?window.FuncUnit.jquery:k?f.helpers.getWindow(k).jQuery||window.jQuery:window.jQuery},args:function(){for(var k={},a=0;a<arguments.length;a++)if("function"===typeof arguments[a])k.callback=arguments[a]; +else if(arguments[a]&&arguments[a].jquery)k.element=arguments[a][0];else if(arguments[a]&&arguments[a].nodeName)k.element=arguments[a];else if(k.options&&"string"===typeof arguments[a])k.element=document.getElementById(arguments[a]);else if(arguments[a])k.options=arguments[a];return k},click:function(a,b,c){f("click!",a,b,c)},defaults:{focus:function(){if(!f.support.focusChanges){var a=this,c=a.nodeName.toLowerCase();f.data(a,"syntheticvalue",a.value);("input"===c||"textarea"===c)&&b(a,"blur",function(){f.data(a, +"syntheticvalue")!=a.value&&f.trigger("change",{},a);d(a,"blur",arguments.callee)})}},submit:function(){f.onParents(this,function(a){if("form"===a.nodeName.toLowerCase())return a.submit(),!1})}},changeOnBlur:function(a,c,g){b(a,"blur",function(){g!==a[c]&&f.trigger("change",{},a);d(a,"blur",arguments.callee)})},closest:function(a,b){for(;a&&a.nodeName.toLowerCase()!==b.toLowerCase();)a=a.parentNode;return a},data:function(b,c,g){b[a]||(b[a]=i++);h[b[a]]||(h[b[a]]={});if(g)h[b[a]][c]=g;else return h[b[a]][c]}, +onParents:function(a,b){for(var c;a&&!1!==c;)c=b(a),a=a.parentNode;return a},focusable:/^(a|area|frame|iframe|label|input|select|textarea|button|html|object)$/i,isFocusable:function(a){var b;return(this.focusable.test(a.nodeName)||(b=a.getAttributeNode("tabIndex"))&&b.specified)&&f.isVisible(a)},isVisible:function(a){return a.offsetWidth&&a.offsetHeight||a.clientWidth&&a.clientHeight},tabIndex:function(a){var b=a.getAttributeNode("tabIndex");return b&&b.specified&&(parseInt(a.getAttribute("tabIndex"))|| +0)},bind:b,unbind:d,browser:j,helpers:{createEventObject:m,createBasicStandardEvent:function(a,b,c){var g;try{g=c.createEvent("Events")}catch(f){g=c.createEvent("UIEvents")}finally{g.initEvent(a,!0,!0),e(g,b)}return g},inArray:function(a,b){for(var c=0;c<b.length;c++)if(b[c]===a)return c;return-1},getWindow:function(a){return a.ownerDocument.defaultView||a.ownerDocument.parentWindow},extend:e,scrollOffset:function(a,b){var c=a.document.documentElement,g=a.document.body;if(b)window.scrollTo(b.left, +b.top);else return{left:(c&&c.scrollLeft||g&&g.scrollLeft||0)+(c.clientLeft||0),top:(c&&c.scrollTop||g&&g.scrollTop||0)+(c.clientTop||0)}},scrollDimensions:function(a){var b=a.document.documentElement,c=a.document.body,g=b.clientWidth,b=b.clientHeight,a="CSS1Compat"===a.document.compatMode;return{height:a&&b||c.clientHeight||b,width:a&&g||c.clientWidth||g}},addOffset:function(a,b){var c=f.jquery(b);if("object"===typeof a&&void 0===a.clientX&&void 0===a.clientY&&void 0===a.pageX&&void 0===a.pageY&& +c)b=c(b),c=b.offset(),a.pageX=c.left+b.width()/2,a.pageY=c.top+b.height()/2}},key:{ctrlKey:null,altKey:null,shiftKey:null,metaKey:null},dispatch:function(a,c,g,f){if(c.dispatchEvent&&a){var l=a.preventDefault,h=f?-1:0;f&&b(c,g,function(a){a.preventDefault();d(this,g,arguments.callee)});a.preventDefault=function(){h++;0<++h&&l.apply(this,[])};c.dispatchEvent(a);return 0>=h}try{window.event=a}catch(e){}return 0>=c.sourceIndex||c.fireEvent&&c.fireEvent("on"+g,a)},create:{page:{event:function(a,b,c){var g= +f.helpers.getWindow(c).document||document,d;if(g.createEvent)d=g.createEvent("Events"),d.initEvent(a,!0,!0);else try{d=m(a,b,c)}catch(l){}return d}},focus:{event:function(a,b,c){f.onParents(c,function(a){if(f.isFocusable(a)){if("html"!==a.nodeName.toLowerCase())a.focus(),l=a;else if(l)a=f.helpers.getWindow(c).document,a===window.document&&(a.activeElement?a.activeElement.blur():l.blur(),l=null);return!1}});return!0}}},support:{clickChanges:!1,clickSubmits:!1,keypressSubmits:!1,mouseupSubmits:!1,radioClickChanges:!1, +focusChanges:!1,linkHrefJS:!1,keyCharacters:!1,backspaceWorks:!1,mouseDownUpClicks:!1,tabKeyTabs:!1,keypressOnAnchorClicks:!1,optionClickBubbles:!1,ready:0},trigger:function(a,b,d){b||(b={});var l=f.create,h=l[a]&&l[a].setup,e=g.test(a)?"key":c.test(a)?"page":"mouse",i=l[a]||{},e=l[e],l=d;2===f.support.ready&&h&&h(a,b,d);h=b._autoPrevent;delete b._autoPrevent;if(i.event)i=i.event(a,b,d);else{b=e.options?e.options(a,b,d):b;if(!f.support.changeBubbles&&/option/i.test(d.nodeName))l=d.parentNode;i=e.event(a, +b,l);i=f.dispatch(i,l,a,h)}i&&2===f.support.ready&&f.defaults[a]&&f.defaults[a].call(d,b,h);return i},eventSupported:function(a){var b=document.createElement("div"),a="on"+a,c=a in b;c||(b.setAttribute(a,"return;"),c="function"===typeof b[a]);return c}});e(f.init.prototype,{then:function(a,b,c,g){f.autoDelay&&this.delay();var d=f.args(b,c,g),l=this;this.queue.unshift(function(b){if("function"===typeof this[a])this.element=d.element||b,this[a](d.options,this.element,function(a,b){d.callback&&d.callback.apply(l, +arguments);l.done.apply(l,arguments)});else return this.result=f.trigger(a,d.options,d.element),d.callback&&d.callback.call(this,d.element,this.result),this});return this},delay:function(a,b){"function"===typeof a&&(b=a,a=null);var a=a||600,c=this;this.queue.unshift(function(){setTimeout(function(){b&&b.apply(c,[]);c.done.apply(c,arguments)},a)});return this},done:function(a,b){b&&(this.element=b);this.queue.length&&this.queue.pop().call(this,this.element,a)},_click:function(a,b,c,g){f.helpers.addOffset(a, +b);f.trigger("mousedown",a,b);setTimeout(function(){f.trigger("mouseup",a,b);!f.support.mouseDownUpClicks||g?(f.trigger("click",a,b),c(!0)):(f.create.click.setup("click",a,b),f.defaults.click.call(b),setTimeout(function(){c(!0)},1))},1)},_rightClick:function(a,b,c){f.helpers.addOffset(a,b);var g=e(e({},f.mouse.browser.right.mouseup),a);f.trigger("mousedown",g,b);setTimeout(function(){f.trigger("mouseup",g,b);f.mouse.browser.right.contextmenu&&f.trigger("contextmenu",e(e({},f.mouse.browser.right.contextmenu), +a),b);c(!0)},1)},_dblclick:function(a,b,c){f.helpers.addOffset(a,b);var g=this;this._click(a,b,function(){setTimeout(function(){g._click(a,b,function(){f.trigger("dblclick",a,b);c(!0)},!0)},2)})}});for(var j="click,dblclick,move,drag,key,type,rightClick".split(","),v=function(a){f[a]=function(b,c,g){return f("_"+a,b,c,g)};f.init.prototype[a]=function(b,c,g){return this.then("_"+a,b,c,g)}},r=0;r<j.length;r++)v(j[r]);if(window.FuncUnit&&window.FuncUnit.jQuery||window.jQuery)(window.FuncUnit&&window.FuncUnit.jQuery|| +window.jQuery).fn.triggerSyn=function(a,b,c){f(a,b,this[0],c);return this};window.Syn=f})(!0); +(function(){var e=Syn.helpers,j=e.getWindow;Syn.mouse={};e.extend(Syn.defaults,{mousedown:function(){Syn.trigger("focus",{},this)},click:function(){var e=Syn.data(this,"radioChanged"),h=j(this),i=this.nodeName.toLowerCase();if(!Syn.support.linkHrefJS&&/^\s*javascript:/.test(this.href)){var a=this.href.replace(/^\s*javascript:/,"");"//"!=a&&-1==a.indexOf("void(0)")&&(window.selenium?eval("with(selenium.browserbot.getCurrentWindow()){"+a+"}"):eval("with(scope){"+a+"}"))}if(!Syn.support.clickSubmits&& +"input"==i&&"submit"==this.type||"button"==i)(a=Syn.closest(this,"form"))&&Syn.trigger("submit",{},a);if("a"==i&&this.href&&!/^\s*javascript:/.test(this.href))h.location.href=this.href;"input"==i&&"checkbox"==this.type&&(Syn.support.clickChanges||Syn.trigger("change",{},this));"input"==i&&"radio"==this.type&&e&&!Syn.support.radioClickChanges&&Syn.trigger("change",{},this);"option"==i&&Syn.data(this,"createChange")&&(Syn.trigger("change",{},this.parentNode),Syn.data(this,"createChange",!1))}});e.extend(Syn.create, +{mouse:{options:function(j,h){var i=document.documentElement,a=document.body,b=[h.pageX||0,h.pageY||0],d=Syn.mouse.browser&&Syn.mouse.browser.left[j],g=Syn.mouse.browser&&Syn.mouse.browser.right[j];return e.extend({bubbles:!0,cancelable:!0,view:window,detail:1,screenX:1,screenY:1,clientX:h.clientX||b[0]-(i&&i.scrollLeft||a&&a.scrollLeft||0)-(i.clientLeft||0),clientY:h.clientY||b[1]-(i&&i.scrollTop||a&&a.scrollTop||0)-(i.clientTop||0),ctrlKey:!!Syn.key.ctrlKey,altKey:!!Syn.key.altKey,shiftKey:!!Syn.key.shiftKey, +metaKey:!!Syn.key.metaKey,button:d&&null!=d.button?d.button:g&&g.button||("contextmenu"==j?2:0),relatedTarget:document.documentElement},h)},event:function(m,h,i){var a=j(i).document||document;if(a.createEvent){var b;try{b=a.createEvent("MouseEvents"),b.initMouseEvent(m,h.bubbles,h.cancelable,h.view,h.detail,h.screenX,h.screenY,h.clientX,h.clientY,h.ctrlKey,h.altKey,h.shiftKey,h.metaKey,h.button,h.relatedTarget)}catch(d){b=e.createBasicStandardEvent(m,h,a)}b.synthetic=!0}else try{b=e.createEventObject(m, +h,i)}catch(g){}return b}},click:{setup:function(e,h,i){h=i.nodeName.toLowerCase();if(!Syn.support.clickChecks&&!Syn.support.changeChecks&&"input"===h){e=i.type.toLowerCase();if("checkbox"===e)i.checked=!i.checked;if("radio"===e&&!i.checked){try{Syn.data(i,"radioChanged",!0)}catch(a){}i.checked=!0}}"a"==h&&i.href&&!/^\s*javascript:/.test(i.href)&&Syn.data(i,"href",i.href);if(/option/i.test(i.nodeName)){e=i.parentNode.firstChild;for(h=-1;e&&!(1==e.nodeType&&(h++,e==i));)e=e.nextSibling;if(h!==i.parentNode.selectedIndex)i.parentNode.selectedIndex= +h,Syn.data(i,"createChange",!0)}}},mousedown:{setup:function(e,h,i){e=i.nodeName.toLowerCase();if(Syn.browser.safari&&("select"==e||"option"==e))h._autoPrevent=!0}}});(function(){if(document.body){var e=window.__synthTest;window.__synthTest=function(){Syn.support.linkHrefJS=!0};var h=document.createElement("div"),i,a,b,d;h.innerHTML="<form id='outer'><input name='checkbox' type='checkbox'/><input name='radio' type='radio' /><input type='submit' name='submitter'/><input type='input' name='inputter'/><input name='one'><input name='two'/><a href='javascript:__synthTest()' id='synlink'></a><select><option></option></select></form>"; +document.documentElement.appendChild(h);b=h.firstChild;i=b.childNodes[0];a=b.childNodes[2];d=b.getElementsByTagName("select")[0];i.checked=!1;i.onchange=function(){Syn.support.clickChanges=!0};Syn.trigger("click",{},i);Syn.support.clickChecks=i.checked;i.checked=!1;Syn.trigger("change",{},i);Syn.support.changeChecks=i.checked;b.onsubmit=function(a){a.preventDefault&&a.preventDefault();Syn.support.clickSubmits=!0;return!1};Syn.trigger("click",{},a);b.childNodes[1].onchange=function(){Syn.support.radioClickChanges= +!0};Syn.trigger("click",{},b.childNodes[1]);Syn.bind(h,"click",function(){Syn.support.optionClickBubbles=!0;Syn.unbind(h,"click",arguments.callee)});Syn.trigger("click",{},d.firstChild);Syn.support.changeBubbles=Syn.eventSupported("change");h.onclick=function(){Syn.support.mouseDownUpClicks=!0};Syn.trigger("mousedown",{},h);Syn.trigger("mouseup",{},h);document.documentElement.removeChild(h);window.__synthTest=e;Syn.support.ready++}else setTimeout(arguments.callee,1)})()})(!0); +(function(){Syn.key.browsers={webkit:{prevent:{keyup:[],keydown:["char","keypress"],keypress:["char"]},character:{keydown:[0,"key"],keypress:["char","char"],keyup:[0,"key"]},specialChars:{keydown:[0,"char"],keyup:[0,"char"]},navigation:{keydown:[0,"key"],keyup:[0,"key"]},special:{keydown:[0,"key"],keyup:[0,"key"]},tab:{keydown:[0,"char"],keyup:[0,"char"]},"pause-break":{keydown:[0,"key"],keyup:[0,"key"]},caps:{keydown:[0,"key"],keyup:[0,"key"]},escape:{keydown:[0,"key"],keyup:[0,"key"]},"num-lock":{keydown:[0, +"key"],keyup:[0,"key"]},"scroll-lock":{keydown:[0,"key"],keyup:[0,"key"]},print:{keyup:[0,"key"]},"function":{keydown:[0,"key"],keyup:[0,"key"]},"\r":{keydown:[0,"key"],keypress:["char","key"],keyup:[0,"key"]}},gecko:{prevent:{keyup:[],keydown:["char"],keypress:["char"]},character:{keydown:[0,"key"],keypress:["char",0],keyup:[0,"key"]},specialChars:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},navigation:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},special:{keydown:[0,"key"],keyup:[0, +"key"]},"\t":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},"pause-break":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},caps:{keydown:[0,"key"],keyup:[0,"key"]},escape:{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]},"num-lock":{keydown:[0,"key"],keyup:[0,"key"]},"scroll-lock":{keydown:[0,"key"],keyup:[0,"key"]},print:{keyup:[0,"key"]},"function":{keydown:[0,"key"],keyup:[0,"key"]},"\r":{keydown:[0,"key"],keypress:[0,"key"],keyup:[0,"key"]}},msie:{prevent:{keyup:[],keydown:["char", +"keypress"],keypress:["char"]},character:{keydown:[null,"key"],keypress:[null,"char"],keyup:[null,"key"]},specialChars:{keydown:[null,"char"],keyup:[null,"char"]},navigation:{keydown:[null,"key"],keyup:[null,"key"]},special:{keydown:[null,"key"],keyup:[null,"key"]},tab:{keydown:[null,"char"],keyup:[null,"char"]},"pause-break":{keydown:[null,"key"],keyup:[null,"key"]},caps:{keydown:[null,"key"],keyup:[null,"key"]},escape:{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},"num-lock":{keydown:[null, +"key"],keyup:[null,"key"]},"scroll-lock":{keydown:[null,"key"],keyup:[null,"key"]},print:{keyup:[null,"key"]},"function":{keydown:[null,"key"],keyup:[null,"key"]},"\r":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]}},opera:{prevent:{keyup:[],keydown:[],keypress:["char"]},character:{keydown:[null,"key"],keypress:[null,"char"],keyup:[null,"key"]},specialChars:{keydown:[null,"char"],keypress:[null,"char"],keyup:[null,"char"]},navigation:{keydown:[null,"key"],keypress:[null,"key"]},special:{keydown:[null, +"key"],keypress:[null,"key"],keyup:[null,"key"]},tab:{keydown:[null,"char"],keypress:[null,"char"],keyup:[null,"char"]},"pause-break":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},caps:{keydown:[null,"key"],keyup:[null,"key"]},escape:{keydown:[null,"key"],keypress:[null,"key"]},"num-lock":{keyup:[null,"key"],keydown:[null,"key"],keypress:[null,"key"]},"scroll-lock":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]},print:{},"function":{keydown:[null,"key"],keypress:[null, +"key"],keyup:[null,"key"]},"\r":{keydown:[null,"key"],keypress:[null,"key"],keyup:[null,"key"]}}};Syn.mouse.browsers={webkit:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},opera:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},msie:{right:{mousedown:{button:2}, +mouseup:{button:2},contextmenu:{button:0}},left:{mousedown:{button:1},mouseup:{button:1},click:{button:0}}},chrome:{right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}},left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}}},gecko:{left:{mousedown:{button:0,which:1},mouseup:{button:0,which:1},click:{button:0,which:1}},right:{mousedown:{button:2,which:3},mouseup:{button:2,which:3},contextmenu:{button:2,which:3}}}};Syn.key.browser= +function(){if(Syn.key.browsers[window.navigator.userAgent])return Syn.key.browsers[window.navigator.userAgent];for(var e in Syn.browser)if(Syn.browser[e]&&Syn.key.browsers[e])return Syn.key.browsers[e];return Syn.key.browsers.gecko}();Syn.mouse.browser=function(){if(Syn.mouse.browsers[window.navigator.userAgent])return Syn.mouse.browsers[window.navigator.userAgent];for(var e in Syn.browser)if(Syn.browser[e]&&Syn.mouse.browsers[e])return Syn.mouse.browsers[e];return Syn.mouse.browsers.gecko}()})(!0); +(function(){var e=Syn.helpers,j=Syn,m=function(a){if(void 0!==a.selectionStart)return document.activeElement&&document.activeElement!=a&&a.selectionStart==a.selectionEnd&&0==a.selectionStart?{start:a.value.length,end:a.value.length}:{start:a.selectionStart,end:a.selectionEnd};try{if("input"==a.nodeName.toLowerCase()){var b=e.getWindow(a).document.selection.createRange(),d=a.createTextRange();d.setEndPoint("EndToStart",b);var g=d.text.length;return{start:g,end:g+b.text.length}}var b=e.getWindow(a).document.selection.createRange(), +d=b.duplicate(),c=b.duplicate(),l=b.duplicate();c.collapse();l.collapse(!1);c.moveStart("character",-1);l.moveStart("character",-1);d.moveToElementText(a);d.setEndPoint("EndToEnd",b);var g=d.text.length-b.text.length,f=d.text.length;0!=g&&""==c.text&&(g+=2);0!=f&&""==l.text&&(f+=2);return{start:g,end:f}}catch(h){return{start:a.value.length,end:a.value.length}}},h=function(a){for(var a=e.getWindow(a).document,b=[],d=a.getElementsByTagName("*"),g=d.length,c=0;c<g;c++)Syn.isFocusable(d[c])&&d[c]!=a.documentElement&& +b.push(d[c]);return b};e.extend(Syn,{keycodes:{"\u0008":"8","\t":"9","\r":"13",shift:"16",ctrl:"17",alt:"18","pause-break":"19",caps:"20",escape:"27","num-lock":"144","scroll-lock":"145",print:"44","page-up":"33","page-down":"34",end:"35",home:"36",left:"37",up:"38",right:"39",down:"40",insert:"45","delete":"46"," ":"32","0":"48",1:"49",2:"50",3:"51",4:"52",5:"53",6:"54",7:"55",8:"56",9:"57",a:"65",b:"66",c:"67",d:"68",e:"69",f:"70",g:"71",h:"72",i:"73",j:"74",k:"75",l:"76",m:"77",n:"78",o:"79",p:"80", +q:"81",r:"82",s:"83",t:"84",u:"85",v:"86",w:"87",x:"88",y:"89",z:"90",num0:"96",num1:"97",num2:"98",num3:"99",num4:"100",num5:"101",num6:"102",num7:"103",num8:"104",num9:"105","*":"106","+":"107","-":"109",".":"110","/":"111",";":"186","=":"187",",":"188","-":"189",".":"190","/":"191","`":"192","[":"219","\\":"220","]":"221","'":"222","left window key":"91","right window key":"92","select key":"93",f1:"112",f2:"113",f3:"114",f4:"115",f5:"116",f6:"117",f7:"118",f8:"119",f9:"120",f10:"121",f11:"122", +f12:"123"},typeable:/input|textarea/i,selectText:function(a,b,d){if(a.setSelectionRange)d?(a.selectionStart=b,a.selectionEnd=d):(a.focus(),a.setSelectionRange(b,b));else if(a.createTextRange){var g=a.createTextRange();g.moveStart("character",b);g.moveEnd("character",(d||b)-a.value.length);g.select()}},getText:function(a){if(Syn.typeable.test(a.nodeName)){var b=m(a);return a.value.substring(b.start,b.end)}a=Syn.helpers.getWindow(a);return a.getSelection?a.getSelection().toString():a.document.getSelection? +a.document.getSelection().toString():a.document.selection.createRange().text},getSelection:m});e.extend(Syn.key,{data:function(a){if(j.key.browser[a])return j.key.browser[a];for(var b in j.key.kinds)if(-1<e.inArray(a,j.key.kinds[b]))return j.key.browser[b];return j.key.browser.character},isSpecial:function(a){for(var b=j.key.kinds.special,d=0;d<b.length;d++)if(Syn.keycodes[b[d]]==a)return b[d]},options:function(a,b){var d=Syn.key.data(a);if(!d[b])return null;var g=d[b][0],d=d[b][1],c={};c.keyCode= +"key"==d?Syn.keycodes[a]:"char"==d?a.charCodeAt(0):d;if("char"==g)c.charCode=a.charCodeAt(0);else if(null!==g)c.charCode=g;return c},kinds:{special:["shift","ctrl","alt","caps"],specialChars:["\u0008"],navigation:"page-up,page-down,end,home,left,up,right,down,insert,delete".split(","),"function":"f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12".split(",")},getDefault:function(a){if(Syn.key.defaults[a])return Syn.key.defaults[a];for(var b in Syn.key.kinds)if(-1<e.inArray(a,Syn.key.kinds[b])&&Syn.key.defaults[b])return Syn.key.defaults[b]; +return Syn.key.defaults.character},defaults:{character:function(a,b,d,g,c){/num\d+/.test(d)&&(d=d.match(/\d+/)[0]);if(g||!j.support.keyCharacters&&Syn.typeable.test(this.nodeName))b=this.value,a=b.substr(0,c.start),c=b.substr(c.end),this.value=a+d+c,Syn.selectText(this,a.length+("\n"==d&&j.support.textareaCarriage?2:d.length))},c:function(a,b,d,g,c){Syn.key.ctrlKey?Syn.key.clipboard=Syn.getText(this):Syn.key.defaults.character.apply(this,arguments)},v:function(a,b,d,g,c){Syn.key.ctrlKey?Syn.key.defaults.character.call(this, +a,b,Syn.key.clipboard,!0,c):Syn.key.defaults.character.apply(this,arguments)},a:function(a,b,d,g,c){Syn.key.ctrlKey?Syn.selectText(this,0,this.value.length):Syn.key.defaults.character.apply(this,arguments)},home:function(){Syn.onParents(this,function(a){if(a.scrollHeight!=a.clientHeight)return a.scrollTop=0,!1})},end:function(){Syn.onParents(this,function(a){if(a.scrollHeight!=a.clientHeight)return a.scrollTop=a.scrollHeight,!1})},"page-down":function(){Syn.onParents(this,function(a){if(a.scrollHeight!= +a.clientHeight)return a.scrollTop+=a.clientHeight,!1})},"page-up":function(){Syn.onParents(this,function(a){if(a.scrollHeight!=a.clientHeight)return a.scrollTop-=a.clientHeight,!1})},"\u0008":function(a,b,d,g,c){if(!j.support.backspaceWorks&&Syn.typeable.test(this.nodeName))b=this.value,a=b.substr(0,c.start),b=b.substr(c.end),c.start==c.end&&0<c.start?(this.value=a.substring(0,a.length-1)+b,Syn.selectText(this,c.start-1)):(this.value=a+b,Syn.selectText(this,c.start))},"delete":function(a,b,d,g,c){if(!j.support.backspaceWorks&& +Syn.typeable.test(this.nodeName))b=this.value,a=b.substr(0,c.start),b=b.substr(c.end),this.value=c.start==c.end&&c.start<=this.value.length-1?a+b.substring(1):a+b,Syn.selectText(this,c.start)},"\r":function(a,b,d,g,c){d=this.nodeName.toLowerCase();!j.support.keypressSubmits&&"input"==d&&(g=Syn.closest(this,"form"))&&Syn.trigger("submit",{},g);!j.support.keyCharacters&&"textarea"==d&&Syn.key.defaults.character.call(this,a,b,"\n",void 0,c);!j.support.keypressOnAnchorClicks&&"a"==d&&Syn.trigger("click", +{},this)},"\t":function(){var a=h(this);Syn.tabIndex(this);var b=null,d=0,g;for(orders=[];d<a.length;d++)orders.push([a[d],d]);orders.sort(function(a,b){var g=b[0],d=Syn.tabIndex(a[0])||0,g=Syn.tabIndex(g)||0;return d==g?a[1]-b[1]:0==d?1:0==g?-1:d-g});for(d=0;d<orders.length;d++)g=orders[d][0],this==g&&(Syn.key.shiftKey?(b=orders[d-1][0])||(b=orders[a.length-1][0]):(b=orders[d+1][0])||(b=orders[0][0]));b||(b=void 0);b&&b.focus();return b},left:function(a,b,d,g,c){Syn.typeable.test(this.nodeName)&& +(Syn.key.shiftKey?Syn.selectText(this,0==c.start?0:c.start-1,c.end):Syn.selectText(this,0==c.start?0:c.start-1))},right:function(a,b,d,g,c){Syn.typeable.test(this.nodeName)&&(Syn.key.shiftKey?Syn.selectText(this,c.start,c.end+1>this.value.length?this.value.length:c.end+1):Syn.selectText(this,c.end+1>this.value.length?this.value.length:c.end+1))},up:function(){if(/select/i.test(this.nodeName))this.selectedIndex=this.selectedIndex?this.selectedIndex-1:0},down:function(){/select/i.test(this.nodeName)&& +(Syn.changeOnBlur(this,"selectedIndex",this.selectedIndex),this.selectedIndex+=1)},shift:function(){return null}}});e.extend(Syn.create,{keydown:{setup:function(a,b,d){-1!=e.inArray(b,Syn.key.kinds.special)&&(Syn.key[b+"Key"]=d)}},keypress:{setup:function(a,b,d){j.support.keyCharacters&&!j.support.keysOnNotFocused&&d.focus()}},keyup:{setup:function(a,b){-1!=e.inArray(b,Syn.key.kinds.special)&&(Syn.key[b+"Key"]=null)}},key:{options:function(a,b){b="object"!=typeof b?{character:b}:b;b=e.extend({},b); +b.character&&(e.extend(b,j.key.options(b.character,a)),delete b.character);return b=e.extend({ctrlKey:!!Syn.key.ctrlKey,altKey:!!Syn.key.altKey,shiftKey:!!Syn.key.shiftKey,metaKey:!!Syn.key.metaKey},b)},event:function(a,b,d){var g=e.getWindow(d).document||document;if(g.createEvent){var c;try{c=g.createEvent("KeyEvents"),c.initKeyEvent(a,!0,!0,window,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.keyCode,b.charCode)}catch(l){c=e.createBasicStandardEvent(a,b,g)}c.synthetic=!0}else try{c=e.createEventObject.apply(this, +arguments),e.extend(c,b)}catch(f){}return c}}});var i={enter:"\r",backspace:"\u0008",tab:"\t",space:" "};e.extend(Syn.init.prototype,{_key:function(a,b,d){if(/-up$/.test(a)&&-1!=e.inArray(a.replace("-up",""),Syn.key.kinds.special))Syn.trigger("keyup",a.replace("-up",""),b),d(!0,b);else{var g=Syn.typeable.test(b.nodeName)&&m(b),c=i[a]||a,l=Syn.trigger("keydown",c,b),a=Syn.key.getDefault,f=Syn.key.browser.prevent,h,j=Syn.key.options(c,"keypress");l?j?(l=Syn.trigger("keypress",j,b))&&(h=a(c).call(b, +j,e.getWindow(b),c,void 0,g)):h=a(c).call(b,j,e.getWindow(b),c,void 0,g):j&&-1==e.inArray("keypress",f.keydown)&&Syn.trigger("keypress",j,b);h&&h.nodeName&&(b=h);null!==h?setTimeout(function(){Syn.trigger("keyup",Syn.key.options(c,"keyup"),b);d(l,b)},1):d(l,b);return b}},_type:function(a,b,d){var g=a.match(/(\[[^\]]+\])|([^\[])/g),c=this,e=function(a,h){var i=g.shift();i?(h=h||b,1<i.length&&(i=i.substr(1,i.length-2)),c._key(i,h,e)):d(a,h)};e()}});(function(){if(document.body){var a=document.createElement("div"), +b,d,g,c;a.innerHTML="<form id='outer'><input name='checkbox' type='checkbox'/><input name='radio' type='radio' /><input type='submit' name='submitter'/><input type='input' name='inputter'/><input name='one'><input name='two'/><a href='#abc'></a><textarea>1\n2</textarea></form>";document.documentElement.appendChild(a);b=a.firstChild;d=b.getElementsByTagName("a")[0];g=b.getElementsByTagName("textarea")[0];c=b.childNodes[3];b.onsubmit=function(a){a.preventDefault&&a.preventDefault();j.support.keypressSubmits= +!0;return a.returnValue=!1};c.focus();Syn.trigger("keypress","\r",c);Syn.trigger("keypress","a",c);j.support.keyCharacters="a"==c.value;c.value="a";Syn.trigger("keypress","\u0008",c);j.support.backspaceWorks=""==c.value;c.onchange=function(){j.support.focusChanges=!0};c.focus();Syn.trigger("keypress","a",c);b.childNodes[5].focus();Syn.trigger("keypress","b",c);j.support.keysOnNotFocused="ab"==c.value;j.bind(d,"click",function(a){a.preventDefault&&a.preventDefault();j.support.keypressOnAnchorClicks= +!0;return a.returnValue=!1});Syn.trigger("keypress","\r",d);j.support.textareaCarriage=4==g.value.length;document.documentElement.removeChild(a);j.support.ready++}else setTimeout(arguments.callee,1)})()})(!0); +(function(){(function(){if(document.body){var a=document.createElement("div");document.body.appendChild(a);Syn.helpers.extend(a.style,{width:"100px",height:"10000px",backgroundColor:"blue",position:"absolute",top:"10px",left:"0px",zIndex:19999});document.body.scrollTop=11;if(document.elementFromPoint)document.elementFromPoint(3,1)==a?Syn.support.elementFromClient=!0:Syn.support.elementFromPage=!0,document.body.removeChild(a),document.body.scrollTop=0}else setTimeout(arguments.callee,1)})();var e= +function(a,b){var d=a.clientX,f=a.clientY,e=Syn.helpers.getWindow(b);if(Syn.support.elementFromPage)var h=Syn.helpers.scrollOffset(e),d=d+h.left,f=f+h.top;d=e.document.elementFromPoint?e.document.elementFromPoint(d,f):b;return d===e.document.documentElement&&(0>a.clientY||0>a.clientX)?b:d},j=function(a,b,d){var f=e(b,d);Syn.trigger(a,b,f||d);return f},m=function(a,b,d){var f=e(a,b);if(d!=f&&f&&d){var h=Syn.helpers.extend({},a);h.relatedTarget=f;Syn.trigger("mouseout",h,d);h.relatedTarget=d;Syn.trigger("mouseover", +h,f)}Syn.trigger("mousemove",a,f||b);return f},h=function(a,b,d,f,h){var i=new Date,j=b.clientX-a.clientX,u=b.clientY-a.clientY,n=Syn.helpers.getWindow(f),o=e(a,f),p=n.document.createElement("div"),s=0;move=function(){var e=new Date,t=Syn.helpers.scrollOffset(n),e=(0==s?0:e-i)/d,q={clientX:j*e+a.clientX,clientY:u*e+a.clientY};s++;1>e?(Syn.helpers.extend(p.style,{left:q.clientX+t.left+2+"px",top:q.clientY+t.top+2+"px"}),o=m(q,f,o),setTimeout(arguments.callee,15)):(o=m(b,f,o),n.document.body.removeChild(p), +h())};Syn.helpers.extend(p.style,{height:"5px",width:"5px",backgroundColor:"red",position:"absolute",zIndex:19999,fontSize:"1px"});n.document.body.appendChild(p);move()},i=function(a,b,d,f,e){j("mousedown",a,f);h(a,b,d,f,function(){j("mouseup",b,f);e()})},a=function(a){var a=Syn.jquery()(a),b=a.offset();return{pageX:b.left+a.width()/2,pageY:b.top+a.height()/2}},b=function(b,c,d){var f=/(\d+)[x ](\d+)/,e=/(\d+)X(\d+)/,h=/([+-]\d+)[xX ]([+-]\d+)/;"string"==typeof b&&h.test(b)&&d&&(d=a(d),b=b.match(h), +b={pageX:d.pageX+parseInt(b[1]),pageY:d.pageY+parseInt(b[2])});"string"==typeof b&&f.test(b)&&(b=b.match(f),b={pageX:parseInt(b[1]),pageY:parseInt(b[2])});"string"==typeof b&&e.test(b)&&(b=b.match(e),b={clientX:parseInt(b[1]),clientY:parseInt(b[2])});"string"==typeof b&&(b=Syn.jquery()(b,c.document)[0]);b.nodeName&&(b=a(b));b.pageX&&(c=Syn.helpers.scrollOffset(c),b={clientX:b.pageX-c.left,clientY:b.pageY-c.top});return b},d=function(a,b,d){if(0>a.clientY){var f=Syn.helpers.scrollOffset(d);Syn.helpers.scrollDimensions(d); +var e=f.top+a.clientY-100,h=e-f.top;0<e||(e=0,h=-f.top);a.clientY-=h;b.clientY-=h;Syn.helpers.scrollOffset(d,{top:e,left:f.left})}};Syn.helpers.extend(Syn.init.prototype,{_move:function(a,c,e){var f=Syn.helpers.getWindow(c),i=b(a.from||c,f,c),j=b(a.to||a,f,c);!1!==a.adjust&&d(i,j,f);h(i,j,a.duration||500,c,e)},_drag:function(a,c,e){var f=Syn.helpers.getWindow(c),h=b(a.from||c,f,c),j=b(a.to||a,f,c);!1!==a.adjust&&d(h,j,f);i(h,j,a.duration||500,c,e)}})})(); \ No newline at end of file diff --git a/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php b/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php new file mode 100644 index 00000000000..58b5102d6d1 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php @@ -0,0 +1,1097 @@ +<?php + +/* + * This file is part of the Behat\Mink. + * (c) Konstantin Kudryashov <ever.zet@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Behat\Mink\Driver; + +use Behat\Mink\Exception\DriverException; +use Behat\Mink\Selector\Xpath\Escaper; +use WebDriver\Element; +use WebDriver\Exception\NoSuchElement; +use WebDriver\Exception\UnknownError; +use WebDriver\Exception; +use WebDriver\Key; +use WebDriver\WebDriver; + +/** + * Selenium2 driver. + * + * @author Pete Otaqui <pete@otaqui.com> + */ +class Selenium2Driver extends CoreDriver +{ + /** + * Whether the browser has been started + * @var Boolean + */ + private $started = false; + + /** + * The WebDriver instance + * @var WebDriver + */ + private $webDriver; + + /** + * @var string + */ + private $browserName; + + /** + * @var array + */ + private $desiredCapabilities; + + /** + * The WebDriverSession instance + * @var \WebDriver\Session + */ + private $wdSession; + + /** + * The timeout configuration + * @var array + */ + private $timeouts = array(); + + /** + * @var Escaper + */ + private $xpathEscaper; + + /** + * Instantiates the driver. + * + * @param string $browserName Browser name + * @param array $desiredCapabilities The desired capabilities + * @param string $wdHost The WebDriver host + */ + public function __construct($browserName = 'firefox', $desiredCapabilities = null, $wdHost = 'http://localhost:4444/wd/hub') + { + $this->setBrowserName($browserName); + $this->setDesiredCapabilities($desiredCapabilities); + $this->setWebDriver(new WebDriver($wdHost)); + $this->xpathEscaper = new Escaper(); + } + + /** + * Sets the browser name + * + * @param string $browserName the name of the browser to start, default is 'firefox' + */ + protected function setBrowserName($browserName = 'firefox') + { + $this->browserName = $browserName; + } + + /** + * Sets the desired capabilities - called on construction. If null is provided, will set the + * defaults as desired. + * + * See http://code.google.com/p/selenium/wiki/DesiredCapabilities + * + * @param array $desiredCapabilities an array of capabilities to pass on to the WebDriver server + */ + public function setDesiredCapabilities($desiredCapabilities = null) + { + if (null === $desiredCapabilities) { + $desiredCapabilities = self::getDefaultCapabilities(); + } + + if (isset($desiredCapabilities['firefox'])) { + foreach ($desiredCapabilities['firefox'] as $capability => $value) { + switch ($capability) { + case 'profile': + $desiredCapabilities['firefox_'.$capability] = base64_encode(file_get_contents($value)); + break; + default: + $desiredCapabilities['firefox_'.$capability] = $value; + } + } + + unset($desiredCapabilities['firefox']); + } + + // See https://sites.google.com/a/chromium.org/chromedriver/capabilities + if (isset($desiredCapabilities['chrome'])) { + + $chromeOptions = array(); + + foreach ($desiredCapabilities['chrome'] as $capability => $value) { + if ($capability == 'switches') { + $chromeOptions['args'] = $value; + } else { + $chromeOptions[$capability] = $value; + } + $desiredCapabilities['chrome.'.$capability] = $value; + } + + $desiredCapabilities['chromeOptions'] = $chromeOptions; + + unset($desiredCapabilities['chrome']); + } + + $this->desiredCapabilities = $desiredCapabilities; + } + + /** + * Sets the WebDriver instance + * + * @param WebDriver $webDriver An instance of the WebDriver class + */ + public function setWebDriver(WebDriver $webDriver) + { + $this->webDriver = $webDriver; + } + + /** + * Gets the WebDriverSession instance + * + * @return \WebDriver\Session + */ + public function getWebDriverSession() + { + return $this->wdSession; + } + + /** + * Returns the default capabilities + * + * @return array + */ + public static function getDefaultCapabilities() + { + return array( + 'browserName' => 'firefox', + 'version' => '9', + 'platform' => 'ANY', + 'browserVersion' => '9', + 'browser' => 'firefox', + 'name' => 'Behat Test', + 'deviceOrientation' => 'portrait', + 'deviceType' => 'tablet', + 'selenium-version' => '2.31.0' + ); + } + + /** + * Makes sure that the Syn event library has been injected into the current page, + * and return $this for a fluid interface, + * + * $this->withSyn()->executeJsOnXpath($xpath, $script); + * + * @return Selenium2Driver + */ + protected function withSyn() + { + $hasSyn = $this->wdSession->execute(array( + 'script' => 'return typeof window["Syn"]!=="undefined" && typeof window["Syn"].trigger!=="undefined"', + 'args' => array() + )); + + if (!$hasSyn) { + $synJs = file_get_contents(__DIR__.'/Resources/syn.js'); + $this->wdSession->execute(array( + 'script' => $synJs, + 'args' => array() + )); + } + + return $this; + } + + /** + * Creates some options for key events + * + * @param string $char the character or code + * @param string $modifier one of 'shift', 'alt', 'ctrl' or 'meta' + * + * @return string a json encoded options array for Syn + */ + protected static function charToOptions($char, $modifier = null) + { + $ord = ord($char); + if (is_numeric($char)) { + $ord = $char; + } + + $options = array( + 'keyCode' => $ord, + 'charCode' => $ord + ); + + if ($modifier) { + $options[$modifier.'Key'] = 1; + } + + return json_encode($options); + } + + /** + * Executes JS on a given element - pass in a js script string and {{ELEMENT}} will + * be replaced with a reference to the result of the $xpath query + * + * @example $this->executeJsOnXpath($xpath, 'return {{ELEMENT}}.childNodes.length'); + * + * @param string $xpath the xpath to search with + * @param string $script the script to execute + * @param Boolean $sync whether to run the script synchronously (default is TRUE) + * + * @return mixed + */ + protected function executeJsOnXpath($xpath, $script, $sync = true) + { + return $this->executeJsOnElement($this->findElement($xpath), $script, $sync); + } + + /** + * Executes JS on a given element - pass in a js script string and {{ELEMENT}} will + * be replaced with a reference to the element + * + * @example $this->executeJsOnXpath($xpath, 'return {{ELEMENT}}.childNodes.length'); + * + * @param Element $element the webdriver element + * @param string $script the script to execute + * @param Boolean $sync whether to run the script synchronously (default is TRUE) + * + * @return mixed + */ + private function executeJsOnElement(Element $element, $script, $sync = true) + { + $script = str_replace('{{ELEMENT}}', 'arguments[0]', $script); + + $options = array( + 'script' => $script, + 'args' => array(array('ELEMENT' => $element->getID())), + ); + + if ($sync) { + return $this->wdSession->execute($options); + } + + return $this->wdSession->execute_async($options); + } + + /** + * {@inheritdoc} + */ + public function start() + { + try { + $this->wdSession = $this->webDriver->session($this->browserName, $this->desiredCapabilities); + $this->applyTimeouts(); + } catch (\Exception $e) { + throw new DriverException('Could not open connection: '.$e->getMessage(), 0, $e); + } + + if (!$this->wdSession) { + throw new DriverException('Could not connect to a Selenium 2 / WebDriver server'); + } + $this->started = true; + } + + /** + * Sets the timeouts to apply to the webdriver session + * + * @param array $timeouts The session timeout settings: Array of {script, implicit, page} => time in milliseconds + * + * @throws DriverException + */ + public function setTimeouts($timeouts) + { + $this->timeouts = $timeouts; + + if ($this->isStarted()) { + $this->applyTimeouts(); + } + } + + /** + * Applies timeouts to the current session + */ + private function applyTimeouts() + { + try { + foreach ($this->timeouts as $type => $param) { + $this->wdSession->timeouts($type, $param); + } + } catch (UnknownError $e) { + throw new DriverException('Error setting timeout: ' . $e->getMessage(), 0, $e); + } + } + + /** + * {@inheritdoc} + */ + public function isStarted() + { + return $this->started; + } + + /** + * {@inheritdoc} + */ + public function stop() + { + if (!$this->wdSession) { + throw new DriverException('Could not connect to a Selenium 2 / WebDriver server'); + } + + $this->started = false; + try { + $this->wdSession->close(); + } catch (\Exception $e) { + throw new DriverException('Could not close connection', 0, $e); + } + } + + /** + * {@inheritdoc} + */ + public function reset() + { + $this->wdSession->deleteAllCookies(); + } + + /** + * {@inheritdoc} + */ + public function visit($url) + { + $this->wdSession->open($url); + } + + /** + * {@inheritdoc} + */ + public function getCurrentUrl() + { + return $this->wdSession->url(); + } + + /** + * {@inheritdoc} + */ + public function reload() + { + $this->wdSession->refresh(); + } + + /** + * {@inheritdoc} + */ + public function forward() + { + $this->wdSession->forward(); + } + + /** + * {@inheritdoc} + */ + public function back() + { + $this->wdSession->back(); + } + + /** + * {@inheritdoc} + */ + public function switchToWindow($name = null) + { + $this->wdSession->focusWindow($name ? $name : ''); + } + + /** + * {@inheritdoc} + */ + public function switchToIFrame($name = null) + { + $this->wdSession->frame(array('id' => $name)); + } + + /** + * {@inheritdoc} + */ + public function setCookie($name, $value = null) + { + if (null === $value) { + $this->wdSession->deleteCookie($name); + + return; + } + + $cookieArray = array( + 'name' => $name, + 'value' => (string) $value, + 'secure' => false, // thanks, chibimagic! + ); + + $this->wdSession->setCookie($cookieArray); + } + + /** + * {@inheritdoc} + */ + public function getCookie($name) + { + $cookies = $this->wdSession->getAllCookies(); + foreach ($cookies as $cookie) { + if ($cookie['name'] === $name) { + return urldecode($cookie['value']); + } + } + } + + /** + * {@inheritdoc} + */ + public function getContent() + { + return $this->wdSession->source(); + } + + /** + * {@inheritdoc} + */ + public function getScreenshot() + { + return base64_decode($this->wdSession->screenshot()); + } + + /** + * {@inheritdoc} + */ + public function getWindowNames() + { + return $this->wdSession->window_handles(); + } + + /** + * {@inheritdoc} + */ + public function getWindowName() + { + return $this->wdSession->window_handle(); + } + + /** + * {@inheritdoc} + */ + public function findElementXpaths($xpath) + { + $nodes = $this->wdSession->elements('xpath', $xpath); + + $elements = array(); + foreach ($nodes as $i => $node) { + $elements[] = sprintf('(%s)[%d]', $xpath, $i+1); + } + + return $elements; + } + + /** + * {@inheritdoc} + */ + public function getTagName($xpath) + { + return $this->findElement($xpath)->name(); + } + + /** + * {@inheritdoc} + */ + public function getText($xpath) + { + $node = $this->findElement($xpath); + $text = $node->text(); + $text = (string) str_replace(array("\r", "\r\n", "\n"), ' ', $text); + + return $text; + } + + /** + * {@inheritdoc} + */ + public function getHtml($xpath) + { + return $this->executeJsOnXpath($xpath, 'return {{ELEMENT}}.innerHTML;'); + } + + /** + * {@inheritdoc} + */ + public function getOuterHtml($xpath) + { + return $this->executeJsOnXpath($xpath, 'return {{ELEMENT}}.outerHTML;'); + } + + /** + * {@inheritdoc} + */ + public function getAttribute($xpath, $name) + { + $script = 'return {{ELEMENT}}.getAttribute(' . json_encode((string) $name) . ')'; + + return $this->executeJsOnXpath($xpath, $script); + } + + /** + * {@inheritdoc} + */ + public function getValue($xpath) + { + $element = $this->findElement($xpath); + $elementName = strtolower($element->name()); + $elementType = strtolower($element->attribute('type')); + + // Getting the value of a checkbox returns its value if selected. + if ('input' === $elementName && 'checkbox' === $elementType) { + return $element->selected() ? $element->attribute('value') : null; + } + + if ('input' === $elementName && 'radio' === $elementType) { + $script = <<<JS +var node = {{ELEMENT}}, + value = null; + +var name = node.getAttribute('name'); +if (name) { + var fields = window.document.getElementsByName(name), + i, l = fields.length; + for (i = 0; i < l; i++) { + var field = fields.item(i); + if (field.form === node.form && field.checked) { + value = field.value; + break; + } + } +} + +return value; +JS; + + return $this->executeJsOnElement($element, $script); + } + + // Using $element->attribute('value') on a select only returns the first selected option + // even when it is a multiple select, so a custom retrieval is needed. + if ('select' === $elementName && $element->attribute('multiple')) { + $script = <<<JS +var node = {{ELEMENT}}, + value = []; + +for (var i = 0; i < node.options.length; i++) { + if (node.options[i].selected) { + value.push(node.options[i].value); + } +} + +return value; +JS; + + return $this->executeJsOnElement($element, $script); + } + + return $element->attribute('value'); + } + + /** + * {@inheritdoc} + */ + public function setValue($xpath, $value) + { + $element = $this->findElement($xpath); + $elementName = strtolower($element->name()); + + if ('select' === $elementName) { + if (is_array($value)) { + $this->deselectAllOptions($element); + + foreach ($value as $option) { + $this->selectOptionOnElement($element, $option, true); + } + + return; + } + + $this->selectOptionOnElement($element, $value); + + return; + } + + if ('input' === $elementName) { + $elementType = strtolower($element->attribute('type')); + + if (in_array($elementType, array('submit', 'image', 'button', 'reset'))) { + throw new DriverException(sprintf('Impossible to set value an element with XPath "%s" as it is not a select, textarea or textbox', $xpath)); + } + + if ('checkbox' === $elementType) { + if ($element->selected() xor (bool) $value) { + $this->clickOnElement($element); + } + + return; + } + + if ('radio' === $elementType) { + $this->selectRadioValue($element, $value); + + return; + } + + if ('file' === $elementType) { + $element->postValue(array('value' => array(strval($value)))); + + return; + } + } + + $value = strval($value); + + if (in_array($elementName, array('input', 'textarea'))) { + $existingValueLength = strlen($element->attribute('value')); + // Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only + // after leaving the field. + $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB; + } + + $element->postValue(array('value' => array($value))); + } + + /** + * {@inheritdoc} + */ + public function check($xpath) + { + $element = $this->findElement($xpath); + $this->ensureInputType($element, $xpath, 'checkbox', 'check'); + + if ($element->selected()) { + return; + } + + $this->clickOnElement($element); + } + + /** + * {@inheritdoc} + */ + public function uncheck($xpath) + { + $element = $this->findElement($xpath); + $this->ensureInputType($element, $xpath, 'checkbox', 'uncheck'); + + if (!$element->selected()) { + return; + } + + $this->clickOnElement($element); + } + + /** + * {@inheritdoc} + */ + public function isChecked($xpath) + { + return $this->findElement($xpath)->selected(); + } + + /** + * {@inheritdoc} + */ + public function selectOption($xpath, $value, $multiple = false) + { + $element = $this->findElement($xpath); + $tagName = strtolower($element->name()); + + if ('input' === $tagName && 'radio' === strtolower($element->attribute('type'))) { + $this->selectRadioValue($element, $value); + + return; + } + + if ('select' === $tagName) { + $this->selectOptionOnElement($element, $value, $multiple); + + return; + } + + throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath)); + } + + /** + * {@inheritdoc} + */ + public function isSelected($xpath) + { + return $this->findElement($xpath)->selected(); + } + + /** + * {@inheritdoc} + */ + public function click($xpath) + { + $this->clickOnElement($this->findElement($xpath)); + } + + private function clickOnElement(Element $element) + { + $this->wdSession->moveto(array('element' => $element->getID())); + $element->click(); + } + + /** + * {@inheritdoc} + */ + public function doubleClick($xpath) + { + $this->mouseOver($xpath); + $this->wdSession->doubleclick(); + } + + /** + * {@inheritdoc} + */ + public function rightClick($xpath) + { + $this->mouseOver($xpath); + $this->wdSession->click(array('button' => 2)); + } + + /** + * {@inheritdoc} + */ + public function attachFile($xpath, $path) + { + $element = $this->findElement($xpath); + $this->ensureInputType($element, $xpath, 'file', 'attach a file on'); + + $element->postValue(array('value' => array($path))); + } + + /** + * {@inheritdoc} + */ + public function isVisible($xpath) + { + return $this->findElement($xpath)->displayed(); + } + + /** + * {@inheritdoc} + */ + public function mouseOver($xpath) + { + $this->wdSession->moveto(array( + 'element' => $this->findElement($xpath)->getID() + )); + } + + /** + * {@inheritdoc} + */ + public function focus($xpath) + { + $script = 'Syn.trigger("focus", {}, {{ELEMENT}})'; + $this->withSyn()->executeJsOnXpath($xpath, $script); + } + + /** + * {@inheritdoc} + */ + public function blur($xpath) + { + $script = 'Syn.trigger("blur", {}, {{ELEMENT}})'; + $this->withSyn()->executeJsOnXpath($xpath, $script); + } + + /** + * {@inheritdoc} + */ + public function keyPress($xpath, $char, $modifier = null) + { + $options = self::charToOptions($char, $modifier); + $script = "Syn.trigger('keypress', $options, {{ELEMENT}})"; + $this->withSyn()->executeJsOnXpath($xpath, $script); + } + + /** + * {@inheritdoc} + */ + public function keyDown($xpath, $char, $modifier = null) + { + $options = self::charToOptions($char, $modifier); + $script = "Syn.trigger('keydown', $options, {{ELEMENT}})"; + $this->withSyn()->executeJsOnXpath($xpath, $script); + } + + /** + * {@inheritdoc} + */ + public function keyUp($xpath, $char, $modifier = null) + { + $options = self::charToOptions($char, $modifier); + $script = "Syn.trigger('keyup', $options, {{ELEMENT}})"; + $this->withSyn()->executeJsOnXpath($xpath, $script); + } + + /** + * {@inheritdoc} + */ + public function dragTo($sourceXpath, $destinationXpath) + { + $source = $this->findElement($sourceXpath); + $destination = $this->findElement($destinationXpath); + + $this->wdSession->moveto(array( + 'element' => $source->getID() + )); + + $script = <<<JS +(function (element) { + var event = document.createEvent("HTMLEvents"); + + event.initEvent("dragstart", true, true); + event.dataTransfer = {}; + + element.dispatchEvent(event); +}({{ELEMENT}})); +JS; + $this->withSyn()->executeJsOnElement($source, $script); + + $this->wdSession->buttondown(); + $this->wdSession->moveto(array( + 'element' => $destination->getID() + )); + $this->wdSession->buttonup(); + + $script = <<<JS +(function (element) { + var event = document.createEvent("HTMLEvents"); + + event.initEvent("drop", true, true); + event.dataTransfer = {}; + + element.dispatchEvent(event); +}({{ELEMENT}})); +JS; + $this->withSyn()->executeJsOnElement($destination, $script); + } + + /** + * {@inheritdoc} + */ + public function executeScript($script) + { + if (preg_match('/^function[\s\(]/', $script)) { + $script = preg_replace('/;$/', '', $script); + $script = '(' . $script . ')'; + } + + $this->wdSession->execute(array('script' => $script, 'args' => array())); + } + + /** + * {@inheritdoc} + */ + public function evaluateScript($script) + { + if (0 !== strpos(trim($script), 'return ')) { + $script = 'return ' . $script; + } + + return $this->wdSession->execute(array('script' => $script, 'args' => array())); + } + + /** + * {@inheritdoc} + */ + public function wait($timeout, $condition) + { + $script = "return $condition;"; + $start = microtime(true); + $end = $start + $timeout / 1000.0; + + do { + $result = $this->wdSession->execute(array('script' => $script, 'args' => array())); + usleep(100000); + } while (microtime(true) < $end && !$result); + + return (bool) $result; + } + + /** + * {@inheritdoc} + */ + public function resizeWindow($width, $height, $name = null) + { + $this->wdSession->window($name ? $name : 'current')->postSize( + array('width' => $width, 'height' => $height) + ); + } + + /** + * {@inheritdoc} + */ + public function submitForm($xpath) + { + $this->findElement($xpath)->submit(); + } + + /** + * {@inheritdoc} + */ + public function maximizeWindow($name = null) + { + $this->wdSession->window($name ? $name : 'current')->maximize(); + } + + /** + * Returns Session ID of WebDriver or `null`, when session not started yet. + * + * @return string|null + */ + public function getWebDriverSessionId() + { + return $this->isStarted() ? basename($this->wdSession->getUrl()) : null; + } + + /** + * @param string $xpath + * + * @return Element + */ + private function findElement($xpath) + { + return $this->wdSession->element('xpath', $xpath); + } + + /** + * Selects a value in a radio button group + * + * @param Element $element An element referencing one of the radio buttons of the group + * @param string $value The value to select + * + * @throws DriverException when the value cannot be found + */ + private function selectRadioValue(Element $element, $value) + { + // short-circuit when we already have the right button of the group to avoid XPath queries + if ($element->attribute('value') === $value) { + $element->click(); + + return; + } + + $name = $element->attribute('name'); + + if (!$name) { + throw new DriverException(sprintf('The radio button does not have the value "%s"', $value)); + } + + $formId = $element->attribute('form'); + + try { + if (null !== $formId) { + $xpath = <<<'XPATH' +//form[@id=%1$s]//input[@type="radio" and not(@form) and @name=%2$s and @value = %3$s] +| +//input[@type="radio" and @form=%1$s and @name=%2$s and @value = %3$s] +XPATH; + + $xpath = sprintf( + $xpath, + $this->xpathEscaper->escapeLiteral($formId), + $this->xpathEscaper->escapeLiteral($name), + $this->xpathEscaper->escapeLiteral($value) + ); + $input = $this->wdSession->element('xpath', $xpath); + } else { + $xpath = sprintf( + './ancestor::form//input[@type="radio" and not(@form) and @name=%s and @value = %s]', + $this->xpathEscaper->escapeLiteral($name), + $this->xpathEscaper->escapeLiteral($value) + ); + $input = $element->element('xpath', $xpath); + } + } catch (NoSuchElement $e) { + $message = sprintf('The radio group "%s" does not have an option "%s"', $name, $value); + + throw new DriverException($message, 0, $e); + } + + $input->click(); + } + + /** + * @param Element $element + * @param string $value + * @param bool $multiple + */ + private function selectOptionOnElement(Element $element, $value, $multiple = false) + { + $escapedValue = $this->xpathEscaper->escapeLiteral($value); + // The value of an option is the normalized version of its text when it has no value attribute + $optionQuery = sprintf('.//option[@value = %s or (not(@value) and normalize-space(.) = %s)]', $escapedValue, $escapedValue); + $option = $element->element('xpath', $optionQuery); + + if ($multiple || !$element->attribute('multiple')) { + if (!$option->selected()) { + $option->click(); + } + + return; + } + + // Deselect all options before selecting the new one + $this->deselectAllOptions($element); + $option->click(); + } + + /** + * Deselects all options of a multiple select + * + * Note: this implementation does not trigger a change event after deselecting the elements. + * + * @param Element $element + */ + private function deselectAllOptions(Element $element) + { + $script = <<<JS +var node = {{ELEMENT}}; +var i, l = node.options.length; +for (i = 0; i < l; i++) { + node.options[i].selected = false; +} +JS; + + $this->executeJsOnElement($element, $script); + } + + /** + * Ensures the element is a checkbox + * + * @param Element $element + * @param string $xpath + * @param string $type + * @param string $action + * + * @throws DriverException + */ + private function ensureInputType(Element $element, $xpath, $type, $action) + { + if ('input' !== strtolower($element->name()) || $type !== strtolower($element->attribute('type'))) { + $message = 'Impossible to %s the element with XPath "%s" as it is not a %s input'; + + throw new DriverException(sprintf($message, $action, $xpath, $type)); + } + } +} diff --git a/vendor/behat/mink-selenium2-driver/tests/Custom/TimeoutTest.php b/vendor/behat/mink-selenium2-driver/tests/Custom/TimeoutTest.php new file mode 100644 index 00000000000..d260f5d0e35 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/tests/Custom/TimeoutTest.php @@ -0,0 +1,39 @@ +<?php + +namespace Behat\Mink\Tests\Driver\Custom; + +use Behat\Mink\Tests\Driver\TestCase; + +class TimeoutTest extends TestCase +{ + /** + * @expectedException \Behat\Mink\Exception\DriverException + */ + public function testInvalidTimeoutSettingThrowsException() + { + $this->getSession()->getDriver()->setTimeouts(array('invalid'=>0)); + } + + public function testShortTimeoutDoesNotWaitForElementToAppear() + { + $this->getSession()->getDriver()->setTimeouts(array('implicit'=>0)); + + $this->getSession()->visit($this->pathTo('/js_test.html')); + $this->getSession()->getPage()->findById('waitable')->click(); + + $element = $this->getSession()->getPage()->find('css', '#waitable > div'); + + $this->assertNull($element); + } + + public function testLongTimeoutWaitsForElementToAppear() + { + $this->getSession()->getDriver()->setTimeouts(array('implicit'=>5000)); + + $this->getSession()->visit($this->pathTo('/js_test.html')); + $this->getSession()->getPage()->findById('waitable')->click(); + $element = $this->getSession()->getPage()->find('css', '#waitable > div'); + + $this->assertNotNull($element); + } +} diff --git a/vendor/behat/mink-selenium2-driver/tests/Custom/WebDriverTest.php b/vendor/behat/mink-selenium2-driver/tests/Custom/WebDriverTest.php new file mode 100644 index 00000000000..13734e99db5 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/tests/Custom/WebDriverTest.php @@ -0,0 +1,19 @@ +<?php + +namespace Behat\Mink\Tests\Driver\Custom; + +use Behat\Mink\Driver\Selenium2Driver; +use Behat\Mink\Tests\Driver\TestCase; + +class WebDriverTest extends TestCase +{ + public function testGetWebDriverSessionId() + { + /** @var Selenium2Driver $driver */ + $driver = $this->getSession()->getDriver(); + $this->assertNotEmpty($driver->getWebDriverSessionId(), 'Started session has an ID'); + + $driver = new Selenium2Driver(); + $this->assertNull($driver->getWebDriverSessionId(), 'Not started session don\'t have an ID'); + } +} diff --git a/vendor/behat/mink-selenium2-driver/tests/Custom/WindowNameTest.php b/vendor/behat/mink-selenium2-driver/tests/Custom/WindowNameTest.php new file mode 100644 index 00000000000..26713209a0e --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/tests/Custom/WindowNameTest.php @@ -0,0 +1,29 @@ +<?php + +namespace Behat\Mink\Tests\Driver\Custom; + +use Behat\Mink\Tests\Driver\TestCase; + +class WindowNameTest extends TestCase +{ + const WINDOW_NAME_REGEXP = '/[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}/i'; + + public function testPatternGetWindowNames() + { + $session = $this->getSession(); + + $windowNames = $session->getWindowNames(); + $this->assertArrayHasKey(0, $windowNames); + + foreach ($windowNames as $name) { + $this->assertRegExp(self::WINDOW_NAME_REGEXP, $name); + } + } + + public function testGetWindowName() + { + $session = $this->getSession(); + + $this->assertRegExp(self::WINDOW_NAME_REGEXP, $session->getWindowName()); + } +} diff --git a/vendor/behat/mink-selenium2-driver/tests/Selenium2Config.php b/vendor/behat/mink-selenium2-driver/tests/Selenium2Config.php new file mode 100644 index 00000000000..ef3f56d6cf3 --- /dev/null +++ b/vendor/behat/mink-selenium2-driver/tests/Selenium2Config.php @@ -0,0 +1,80 @@ +<?php + +namespace Behat\Mink\Tests\Driver; + +use Behat\Mink\Driver\Selenium2Driver; + +class Selenium2Config extends AbstractConfig +{ + public static function getInstance() + { + return new self(); + } + + /** + * {@inheritdoc} + */ + public function createDriver() + { + $browser = $_SERVER['WEB_FIXTURES_BROWSER']; + $seleniumHost = $_SERVER['DRIVER_URL']; + + return new Selenium2Driver($browser, null, $seleniumHost); + } + + /** + * {@inheritdoc} + */ + public function skipMessage($testCase, $test) + { + if ('phantomjs' === getenv('WEBDRIVER') && null !== $message = $this->skipPhantomJs($testCase, $test)) { + return $message; + } + + if ( + 'phantomjs' !== getenv('WEBDRIVER') + && 'Behat\Mink\Tests\Driver\Form\Html5Test' === $testCase + && 'testHtml5Types' === $test + ) { + return 'WebDriver does not support setting value in color inputs. See https://code.google.com/p/selenium/issues/detail?id=7650'; + } + + if ( + 'Behat\Mink\Tests\Driver\Js\WindowTest' === $testCase + && 'testWindowMaximize' === $test + && 'true' === getenv('TRAVIS') + ) { + return 'Maximizing the window does not work when running the browser in Xvfb.'; + } + + return parent::skipMessage($testCase, $test); + } + + /** + * {@inheritdoc} + */ + protected function supportsCss() + { + return true; + } + + private function skipPhantomJs($testCase, $test) + { + if ( + 'Behat\Mink\Tests\Driver\Js\WindowTest' === $testCase + && in_array($test, array('testResizeWindow', 'testWindowMaximize')) + ) { + return 'PhantomJS is headless so resizing the window does not make sense.'; + } + + + if ( + 'Behat\Mink\Tests\Driver\Basic\CookieTest' === $testCase + && 'testHttpOnlyCookieIsDeleted' === $test + ) { + return 'This test does not work for PhantomJS. See https://github.com/detro/ghostdriver/issues/170'; + } + + return null; + } +} diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 9b86e3b1f3f..76fc53723ba 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -10,6 +10,7 @@ return array( 'ZendXml\\' => array($vendorDir . '/zendframework/zendxml/library'), 'ZendService\\Amazon\\' => array($vendorDir . '/zendframework/zendservice-amazon/library'), 'ZendRest' => array($vendorDir . '/zendframework/zendrest/library'), + 'WebDriver' => array($vendorDir . '/instaclick/php-webdriver/lib'), 'VuFindHttp\\' => array($vendorDir . '/vufind-org/vufindhttp/src'), 'VuFindCode\\' => array($vendorDir . '/vufind-org/vufindcode/src'), 'SerialsSolutions' => array($vendorDir . '/serialssolutions/summon'), diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 698b2095755..32cb1c52fd2 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -11,6 +11,6 @@ return array( 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), 'LosReCaptcha\\' => array($vendorDir . '/los/losrecaptcha/src'), - 'Behat\\Mink\\Driver\\' => array($vendorDir . '/behat/mink-zombie-driver/src'), + 'Behat\\Mink\\Driver\\' => array($vendorDir . '/behat/mink-zombie-driver/src', $vendorDir . '/behat/mink-selenium2-driver/src'), 'Behat\\Mink\\' => array($vendorDir . '/behat/mink/src'), ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 7b19fe76611..6b753a4cc48 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1401,5 +1401,128 @@ ], "description": "PHP class library to facilitate communication with Integrated Library System (ILS) servers via 3M's SIP2.", "homepage": "https://github.com/cap60552/php-sip2" + }, + { + "name": "instaclick/php-webdriver", + "version": "1.4.3", + "version_normalized": "1.4.3.0", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "time": "2015-06-15 20:19:33", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ] + }, + { + "name": "behat/mink-selenium2-driver", + "version": "v1.3.0", + "version_normalized": "1.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-09-21 21:02:54", + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ] } ] diff --git a/vendor/instaclick/php-webdriver/.coveralls.yml b/vendor/instaclick/php-webdriver/.coveralls.yml new file mode 100644 index 00000000000..6b74c218511 --- /dev/null +++ b/vendor/instaclick/php-webdriver/.coveralls.yml @@ -0,0 +1 @@ +src_dir: lib diff --git a/vendor/instaclick/php-webdriver/.gitignore b/vendor/instaclick/php-webdriver/.gitignore new file mode 100644 index 00000000000..6684277cca9 --- /dev/null +++ b/vendor/instaclick/php-webdriver/.gitignore @@ -0,0 +1,5 @@ +build/ +logs/ +nbproject/ +vendor/ +composer.lock diff --git a/vendor/instaclick/php-webdriver/.travis.yml b/vendor/instaclick/php-webdriver/.travis.yml new file mode 100644 index 00000000000..694a564328d --- /dev/null +++ b/vendor/instaclick/php-webdriver/.travis.yml @@ -0,0 +1,17 @@ +language: php + +php: + - 5.3 + - 5.4 + - 5.5 + - hhvm + +before_script: + - composer install --dev --no-interaction + +script: + - mkdir -p build/logs + - phpunit --coverage-clover build/logs/clover.xml + +after_script: + - vendor/bin/coveralls diff --git a/vendor/instaclick/php-webdriver/README.md b/vendor/instaclick/php-webdriver/README.md new file mode 100644 index 00000000000..24f93bc5fb4 --- /dev/null +++ b/vendor/instaclick/php-webdriver/README.md @@ -0,0 +1,25 @@ +WebDriver for Selenium 2 +======================== +This WebDriver client implementation is based on Facebook's [php-webdriver](https://github.com/facebook/php-webdriver/) project by Justin Bishop. + +Distinguishing features: +* Up-to-date with [Selenium 2 JSON Wire Protocol](http://code.google.com/p/selenium/wiki/JsonWireProtocol) (including WebDriver commands yet to be documented). +* In the *master* branch, class names and file organization follow PSR-0 conventions for php 5.3+ namespaces. +* Coding style follows PSR-1, PSR-2, and Symfony2 conventions. +* Auto-generate API documentation via [phpDocumentor 2.x](http://phpdoc.org/). + +[](https://travis-ci.org/instaclick/php-webdriver) +[](https://coveralls.io/r/instaclick/php-webdriver) +[](https://www.versioneye.com/php/instaclick:php-webdriver/) + +[](https://packagist.org/packages/instaclick/php-webdriver) +[](https://packagist.org/packages/instaclick/php-webdriver) + +Downloads +========= +* [Packagist (dev-master)](http://packagist.org/packages/instaclick/php-webdriver) +* [Github](https://github.com/instaclick/php-webdriver) + +Notes +===== +* The *5.2.x* branch is no longer maintained. This branch features class names and file re-organization that follow PEAR/ZF1 conventions. Bug fixes and enhancements from the master branch likely won't be backported. diff --git a/vendor/instaclick/php-webdriver/composer.json b/vendor/instaclick/php-webdriver/composer.json new file mode 100644 index 00000000000..2be2b179ffd --- /dev/null +++ b/vendor/instaclick/php-webdriver/composer.json @@ -0,0 +1,42 @@ +{ + "name": "instaclick/php-webdriver", + "type": "library", + "description": "PHP WebDriver for Selenium 2", + "keywords": [ + "selenium", + "webdriver", + "webtest", + "browser" + ], + "homepage": "http://instaclick.com/", + "license": "Apache-2.0", + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "require": { + "php": ">=5.3.2", + "ext-curl": "*" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + } +} diff --git a/vendor/instaclick/php-webdriver/doc/README.md b/vendor/instaclick/php-webdriver/doc/README.md new file mode 100644 index 00000000000..edeff43323f --- /dev/null +++ b/vendor/instaclick/php-webdriver/doc/README.md @@ -0,0 +1,202 @@ +php-webdriver -- A very thin wrapper of WebDriver +================================================= + +## DESCRIPTION + +This client aims to be as thin as possible, abusing the dynamic nature of PHP to allow almost all API calls to be a direct transformation of what is defined in the WebDriver protocol itself. + +Most clients require you to first read the protocol to see what's possible, then study the client itself to see how to call it. This hopes to eliminate the latter step, and invites you to rely almost exclusively on http://code.google.com/p/selenium/wiki/JsonWireProtocol + +Each command is just the name of a function call, and each additional path is just another chained function call. The function parameter is then either an array() if the command takes JSON parameters, or an individual primitive if it takes a URL parameter. + +The function's return value is exactly what is returned from the server as part of the protocol definition. If an error is returned, the function will throw the appropriate WebDriverException instance. + +## GETTING STARTED + +* All you need as the server for this client is the selenium-server-standalone-#.jar file provided here: http://code.google.com/p/selenium/downloads/list + +* Download and run that file, replacing # with the current server version. + + java -jar selenium-server-standalone-#.jar + +* Then when you create a session, be sure to pass the url to where your server is running. + + // This would be the url of the host running the server-standalone.jar + $wd_host = 'http://localhost:4444/wd/hub'; // this is the default + $web_driver = new WebDriver($wd_host); + + // First param to session() is the 'browserName' (default = 'firefox') + // Second param is a JSON object of additional 'desiredCapabilities' + + // POST /session + $session = $web_driver->session('firefox'); + +* See also [wiki page for launching different browsers](https://github.com/facebook/php-webdriver/wiki/Launching-Browsers). + +## SIMPLE EXAMPLES + +### Note that all of these match the Protocol exactly +* Move to a specific spot on the screen + + // POST /session/:sessionId/moveto + $session->moveto(array('xoffset' => 3, 'yoffset' => 300)); + +* Get the current url + + // GET /session/:sessionId/url + $session->url(); + +* Change focus to another frame + + // POST /session/:sessionId/frame + $session->frame(array('id' => 'some_frame_id')); + +* Get a list of window handles for all open windows + + // GET /session/:sessionId/window_handles + $session->window_handles(); + +* Accept the currently displayed alert dialog + + // POST /session/:sessionId/accept_alert + $session->accept_alert(); + +* Change asynchronous script timeout + + // POST /session/:sessionId/timeouts/async_script + $session->timeouts()->async_script(array('ms' => 2000)); + +* Doubleclick an element on a touch screen + + // POST session/:sessionId/touch/doubleclick + $session->touch()->doubleclick(array('element' => $element->getID()) + +* Check if two elements are equal + + // GET /session/:sessionId/element/:id/equals/:other + $element->equals($other_element->getID())) + +* Get value of a css property on element + + // GET /session/:sessionId/element/:id/css/:propertyName + $element->css($property_name) + +## 'GET', 'POST', or 'DELETE' to the same command examples + +### When you can do multiple http methods for the same command, call the command directly for the 'GET', and prepend the http method for the 'POST' or 'DELETE'. + +* Set landscape orientation with 'POST' + + // POST /session/:sessionId/orientation + $session->postOrientation(array('orientation' => 'LANDSCAPE')); + +* Get landscape orientation with normal 'GET' + + // GET /session/:sessionId/orientation + $session->orientation(); + +* Set size of window that has $window_handle with 'POST' + + // If excluded, $window_handle defaults to 'current' + // POST /session/:sessionId/window/:windowHandle/size + $session + ->window($window_handle) + ->postSize(array('width' => 10, 'height' => 10)); + +* Get current window size with 'GET' + + // GET /session/:sessionId/window/:windowHandle/size + $session->window()->size(); + +## Some unavoidable exceptions to direct protocol translation. + +* Opening pages + + // POST /session/:sessionId/url + $session->open('http://www.facebook.com'); + +* Dealing with the session + + // DELETE /session/:sessionId + $session->close(); + + // GET /session/:sessionId + $session->capabilities(); + +* To find elements + + // POST /session/:sessionId/element + $element = $session->element($using, $value); + + // POST /session/:sessionId/elements + $session->elements($using, $value); + + // POST /session/:sessionId/element/:id/element + $element->element($using, $value); + + // POST /session/:sessionId/element/:id/elements + $element->elements($using, $value); + +* To get the active element + + // POST /session/:sessionId/element/active + $session->activeElement(); + +* To manipulate cookies + + // GET /session/:sessionId/cookie + $session->getAllCookies(); + + // POST /session/:sessionId/cookie + $session->setCookie($cookie_json); + + // DELETE /session/:sessionId/cookie + $session->deleteAllCookies() + + // DELETE /session/:sessionId/cookie/:name + $session->deleteCookie($name) + +* To manipulate windows + + // POST /session/:sessionId/window + $session->focusWindow($window_handle); + + // DELETE /session/:sessionId/window + $session->deleteWindow(); + +## More esoteric examples + +* To set curl options (e.g., timeout and proxy settings) + +``` +use WebDriver\Service\CurlService; +use WebDriver\ServiceFactory; + +class MyCurlService extends CurlService +{ + const PROXY = 'http://proxyHost:8080'; + const AUTH = 'proxyUser:proxyPassword'; + + /** + * {@inheritdoc} + */ + public function execute($requestMethod, $url, $parameters = null, $extraOptions = null) + { + $extraOptions = array_replace( + $extraOptions, + array( + CURLOPT_CONNECTTIMEOUT => 30, + CURLOPT_TIMEOUT => 300, + CURLOPT_PROXY => self::PROXY, + CURLOPT_PROXYUSERPWD => self::AUTH, + ) + ); + + return parent::execute($requestMethod, $url, $parameters, $extraOptions); + } +} + +ServiceFactory::setServiceClass('service.curl', 'MyCurlService'); +``` + + diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php b/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php new file mode 100644 index 00000000000..63b8e790514 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php @@ -0,0 +1,229 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + * @author Fabrizio Branca <mail@fabrizio-branca.de> + * @author Tsz Ming Wong <tszming@gmail.com> + */ + +namespace WebDriver; + +use WebDriver\Exception as WebDriverException; + +/** + * Abstract WebDriver\AbstractWebDriver class + * + * @package WebDriver + */ +abstract class AbstractWebDriver +{ + /** + * URL + * + * @var string + */ + protected $url; + + /** + * Return array of supported method names and corresponding HTTP request methods + * + * @return array + */ + abstract protected function methods(); + + /** + * Return array of obsolete method names and corresponding HTTP request methods + * + * @return array + */ + protected function obsoleteMethods() + { + return array(); + } + + /** + * Constructor + * + * @param string $url URL to Selenium server + */ + public function __construct($url = 'http://localhost:4444/wd/hub') + { + $this->url = $url; + } + + /** + * Magic method which returns URL to Selenium server + * + * @return string + */ + public function __toString() + { + return $this->url; + } + + /** + * Returns URL to Selenium server + * + * @return string + */ + public function getURL() + { + return $this->url; + } + + /** + * Curl request to webdriver server. + * + * @param string $requestMethod HTTP request method, e.g., 'GET', 'POST', or 'DELETE' + * @param string $command If not defined in methods() this function will throw. + * @param array $parameters If an array(), they will be posted as JSON parameters + * If a number or string, "/$params" is appended to url + * @param array $extraOptions key=>value pairs of curl options to pass to curl_setopt() + * + * @return array array('value' => ..., 'info' => ...) + * + * @throws \WebDriver\Exception if error + */ + protected function curl($requestMethod, $command, $parameters = null, $extraOptions = array()) + { + if ($parameters && is_array($parameters) && $requestMethod !== 'POST') { + throw WebDriverException::factory( + WebDriverException::NO_PARAMETERS_EXPECTED, + sprintf( + 'The http request method called for %s is %s but it has to be POST if you want to pass the JSON parameters %s', + $command, + $requestMethod, + json_encode($parameters) + ) + ); + } + + $url = sprintf('%s%s', $this->url, $command); + + if ($parameters && (is_int($parameters) || is_string($parameters))) { + $url .= '/' . $parameters; + } + + list($rawResult, $info) = ServiceFactory::getInstance()->getService('service.curl')->execute($requestMethod, $url, $parameters, $extraOptions); + + $result = json_decode($rawResult, true); + $value = null; + + if (is_array($result) && array_key_exists('value', $result)) { + $value = $result['value']; + } + + $message = null; + + if (is_array($value) && array_key_exists('message', $value)) { + $message = $value['message']; + } + + // if not success, throw exception + if ((int) $result['status'] !== 0) { + throw WebDriverException::factory($result['status'], $message); + } + + $sessionId = isset($result['sessionId']) + ? $result['sessionId'] + : (isset($value['webdriver.remote.sessionid']) + ? $value['webdriver.remote.sessionid'] + : null); + + return array( + 'value' => $value, + 'info' => $info, + 'sessionId' => $sessionId, + 'sessionUrl' => $sessionId ? $this->url . '/session/' . $sessionId : $info['url'], + ); + } + + /** + * Magic method that maps calls to class methods to execute WebDriver commands + * + * @param string $name Method name + * @param array $arguments Arguments + * + * @return mixed + * + * @throws \WebDriver\Exception if invalid WebDriver command + */ + public function __call($name, $arguments) + { + if (count($arguments) > 1) { + throw WebDriverException::factory( + WebDriverException::JSON_PARAMETERS_EXPECTED, + 'Commands should have at most only one parameter, which should be the JSON Parameter object' + ); + } + + if (preg_match('/^(get|post|delete)/', $name, $matches)) { + $requestMethod = strtoupper($matches[0]); + $webdriverCommand = strtolower(substr($name, strlen($requestMethod))); + } else { + $webdriverCommand = $name; + $requestMethod = $this->getRequestMethod($webdriverCommand); + } + + $methods = $this->methods(); + if (!in_array($requestMethod, (array) $methods[$webdriverCommand])) { + throw WebDriverException::factory( + WebDriverException::INVALID_REQUEST, + sprintf( + '%s is not an available http request method for the command %s.', + $requestMethod, + $webdriverCommand + ) + ); + } + + $result = $this->curl( + $requestMethod, + '/' . $webdriverCommand, + array_shift($arguments) + ); + + return $result['value']; + } + + /** + * Get default HTTP request method for a given WebDriver command + * + * @param string $webdriverCommand + * + * @return string + * + * @throws \WebDriver\Exception if invalid WebDriver command + */ + private function getRequestMethod($webdriverCommand) + { + if (!array_key_exists($webdriverCommand, $this->methods())) { + throw WebDriverException::factory( + array_key_exists($webdriverCommand, $this->obsoleteMethods()) + ? WebDriverException::OBSOLETE_COMMAND : WebDriverException::UNKNOWN_COMMAND, + sprintf('%s is not a valid WebDriver command.', $webdriverCommand) + ); + } + + $methods = $this->methods(); + $requestMethods = (array) $methods[$webdriverCommand]; + + return array_shift($requestMethods); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/AppCacheStatus.php b/vendor/instaclick/php-webdriver/lib/WebDriver/AppCacheStatus.php new file mode 100644 index 00000000000..272fa1a4599 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/AppCacheStatus.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright 2012-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\AppCacheStatus class + * + * @package WebDriver + */ +final class AppCacheStatus +{ + /** + * Application cache status + * + * @see https://code.google.com/p/selenium/source/browse/java/client/src/org/openqa/selenium/html5/AppCacheStatus.java + */ + const UNCACHED = 0; + const IDLE = 1; + const CHECKING = 2; + const DOWNLOADING = 3; + const UPDATE_READY = 4; + const OBSOLETE = 5; +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/ApplicationCache.php b/vendor/instaclick/php-webdriver/lib/WebDriver/ApplicationCache.php new file mode 100644 index 00000000000..f7dfa51fbd1 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/ApplicationCache.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright 2012-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\ApplicationCache class + * + * @package WebDriver + * + * @method integer status() Get application cache status. + */ +final class ApplicationCache extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'status' => array('GET'), + ); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Browser.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Browser.php new file mode 100644 index 00000000000..7ed0b788bd7 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Browser.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright 2011-2014 Fabrizio Branca. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Fabrizio Branca <mail@fabrizio-branca.de> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Browser class + * + * @package WebDriver + */ +final class Browser +{ + /** + * Check browser names used in static functions in the selenium source: + * @see http://code.google.com/p/selenium/source/browse/java/client/src/org/openqa/selenium/remote/DesiredCapabilities.java + * + * Note: Capability array takes these browserNames and not the "browserTypes" + * + * Also check + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Capabilities_JSON_Object + */ + const ANDROID = 'android'; + const CHROME = 'chrome'; + const FIREFOX = 'firefox'; + const HTMLUNIT = 'htmlunit'; + const IE = 'internet explorer'; + const INTERNET_EXPLORER = 'internet explorer'; + const IPHONE = 'iPhone'; + const IPAD = 'iPad'; + const OPERA = 'opera'; + const PHANTOMJS = 'phantomjs'; + const SAFARI = 'safari'; +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Capability.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Capability.php new file mode 100644 index 00000000000..4c8b3e25b52 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Capability.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright 2011-2014 Fabrizio Branca. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Fabrizio Branca <mail@fabrizio-branca.de> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Capability class + * + * @package WebDriver + */ +class Capability +{ + /** + * Desired capabilities + * + * @see http://code.google.com/p/selenium/source/browse/trunk/java/client/src/org/openqa/selenium/remote/CapabilityType.java + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Capabilities_JSON_Object + */ + const BROWSER_NAME = 'browserName'; + const VERSION = 'version'; + const PLATFORM = 'platform'; + const JAVASCRIPT_ENABLED = 'javascriptEnabled'; + const TAKES_SCREENSHOT = 'takesScreenshot'; + const HANDLES_ALERTS = 'handlesAlerts'; + const DATABASE_ENABLED = 'databaseEnabled'; + const LOCATION_CONTEXT_ENABLED = 'locationContextEnabled'; + const APPLICATION_CACHE_ENABLED = 'applicationCacheEnabled'; + const BROWSER_CONNECTION_ENABLED = 'browserConnectionEnabled'; + const CSS_SELECTORS_ENABLED = 'cssSelectorsEnabled'; + const WEB_STORAGE_ENABLED = 'webStorageEnabled'; + const ROTATABLE = 'rotatable'; + const ACCEPT_SSL_CERTS = 'acceptSslCerts'; + const NATIVE_EVENTS = 'nativeEvents'; + const PROXY = 'proxy'; + const UNEXPECTED_ALERT_BEHAVIOUR = 'unexpectedAlertBehaviour'; + const ELEMENT_SCROLL_BEHAVIOR = 'elementScrollBehavior'; + + /** + * Proxy types + * + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Proxy_JSON_Object + */ + const DIRECT = 'direct'; + const MANUAL = 'manual'; + const PAC = 'pac'; + const AUTODETECT = 'autodetect'; + const SYSTEM = 'system'; +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/ClassLoader.php b/vendor/instaclick/php-webdriver/lib/WebDriver/ClassLoader.php new file mode 100644 index 00000000000..55ae4c797ce --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/ClassLoader.php @@ -0,0 +1,85 @@ +<?php +/** + * Copyright 2012-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\ClassLoader (autoloader) class + * + * @package WebDriver + */ +final class ClassLoader +{ + /** + * Load class + * + * @param string $class Class name + */ + public static function loadClass($class) + { + $file = strpos($class, '\\') !== false + ? str_replace('\\', DIRECTORY_SEPARATOR, $class) + : str_replace('_', DIRECTORY_SEPARATOR, $class); + + $path = dirname(__DIR__) . DIRECTORY_SEPARATOR . $file . '.php'; + + if (file_exists($path)) { + include_once $path; + } + } + + /** + * Autoloader + * + * @param string $class Class name + */ + public static function autoload($class) + { + try { + self::loadClass($class); + } catch (Exception $e) { + } + } +} + +if (function_exists('spl_autoload_register')) { + /** + * use the SPL autoload stack + */ + spl_autoload_register(array('WebDriver\ClassLoader', 'autoload')); + + /** + * preserve any existing __autoload + */ + if (function_exists('__autoload')) { + spl_autoload_register('__autoload'); + } +} else { + /** + * Our fallback; only one __autoload per PHP instance + * + * @param string $class Class name + */ + function __autoload($class) + { + ClassLoader::autoload($class); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php new file mode 100644 index 00000000000..00c690ec4d3 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php @@ -0,0 +1,229 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + * @author Fabrizio Branca <mail@fabrizio-branca.de> + */ + +namespace WebDriver; + +use WebDriver\Exception as WebDriverException; + +/** + * Abstract WebDriver\Container class + * + * @package WebDriver + */ +abstract class Container extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + public function __construct($url = 'http://localhost:4444/wd/hub') + { + parent::__construct($url); + + $locatorStrategy = new \ReflectionClass('WebDriver\LocatorStrategy'); + $this->strategies = $locatorStrategy->getConstants(); + } + + /** + * Find element: /session/:sessionId/element (POST) + * Find child element: /session/:sessionId/element/:id/element (POST) + * Search for element on page, starting from the document root. + * + * @param string $using the locator strategy to use + * @param string $value the search target + * + * @return \WebDriver\Element + * + * @throws \WebDriver\Exception if element not found, or invalid XPath + */ + public function element($using = null, $value = null) + { + $locatorJson = $this->parseArgs('element', func_get_args()); + + try { + $result = $this->curl( + 'POST', + '/element', + $locatorJson + ); + } catch (WebDriverException\NoSuchElement $e) { + throw WebDriverException::factory( + WebDriverException::NO_SUCH_ELEMENT, + sprintf( + "Element not found with %s, %s\n\n%s", + $locatorJson['using'], + $locatorJson['value'], + $e->getMessage() + ), + $e + ); + } + + $element = $this->webDriverElement($result['value']); + + if ($element === null) { + throw WebDriverException::factory(WebDriverException::NO_SUCH_ELEMENT, + sprintf( + "Element not found with %s, %s\n", + $locatorJson['using'], + $locatorJson['value'] + ) + ); + } + + return $element; + } + + /** + * Find elements: /session/:sessionId/elements (POST) + * Find child elements: /session/:sessionId/element/:id/elements (POST) + * Search for multiple elements on page, starting from the document root. + * + * @param string $using the locator strategy to use + * @param string $value the search target + * + * @return array + * + * @throws \WebDriver\Exception if invalid XPath + */ + public function elements($using = null, $value = null) + { + $locatorJson = $this->parseArgs('elements', func_get_args()); + + $result = $this->curl( + 'POST', + '/elements', + $locatorJson + ); + + if (!is_array($result['value'])) { + return array(); + } + + return array_filter(array_map( + array($this, 'webDriverElement'), $result['value'] + )); + } + + /** + * Parse arguments allowing either separate $using and $value parameters, or + * as an array containing the JSON parameters + * + * @param string $method method name + * @param array $argv arguments + * + * @return array + * + * @throws \WebDriver\Exception if invalid number of arguments to the called method + */ + private function parseArgs($method, $argv) + { + $argc = count($argv); + + switch ($argc) { + case 2: + $using = $argv[0]; + $value = $argv[1]; + break; + + case 1: + $arg = $argv[0]; + if (is_array($arg)) { + $using = $arg['using']; + $value = $arg['value']; + break; + } + + default: + throw WebDriverException::factory( + WebDriverException::JSON_PARAMETERS_EXPECTED, + sprintf('Invalid arguments to %s method: %s', $method, print_r($argv, true)) + ); + } + + return $this->locate($using, $value); + } + + /** + * Return JSON parameter for element / elements command + * + * @param string $using locator strategy + * @param string $value search target + * + * @return array + * + * @throws \WebDriver\Exception if invalid locator strategy + */ + public function locate($using, $value) + { + if (!in_array($using, $this->strategies)) { + throw WebDriverException::factory( + WebDriverException::UNKNOWN_LOCATOR_STRATEGY, + sprintf('Invalid locator strategy %s', $using) + ); + } + + return array( + 'using' => $using, + 'value' => $value, + ); + } + + /** + * Return WebDriver\Element wrapper for $value + * + * @param mixed $value + * + * @return \WebDriver\Element|null + */ + protected function webDriverElement($value) + { + return array_key_exists('ELEMENT', (array) $value) + ? new Element( + $this->getElementPath($value['ELEMENT']), // url + $value['ELEMENT'] // id + ) + : null; + } + + /** + * {@inheritdoc} + */ + public function __call($name, $arguments) + { + if (count($arguments) === 1 && in_array(str_replace('_', ' ', $name), $this->strategies)) { + return $this->locate($name, $arguments[0]); + } + + // fallback to executing WebDriver commands + return parent::__call($name, $arguments); + } + + /** + * Get wire protocol URL for an element + * + * @param string $elementId + * + * @return string + */ + abstract protected function getElementPath($elementId); +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Element.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Element.php new file mode 100644 index 00000000000..4674b61760b --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Element.php @@ -0,0 +1,124 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + * @author Fabrizio Branca <mail@fabrizio-branca.de> + */ + +namespace WebDriver; + +/** + * WebDriver\Element class + * + * @package WebDriver + * + * @method void click() Click on an element. + * @method void submit() Submit a FORM element. + * @method string text() Returns the visible text for the element. + * @method void postValue($json) Send a sequence of key strokes to an element. + * @method string name() Query for an element's tag name. + * @method void clear() Clear a TEXTAREA or text INPUT element's value. + * @method boolean selected() Determine if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected. + * @method boolean enabled() Determine if an element is currently enabled. + * @method string attribute($attributeName) Get the value of an element's attribute. + * @method boolean equals($otherId) Test if two element IDs refer to the same DOM element. + * @method boolean displayed() Determine if an element is currently displayed. + * @method array location() Determine an element's location on the page. + * @method array location_in_view() Determine an element's location on the screen once it has been scrolled into view. + * @method array size() Determine an element's size in pixels. + * @method string css($propertyName) Query the value of an element's computed CSS property. + */ +final class Element extends Container +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'click' => array('POST'), + 'submit' => array('POST'), + 'text' => array('GET'), + 'value' => array('POST'), + 'name' => array('GET'), + 'clear' => array('POST'), + 'selected' => array('GET'), + 'enabled' => array('GET'), + 'attribute' => array('GET'), + 'equals' => array('GET'), + 'displayed' => array('GET'), + 'location' => array('GET'), + 'location_in_view' => array('GET'), + 'size' => array('GET'), + 'css' => array('GET'), + ); + } + + /** + * {@inheritdoc} + */ + protected function obsoleteMethods() + { + return array( + 'value' => array('GET'), + 'selected' => array('POST'), + 'toggle' => array('POST'), + 'hover' => array('POST'), + 'drag' => array('POST'), + ); + } + + /** + * Element ID + * + * @var string + */ + private $id; + + /** + * Constructor + * + * @param string $url URL + * @param string $id element ID + */ + public function __construct($url, $id) + { + parent::__construct($url); + + $this->id = $id; + } + + /** + * Get element ID + * + * @return string + */ + public function getID() + { + return $this->id; + } + + /** + * {@inheritdoc} + */ + protected function getElementPath($elementId) + { + return preg_replace(sprintf('/%s$/', $this->id), $elementId, $this->url); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php new file mode 100644 index 00000000000..b0f44f8146e --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php @@ -0,0 +1,157 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Exception class + * + * @package WebDriver + */ +abstract class Exception extends \Exception +{ + /** + * Response status codes + * + * @link http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes + */ + const SUCCESS = 0; + const NO_SUCH_DRIVER = 6; + const NO_SUCH_ELEMENT = 7; + const NO_SUCH_FRAME = 8; + const UNKNOWN_COMMAND = 9; + const STALE_ELEMENT_REFERENCE = 10; + const ELEMENT_NOT_VISIBLE = 11; + const INVALID_ELEMENT_STATE = 12; + const UNKNOWN_ERROR = 13; + const ELEMENT_IS_NOT_SELECTABLE = 15; + const JAVASCRIPT_ERROR = 17; + const XPATH_LOOKUP_ERROR = 19; + const TIMEOUT = 21; + const NO_SUCH_WINDOW = 23; + const INVALID_COOKIE_DOMAIN = 24; + const UNABLE_TO_SET_COOKIE = 25; + const UNEXPECTED_ALERT_OPEN = 26; + const NO_ALERT_OPEN_ERROR = 27; + const SCRIPT_TIMEOUT = 28; + const INVALID_ELEMENT_COORDINATES = 29; + const IME_NOT_AVAILABLE = 30; + const IME_ENGINE_ACTIVATION_FAILED = 31; + const INVALID_SELECTOR = 32; + const SESSION_NOT_CREATED = 33; + const MOVE_TARGET_OUT_OF_BOUNDS = 34; + + // obsolete + const INDEX_OUT_OF_BOUNDS = 1; + const NO_COLLECTION = 2; + const NO_STRING = 3; + const NO_STRING_LENGTH = 4; + const NO_STRING_WRAPPER = 5; + const OBSOLETE_ELEMENT = 10; + const ELEMENT_NOT_DISPLAYED = 11; + const UNHANDLED = 13; + const EXPECTED = 14; + const ELEMENT_NOT_SELECTABLE = 15; + const NO_SUCH_DOCUMENT = 16; + const UNEXPECTED_JAVASCRIPT = 17; + const NO_SCRIPT_RESULT = 18; + const NO_SUCH_COLLECTION = 20; + const NULL_POINTER = 22; + const NO_MODAL_DIALOG_OPEN_ERROR = 27; + + // user-defined + const CURL_EXEC = -1; + const OBSOLETE_COMMAND = -2; + const NO_PARAMETERS_EXPECTED = -3; + const JSON_PARAMETERS_EXPECTED = -4; + const UNEXPECTED_PARAMETERS = -5; + const INVALID_REQUEST = -6; + const UNKNOWN_LOCATOR_STRATEGY = -7; + + private static $errs = array( +// self::SUCCESS => array('Success', 'This should never be thrown!'), + + self::NO_SUCH_DRIVER => array('NoSuchDriver', 'A session is either terminated or not started'), + self::NO_SUCH_ELEMENT => array('NoSuchElement', 'An element could not be located on the page using the given search parameters.'), + self::NO_SUCH_FRAME => array('NoSuchFrame', 'A request to switch to a frame could not be satisfied because the frame could not be found.'), + self::UNKNOWN_COMMAND => array('UnknownCommand', 'The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource.'), + self::STALE_ELEMENT_REFERENCE => array('StaleElementReference', 'An element command failed because the referenced element is no longer attached to the DOM.'), + self::ELEMENT_NOT_VISIBLE => array('ElementNotVisible', 'An element command could not be completed because the element is not visible on the page.'), + self::INVALID_ELEMENT_STATE => array('InvalidElementState', 'An element command could not be completed because the element is in an invalid state (e.g., attempting to click a disabled element).'), + self::UNKNOWN_ERROR => array('UnknownError', 'An unknown server-side error occurred while processing the command.'), + self::ELEMENT_IS_NOT_SELECTABLE => array('ElementIsNotSelectable', 'An attempt was made to select an element that cannot be selected.'), + self::JAVASCRIPT_ERROR => array('JavaScriptError', 'An error occurred while executing user supplied JavaScript.'), + self::XPATH_LOOKUP_ERROR => array('XPathLookupError', 'An error occurred while searching for an element by XPath.'), + self::TIMEOUT => array('Timeout', 'An operation did not complete before its timeout expired.'), + self::NO_SUCH_WINDOW => array('NoSuchWindow', 'A request to switch to a different window could not be satisfied because the window could not be found.'), + self::INVALID_COOKIE_DOMAIN => array('InvalidCookieDomain', 'An illegal attempt was made to set a cookie under a different domain than the current page.'), + self::UNABLE_TO_SET_COOKIE => array('UnableToSetCookie', 'A request to set a cookie\'s value could not be satisfied.'), + self::UNEXPECTED_ALERT_OPEN => array('UnexpectedAlertOpen', 'A modal dialog was open, blocking this operation'), + self::NO_ALERT_OPEN_ERROR => array('NoAlertOpenError', 'An attempt was made to operate on a modal dialog when one was not open.'), + self::SCRIPT_TIMEOUT => array('ScriptTimeout', 'A script did not complete before its timeout expired.'), + self::INVALID_ELEMENT_COORDINATES => array('InvalidElementCoordinates', 'The coordinates provided to an interactions operation are invalid.'), + self::IME_NOT_AVAILABLE => array('IMENotAvailable', 'IME was not available.'), + self::IME_ENGINE_ACTIVATION_FAILED => array('IMEEngineActivationFailed', 'An IME engine could not be started.'), + self::INVALID_SELECTOR => array('InvalidSelector', 'Argument was an invalid selector (e.g., XPath/CSS).'), + self::SESSION_NOT_CREATED => array('SessionNotCreated', 'A new session could not be created (e.g., a required capability could not be set).'), + self::MOVE_TARGET_OUT_OF_BOUNDS => array('MoveTargetOutOfBounds', 'Target provided for a move action is out of bounds.'), + + self::CURL_EXEC => array('CurlExec', 'curl_exec() error.'), + self::OBSOLETE_COMMAND => array('ObsoleteCommand', 'This WebDriver command is obsolete.'), + self::NO_PARAMETERS_EXPECTED => array('NoParametersExpected', 'This HTTP request method expects no parameters.'), + self::JSON_PARAMETERS_EXPECTED => array('JsonParameterExpected', 'This POST request expects a JSON parameter (array).'), + self::UNEXPECTED_PARAMETERS => array('UnexpectedParameters', 'This command does not expect this number of parameters.'), + self::INVALID_REQUEST => array('InvalidRequest', 'This command does not support this HTTP request method.'), + self::UNKNOWN_LOCATOR_STRATEGY => array('UnknownLocatorStrategy', 'This locator strategy is not supported.'), + ); + + /** + * Factory method to create WebDriver\Exception objects + * + * @param integer $code Code + * @param string $message Message + * @param \Exception $previousException Previous exception + * + * @return \Exception + */ + public static function factory($code, $message = null, $previousException = null) + { + // unknown error + if (!isset(self::$errs[$code])) { + if (trim($message) === '') { + $message = 'Unknown Error'; + } + + return new \Exception($message, $code, $previousException); + } + + $errorDefinition = self::$errs[$code]; + + if (trim($message) === '') { + $message = $errorDefinition[1]; + } + + $className = __CLASS__ . '\\' . $errorDefinition[0]; + + return new $className($message, $code, $previousException); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/CurlExec.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/CurlExec.php new file mode 100644 index 00000000000..e42c36659d4 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/CurlExec.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\CurlExec class + * + * @package WebDriver + */ +final class CurlExec extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementIsNotSelectable.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementIsNotSelectable.php new file mode 100644 index 00000000000..70cde9d4aaa --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementIsNotSelectable.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\ElementIsNotSelectable class + * + * @package WebDriver + */ +final class ElementIsNotSelectable extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementNotVisible.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementNotVisible.php new file mode 100644 index 00000000000..89ddf7e940b --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ElementNotVisible.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\ElementNotVisible class + * + * @package WebDriver + */ +final class ElementNotVisible extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMEEngineActivationFailed.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMEEngineActivationFailed.php new file mode 100644 index 00000000000..2b0b986e1b7 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMEEngineActivationFailed.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\IMEEngineActivationFailed class + * + * @package WebDriver + */ +final class IMEEngineActivationFailed extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMENotAvailable.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMENotAvailable.php new file mode 100644 index 00000000000..5739900bc9a --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/IMENotAvailable.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\IMENotAvailable class + * + * @package WebDriver + */ +final class IMENotAvailable extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidCookieDomain.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidCookieDomain.php new file mode 100644 index 00000000000..6703df47e73 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidCookieDomain.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\InvalidCookieDomain class + * + * @package WebDriver + */ +final class InvalidCookieDomain extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementCoordinates.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementCoordinates.php new file mode 100644 index 00000000000..d1ccb2119dd --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementCoordinates.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\InvalidElementCoordinates class + * + * @package WebDriver + */ +final class InvalidElementCoordinates extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementState.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementState.php new file mode 100644 index 00000000000..65f87b92a75 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidElementState.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\InvalidElementState class + * + * @package WebDriver + */ +final class InvalidElementState extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidRequest.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidRequest.php new file mode 100644 index 00000000000..a663e2326d8 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidRequest.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\InvalidRequest class + * + * @package WebDriver + */ +final class InvalidRequest extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidSelector.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidSelector.php new file mode 100644 index 00000000000..90a1f91a256 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/InvalidSelector.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\InvalidSelector class + * + * @package WebDriver + */ +final class InvalidSelector extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JavaScriptError.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JavaScriptError.php new file mode 100644 index 00000000000..cb151ea5611 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JavaScriptError.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\JavaScriptError class + * + * @package WebDriver + */ +final class JavaScriptError extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JsonParameterExpected.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JsonParameterExpected.php new file mode 100644 index 00000000000..e62b281a80a --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/JsonParameterExpected.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\JsonParameterExpected class + * + * @package WebDriver + */ +final class JsonParameterExpected extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/MoveTargetOutOfBounds.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/MoveTargetOutOfBounds.php new file mode 100644 index 00000000000..734a277a96e --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/MoveTargetOutOfBounds.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\MoveTargetOutOfBounds class + * + * @package WebDriver + */ +final class MoveTargetOutOfBounds extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoAlertOpenError.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoAlertOpenError.php new file mode 100644 index 00000000000..0536eabdaf7 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoAlertOpenError.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\NoAlertOpenError class + * + * @package WebDriver + */ +final class NoAlertOpenError extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoParametersExpected.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoParametersExpected.php new file mode 100644 index 00000000000..f15ef0ab617 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoParametersExpected.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\NoParametersExpected class + * + * @package WebDriver + */ +final class NoParametersExpected extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchDriver.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchDriver.php new file mode 100644 index 00000000000..d799cbbfeec --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchDriver.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\NoSuchDriver class + * + * @package WebDriver + */ +final class NoSuchDriver extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchElement.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchElement.php new file mode 100644 index 00000000000..35b6985a0d1 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchElement.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\NoSuchElement class + * + * @package WebDriver + */ +final class NoSuchElement extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchFrame.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchFrame.php new file mode 100644 index 00000000000..92461a3ad62 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchFrame.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\NoSuchFrame class + * + * @package WebDriver + */ +final class NoSuchFrame extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchWindow.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchWindow.php new file mode 100644 index 00000000000..58205b37579 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/NoSuchWindow.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\NoSuchWindow class + * + * @package WebDriver + */ +final class NoSuchWindow extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ObsoleteCommand.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ObsoleteCommand.php new file mode 100644 index 00000000000..0bb0f0a585f --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ObsoleteCommand.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\ObsoleteCommand class + * + * @package WebDriver + */ +final class ObsoleteCommand extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ScriptTimeout.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ScriptTimeout.php new file mode 100644 index 00000000000..49a82225475 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/ScriptTimeout.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\ScriptTimeout class + * + * @package WebDriver + */ +final class ScriptTimeout extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/SessionNotCreated.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/SessionNotCreated.php new file mode 100644 index 00000000000..c149fbd01ac --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/SessionNotCreated.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\SessionNotCreated class + * + * @package WebDriver + */ +final class SessionNotCreated extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/StaleElementReference.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/StaleElementReference.php new file mode 100644 index 00000000000..1c6842be78c --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/StaleElementReference.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\StaleElementReference class + * + * @package WebDriver + */ +final class StaleElementReference extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/Timeout.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/Timeout.php new file mode 100644 index 00000000000..317d1b0d384 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/Timeout.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\Timeout class + * + * @package WebDriver + */ +final class Timeout extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnableToSetCookie.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnableToSetCookie.php new file mode 100644 index 00000000000..221b49ae3f7 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnableToSetCookie.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\UnableToSetCookie class + * + * @package WebDriver + */ +final class UnableToSetCookie extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedAlertOpen.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedAlertOpen.php new file mode 100644 index 00000000000..666a3c69bca --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedAlertOpen.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\UnexpectedAlertOpen class + * + * @package WebDriver + */ +final class UnexpectedAlertOpen extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedParameters.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedParameters.php new file mode 100644 index 00000000000..3f218309fc2 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnexpectedParameters.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\UnexpectedParameters class + * + * @package WebDriver + */ +final class UnexpectedParameters extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownCommand.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownCommand.php new file mode 100644 index 00000000000..830d5e05425 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownCommand.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\UnknownCommand class + * + * @package WebDriver + */ +final class UnknownCommand extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownError.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownError.php new file mode 100644 index 00000000000..9b4d3932dd8 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownError.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\UnknownError class + * + * @package WebDriver + */ +final class UnknownError extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownLocatorStrategy.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownLocatorStrategy.php new file mode 100644 index 00000000000..f0ae9c8394d --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/UnknownLocatorStrategy.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\UnknownLocatorStrategy class + * + * @package WebDriver + */ +final class UnknownLocatorStrategy extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/XPathLookupError.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/XPathLookupError.php new file mode 100644 index 00000000000..28dcb330121 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Exception/XPathLookupError.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Exception; + +use WebDriver\Exception as BaseException; + +/** + * WebDriver\Exception\XPathLookupError class + * + * @package WebDriver + */ +final class XPathLookupError extends BaseException { +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Frame.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Frame.php new file mode 100644 index 00000000000..c070f57ffac --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Frame.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright 2011-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Frame class + * + * @package WebDriver + * + * @method void parentt() Change focus to the parent context. + */ +final class Frame extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'parent' => array('POST'), + ); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Ime.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Ime.php new file mode 100644 index 00000000000..5f31f67ad04 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Ime.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright 2011-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Ime class + * + * @package WebDriver + * + * @method array available_engines() List all available engines on the machines. + * @method string active_engine() Get the name of the active IME engine. + * @method boolean activated() Indicates whether IME input is active at the moment. + * @method void deactivate() De-activates the currently active IME engine. + * @method void activate($json) Make an engine that is available active. + */ +final class Ime extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'available_engines' => array('GET'), + 'active_engine' => array('GET'), + 'activated' => array('GET'), + 'deactivate' => array('POST'), + 'activate' => array('POST'), + ); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Key.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Key.php new file mode 100644 index 00000000000..9f350c1bd0c --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Key.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright 2011-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + * @author Fabrizio Branca <mail@fabrizio-branca.de> + */ + +namespace WebDriver; + +/** + * WebDriver\Key class + * + * @package WebDriver + */ +final class Key +{ + /* + * The Unicode "Private Use Area" code points (0xE000-0xF8FF) are used to represent + * pressable, non-text keys. + * + * @link http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value + * + * key_name = "UTF-8"; // UCS-2 + */ + const NULL_KEY = "\xEE\x80\x80"; // E000 + const CANCEL = "\xEE\x80\x81"; // E001 + const HELP = "\xEE\x80\x82"; // E002 + const BACKSPACE = "\xEE\x80\x83"; // E003 + const TAB = "\xEE\x80\x84"; // E004 + const CLEAR = "\xEE\x80\x85"; // E005 + const RETURN_KEY = "\xEE\x80\x86"; // E006 + const ENTER = "\xEE\x80\x87"; // E007 + const SHIFT = "\xEE\x80\x88"; // E008 + const CONTROL = "\xEE\x80\x89"; // E009 + const ALT = "\xEE\x80\x8A"; // E00A + const PAUSE = "\xEE\x80\x8B"; // E00B + const ESCAPE = "\xEE\x80\x8C"; // E00C + const SPACE = "\xEE\x80\x8D"; // E00D + const PAGE_UP = "\xEE\x80\x8E"; // E00E + const PAGE_DOWN = "\xEE\x80\x8F"; // E00F + const END = "\xEE\x80\x90"; // E010 + const HOME = "\xEE\x80\x91"; // E011 + const LEFT_ARROW = "\xEE\x80\x92"; // E012 + const UP_ARROW = "\xEE\x80\x93"; // E013 + const RIGHT_ARROW = "\xEE\x80\x94"; // E014 + const DOWN_ARROW = "\xEE\x80\x95"; // E015 + const INSERT = "\xEE\x80\x96"; // E016 + const DELETE = "\xEE\x80\x97"; // E017 + const SEMICOLON = "\xEE\x80\x98"; // E018 + const EQUALS = "\xEE\x80\x99"; // E019 + const NUMPAD_0 = "\xEE\x80\x9A"; // E01A + const NUMPAD_1 = "\xEE\x80\x9B"; // E01B + const NUMPAD_2 = "\xEE\x80\x9C"; // E01C + const NUMPAD_3 = "\xEE\x80\x9D"; // E01D + const NUMPAD_4 = "\xEE\x80\x9E"; // E01E + const NUMPAD_5 = "\xEE\x80\x9F"; // E01F + const NUMPAD_6 = "\xEE\x80\xA0"; // E020 + const NUMPAD_7 = "\xEE\x80\xA1"; // E021 + const NUMPAD_8 = "\xEE\x80\xA2"; // E022 + const NUMPAD_9 = "\xEE\x80\xA3"; // E023 + const MULTIPLY = "\xEE\x80\xA4"; // E024 + const ADD = "\xEE\x80\xA5"; // E025 + const SEPARATOR = "\xEE\x80\xA6"; // E026 + const SUBTRACT = "\xEE\x80\xA7"; // E027 + const DECIMAL = "\xEE\x80\xA8"; // E028 + const DIVIDE = "\xEE\x80\xA9"; // E029 + const F1 = "\xEE\x80\xB1"; // E031 + const F2 = "\xEE\x80\xB2"; // E032 + const F3 = "\xEE\x80\xB3"; // E033 + const F4 = "\xEE\x80\xB4"; // E034 + const F5 = "\xEE\x80\xB5"; // E035 + const F6 = "\xEE\x80\xB6"; // E036 + const F7 = "\xEE\x80\xB7"; // E037 + const F8 = "\xEE\x80\xB8"; // E038 + const F9 = "\xEE\x80\xB9"; // E039 + const F10 = "\xEE\x80\xBA"; // E03A + const F11 = "\xEE\x80\xBB"; // E03B + const F12 = "\xEE\x80\xBC"; // E03C + const COMMAND = "\xEE\x80\xBD"; // E03D + const META = "\xEE\x80\xBD"; // E03D +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/LocatorStrategy.php b/vendor/instaclick/php-webdriver/lib/WebDriver/LocatorStrategy.php new file mode 100644 index 00000000000..f74ba821658 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/LocatorStrategy.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright 2011-2014 Fabrizio Branca. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Fabrizio Branca <mail@fabrizio-branca.de> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\LocatorStrategy class + * + * @package WebDriver + */ +final class LocatorStrategy +{ + const CLASS_NAME = 'class name'; + const CSS_SELECTOR = 'css selector'; + const ID = 'id'; + const NAME = 'name'; + const LINK_TEXT = 'link text'; + const PARTIAL_LINK_TEXT = 'partial link text'; + const TAG_NAME = 'tag name'; + const XPATH = 'xpath'; +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Log.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Log.php new file mode 100644 index 00000000000..d7bfea8a995 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Log.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright 2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Log class + * + * @package WebDriver + * + * @method array types() Get available log types. + */ +final class Log extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'types' => array('GET'), + ); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/LogType.php b/vendor/instaclick/php-webdriver/lib/WebDriver/LogType.php new file mode 100644 index 00000000000..3080f8a9463 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/LogType.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright 2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\LogType class + * + * @package WebDriver + */ +final class LogType +{ + /** + * Log Type + * + * @see https://code.google.com/p/selenium/source/browse/java/client/src/org/openqa/selenium/logging/LogType.java + */ + const BROWSER = 'browser'; + const CLIENT = 'client'; + const DRIVER = 'driver'; + const PERFORMANCE = 'performance'; + const PROFILER = 'driver'; + const SERVER = 'server'; +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/Capability.php b/vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/Capability.php new file mode 100644 index 00000000000..37f04d229f9 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/Capability.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright 2012-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\SauceLabs; + +use WebDriver\Capability as BaseCapability; + +/** + * WebDriver\SauceLabs\Capability class + * + * @package WebDriver + */ +class Capability extends BaseCapability +{ + /** + * Desired capabilities - SauceLabs + * + * @see https://saucelabs.com/docs/additional-config + */ + + // Job Annotation + const NAME = 'name'; // Name the job + const BUILD = 'build'; // Record the build number + const TAGS = 'tags'; // Tag your jobs + const PASSED = 'passed'; // Record pass/fail status + const CUSTOM_DATA = 'custom-data'; // Record custom data + + // Performance improvements and data collection + const RECORD_VIDEO = 'record-video'; // Video recording + const VIDEO_UPLOAD_ON_PASS = 'video-upload-on-pass'; // Video upload on pass + const RECORD_SCREENSHOTS = 'record-screenshots'; // Record step-by-step screenshots + const CAPTURE_HTML = 'capture-html'; // HTML source capture + const QUIET_EXCEPTIONS = 'webdriver.remote.quietExceptions'; // Enable Selenium 2's automatic screenshots + const SAUCE_ADVISOR = 'sauce-advisor'; // Sauce Advisor + + // Selenium specific + const SELENIUM_VERSION = 'selenium-version'; // Use a specific Selenium version + const SINGLE_WINDOW = 'single-window'; // Selenium RC's single window mode + const USER_EXTENSIONS_URL = 'user-extensions-url'; // Selenium RC's user extensions + const FIREFOX_PROFILE_URL = 'firefox-profile-url'; // Selenium RC's custom Firefox profiles + + // Timeouts + const MAX_DURATION = 'max-duration'; // Set maximum test duration + const COMMAND_TIMEOUT = 'command-timeout'; // Set command timeout + const IDLE_TIMEOUT = 'idle-timeout'; // Set idle test timeout + + // Sauce specific + const PRERUN = 'prerun'; // Prerun executables + const TUNNEL_IDENTIFIER = 'tunnel-identifier'; // Use identified tunnel + const SCREEN_RESOLUTION = 'screen-resolution'; // Use specific screen resolution + const DISABLE_POPUP_HANDLER = 'disable-popup-handler'; // Disable popup handler + const AVOID_PROXY = 'avoid-proxy'; // Avoid proxy + const DEVICE_ORIENTATION = 'deviceOrientation'; // Device orientation (portrait or landscape) + const DEVICE_TYPE = 'deviceType'; // Device type (phone or tablet) + + // Job Sharing + const PUBLIC_RESULTS = 'public'; // Make public, private, or share jobs +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/SauceRest.php b/vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/SauceRest.php new file mode 100644 index 00000000000..270079e1276 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/SauceLabs/SauceRest.php @@ -0,0 +1,310 @@ +<?php +/** + * Copyright 2012-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + * @author Fabrizio Branca <mail@fabrizio-branca.de> + */ + +namespace WebDriver\SauceLabs; + +use WebDriver\ServiceFactory; + +/** + * WebDriver\SauceLabs\SauceRest class + * + * @package WebDriver + */ +class SauceRest +{ + /** + * @var string + */ + private $userId; + + /** + * @var string + */ + private $accessKey; + + /** + * Constructor + * + * @param string $userId Your Sauce user name + * @param string $accessKey Your Sauce API key + */ + public function __construct($userId, $accessKey) + { + $this->userId = $userId; + $this->accessKey = $accessKey; + } + + /** + * Execute Sauce Labs REST API command + * + * @param string $requestMethod HTTP request method + * @param string $url URL + * @param mixed $parameters Parameters + * + * @return mixed + * + * @see http://saucelabs.com/docs/saucerest + */ + protected function execute($requestMethod, $url, $parameters = null) + { + $extraOptions = array( + CURLOPT_HTTPAUTH => CURLAUTH_BASIC, + CURLOPT_USERPWD => $this->userId . ':' . $this->accessKey, + + // don't verify SSL certificates + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_SSL_VERIFYHOST => false, + + CURLOPT_HTTPHEADER => Array ('Expect:'), + ); + + $url = 'https://saucelabs.com/rest/v1/' . $url; + + list($rawResult, $info) = ServiceFactory::getInstance()->getService('service.curl')->execute($requestMethod, $url, $parameters, $extraOptions); + + return json_decode($rawResult, true); + } + + /** + * Get account details: /rest/v1/users/:userId (GET) + * + * @param string $userId + * + * @return array + */ + public function getAccountDetails($userId) + { + return $this->execute('GET', 'users/' . $userId); + } + + /** + * Check account limits: /rest/v1/limits (GET) + * + * @return array + */ + public function getAccountLimits() + { + return $this->execute('GET', 'limits'); + } + + /** + * Create new sub-account: /rest/v1/users/:userId (POST) + * + * For "partners", $accountInfo also contains 'plan' => (one of 'free', 'small', 'team', 'com', or 'complus') + * + * @param array $accountInfo array('username' => ..., 'password' => ..., 'name' => ..., 'email' => ...) + * + * @return array array('access_key' => ..., 'minutes' => ..., 'id' => ...) + */ + public function createSubAccount($accountInfo) + { + return $this->execute('POST', 'users/' . $this->userId, $accountInfo); + } + + /** + * Update sub-account service plan: /rest/v1/users/:userId/subscription (POST) + * + * @param string $userId User ID + * @param string $plan Plan + * + * @return array + */ + public function updateSubAccount($userId, $plan) + { + return $this->execute('POST', 'users/' . $userId . '/subscription', array('plan' => $plan)); + } + + /** + * Unsubscribe a sub-account: /rest/v1/users/:userId/subscription (DELETE) + * + * @param string $userId User ID + * + * @return array + */ + public function unsubscribeSubAccount($userId) + { + return $this->execute('DELETE', 'users/' . $userId . '/subscription'); + } + + /** + * Get current account activity: /rest/v1/:userId/activity (GET) + * + * @return array + */ + public function getActivity() + { + return $this->execute('GET', $this->userId . '/activity'); + } + + /** + * Get historical account usage: /rest/v1/:userId/usage (GET) + * + * @param string $start Optional start date YYYY-MM-DD + * @param string $end Optional end date YYYY-MM-DD + * + * @return array + */ + public function getUsage($start = null, $end = null) + { + $query = http_build_query(array( + 'start' => $start, + 'end' => $end, + )); + + return $this->execute('GET', $this->userId . '/usage' . (strlen($query) ? '?' . $query : '')); + } + + /** + * Get jobs: /rest/v1/:userId/jobs (GET) + * + * @param boolean $full + * + * @return array + */ + public function getJobs($full = null) + { + $query = http_build_query(array( + 'full' => (isset($full) && $full) ? 'true' : null, + )); + + return $this->execute('GET', $this->userId . '/jobs' . (strlen($query) ? '?' . $query : '')); + } + + /** + * Get full information for job: /rest/v1/:userId/jobs/:jobId (GET) + * + * @param string $jobId + * + * @return array + */ + public function getJob($jobId) + { + return $this->execute('GET', $this->userId . '/jobs/' . $jobId); + } + + /** + * Update existing job: /rest/v1/:userId/jobs/:jobId (PUT) + * + * @param string $jobId Job ID + * @param array $jobInfo Job information + * + * @return array + */ + public function updateJob($jobId, $jobInfo) + { + return $this->execute('PUT', $this->userId . '/jobs/' . $jobId, $jobInfo); + } + + /** + * Stop job: /rest/v1/:userId/jobs/:jobId/stop (PUT) + * + * @param string $jobId + * + * @return array + */ + public function stopJob($jobId) + { + return $this->execute('PUT', $this->userId . '/jobs/' . $jobId . '/stop'); + } + + /** + * Delete job: /rest/v1/:userId/jobs/:jobId (DELETE) + * + * @param string $jobId + * + * @return array + */ + public function deleteJob($jobId) + { + return $this->execute('DELETE', $this->userId . '/jobs/' . $jobId); + } + + /** + * Get running tunnels for a given user: /rest/v1/:userId/tunnels (GET) + * + * @return array + */ + public function getTunnels() + { + return $this->execute('GET', $this->userId . '/tunnels'); + } + + /** + * Get full information for a tunnel: /rest/v1/:userId/tunnels/:tunnelId (GET) + * + * @param string $tunnelId + * + * @return array + */ + public function getTunnel($tunnelId) + { + return $this->execute('GET', $this->userId . '/tunnels/' . $tunnelId); + } + + /** + * Shut down a tunnel: /rest/v1/:userId/tunnels/:tunnelId (DELETE) + * + * @param string $tunnelId + * + * @return array + */ + public function shutdownTunnel($tunnelId) + { + return $this->execute('DELETE', $this->userId . '/tunnels/' . $tunnelId); + } + + /** + * Get current status of Sauce Labs' services: /rest/v1/info/status (GET) + * + * @return array array('wait_time' => ..., 'service_operational' => ..., 'status_message' => ...) + */ + public function getStatus() + { + return $this->execute('GET', 'info/status'); + } + + /** + * Get currently supported browsers: /rest/v1/info/browsers (GET) + * + * @param string $termination Optional termination (one of "all", "selenium-rc", or "webdriver') + * + * @return array + */ + public function getBrowsers($termination = false) + { + if ($termination) { + return $this->execute('GET', 'info/browsers/' . $termination); + } + + return $this->execute('GET', 'info/browsers'); + } + + /** + * Get number of tests executed so far on Sauce Labs: /rest/v1/info/counter (GET) + * + * @return array + */ + public function getCounter() + { + return $this->execute('GET', 'info/counter'); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlService.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlService.php new file mode 100644 index 00000000000..7a07663061f --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlService.php @@ -0,0 +1,110 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + * @author Fabrizio Branca <mail@fabrizio-branca.de> + */ + +namespace WebDriver\Service; + +use WebDriver\Exception as WebDriverException; + +/** + * WebDriver\Service\CurlService class + * + * @package WebDriver + */ +class CurlService implements CurlServiceInterface +{ + /** + * {@inheritdoc} + */ + public function execute($requestMethod, $url, $parameters = null, $extraOptions = array()) + { + $customHeaders = array( + 'Content-Type: application/json;charset=UTF-8', + 'Accept: application/json;charset=UTF-8', + ); + + $curl = curl_init($url); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + + switch ($requestMethod) { + case 'GET': + break; + + case 'POST': + if ($parameters && is_array($parameters)) { + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters)); + } else { + $customHeaders[] = 'Content-Length: 0'; + } + + // Suppress "Expect: 100-continue" header automatically added by cURL that + // causes a 1 second delay if the remote server does not support Expect. + $customHeaders[] = 'Expect:'; + + curl_setopt($curl, CURLOPT_POST, true); + break; + + case 'DELETE': + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE'); + break; + + case 'PUT': + if ($parameters && is_array($parameters)) { + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters)); + } else { + $customHeaders[] = 'Content-Length: 0'; + } + + // Suppress "Expect: 100-continue" header automatically added by cURL that + // causes a 1 second delay if the remote server does not support Expect. + $customHeaders[] = 'Expect:'; + + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT'); + break; + } + + foreach ($extraOptions as $option => $value) { + curl_setopt($curl, $option, $value); + } + + curl_setopt($curl, CURLOPT_HTTPHEADER, $customHeaders); + + $rawResult = trim(curl_exec($curl)); + $info = curl_getinfo($curl); + + if (CURLE_GOT_NOTHING !== curl_errno($curl) && $error = curl_error($curl)) { + $message = sprintf( + 'Curl error thrown for http %s to %s%s', + $requestMethod, + $url, + $parameters && is_array($parameters) + ? ' with params: ' . json_encode($parameters) : '' + ); + + throw WebDriverException::factory(WebDriverException::CURL_EXEC, $message . "\n\n" . $error); + } + + curl_close($curl); + + return array($rawResult, $info); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlServiceInterface.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlServiceInterface.php new file mode 100644 index 00000000000..79588efef91 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlServiceInterface.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright 2012-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver\Service; + +/** + * WebDriver\Service\CurlServiceInterface class + * + * @package WebDriver + */ +interface CurlServiceInterface +{ + /** + * Send protocol request to WebDriver server using curl extension API. + * + * @param string $requestMethod HTTP request method, e.g., 'GET', 'POST', or 'DELETE' + * @param string $url Request URL + * @param array $parameters If an array(), they will be posted as JSON parameters + * If a number or string, "/$params" is appended to url + * @param array $extraOptions key=>value pairs of curl options to pass to curl_setopt() + * + * @return array + * + * @throws \WebDriver\Exception if error + */ + public function execute($requestMethod, $url, $parameters = null, $extraOptions = array()); +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/ServiceFactory.php b/vendor/instaclick/php-webdriver/lib/WebDriver/ServiceFactory.php new file mode 100644 index 00000000000..825fe87dc5d --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/ServiceFactory.php @@ -0,0 +1,108 @@ +<?php +/** + * Copyright 2012-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\ServiceFactory class + * + * A service factory + * + * @package WebDriver + */ +final class ServiceFactory +{ + /** + * singleton + * + * @var \WebDriver\ServiceFactory + */ + private static $instance; + + /** + * @var array + */ + protected $services; + + /** + * @var array + */ + protected $serviceClasses; + + /** + * Private constructor + */ + private function __construct() + { + $this->services = array(); + + $this->serviceClasses = array( + 'service.curl' => '\\WebDriver\\Service\\CurlService', + ); + } + + /** + * Get singleton instance + * + * @return \WebDriver\ServiceFactory + */ + static public function getInstance() + { + if (!self::$instance) { + self::$instance = new self; + } + + return self::$instance; + } + + /** + * Get service + * + * @param string $serviceName Name of service + * + * @return object + */ + public function getService($serviceName) + { + if (!isset($this->services[$serviceName])) { + $className = $this->serviceClasses[$serviceName]; + + $this->services[$serviceName] = new $className; + } + + return $this->services[$serviceName]; + } + + /** + * Override default service class + * + * @param string $serviceName Name of service + * @param string $className Name of service class + */ + public function setServiceClass($serviceName, $className) + { + if (substr($className, 0, 1) !== '\\') { + $className = '\\' . $className; + } + + $this->serviceClasses[$serviceName] = $className; + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Session.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Session.php new file mode 100644 index 00000000000..b50e6914efb --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Session.php @@ -0,0 +1,436 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Session class + * + * @package WebDriver + * + * @method string window_handle() Retrieve the current window handle. + * @method array window_handles() Retrieve the list of all window handles available to the session. + * @method string url() Retrieve the URL of the current page + * @method void postUrl($jsonUrl) Navigate to a new URL + * @method void forward() Navigates forward in the browser history, if possible. + * @method void back() Navigates backward in the browser history, if possible. + * @method void refresh() Refresh the current page. + * @method mixed execute($jsonScript) Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. (synchronous) + * @method mixed execute_async($jsonScript) Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. (asynchronous) + * @method string screenshot() Take a screenshot of the current page. + * @method array getCookie() Retrieve all cookies visible to the current page. + * @method array postCookie($jsonCookie) Set a cookie. + * @method string source() Get the current page source. + * @method string title() Get the current page title. + * @method void keys($jsonKeys) Send a sequence of key strokes to the active element. + * @method string getOrientation() Get the current browser orientation. + * @method void postOrientation($jsonOrientation) Set the current browser orientation. + * @method string getAlert_text() Gets the text of the currently displayed JavaScript alert(), confirm(), or prompt() dialog. + * @method void postAlert_text($jsonText) Sends keystrokes to a JavaScript prompt() dialog. + * @method void accept_alert() Accepts the currently displayed alert dialog. + * @method void dismiss_alert() Dismisses the currently displayed alert dialog. + * @method void moveto($jsonCoordinates) Move the mouse by an offset of the specified element (or current mouse cursor). + * @method void click($jsonButton) Click any mouse button (at the coordinates set by the last moveto command). + * @method void buttondown() Click and hold the left mouse button (at the coordinates set by the last moveto command). + * @method void buttonup() Releases the mouse button previously held (where the mouse is currently at). + * @method void doubleclick() Double-clicks at the current mouse coordinates (set by moveto). + * @method array execute_sql($jsonQuery) Execute SQL. + * @method array getLocation() Get the current geo location. + * @method void postLocation($jsonCoordinates) Set the current geo location. + * @method boolean getBrowser_connection() Is browser online? + * @method void postBrowser_connection($jsonState) Set browser online. + */ +final class Session extends Container +{ + /** + * @var array + */ + private $capabilities = null; + + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'window_handle' => array('GET'), + 'window_handles' => array('GET'), + 'url' => array('GET', 'POST'), // alternate for POST, use open($url) + 'forward' => array('POST'), + 'back' => array('POST'), + 'refresh' => array('POST'), + 'execute' => array('POST'), + 'execute_async' => array('POST'), + 'screenshot' => array('GET'), + 'cookie' => array('GET', 'POST'), // for DELETE, use deleteAllCookies() + 'source' => array('GET'), + 'title' => array('GET'), + 'keys' => array('POST'), + 'orientation' => array('GET', 'POST'), + 'alert_text' => array('GET', 'POST'), + 'accept_alert' => array('POST'), + 'dismiss_alert' => array('POST'), + 'moveto' => array('POST'), + 'click' => array('POST'), + 'buttondown' => 'POST', + 'buttonup' => array('POST'), + 'doubleclick' => array('POST'), + 'execute_sql' => array('POST'), + 'location' => array('GET', 'POST'), + 'browser_connection' => array('GET', 'POST'), + + // specific to Java SeleniumServer + 'file' => array('POST'), + ); + } + + /** + * {@inheritdoc} + */ + protected function obsoleteMethods() + { + return array( + 'modifier' => array('POST'), + 'speed' => array('GET', 'POST'), + 'alert' => array('GET'), + 'visible' => array('GET', 'POST'), + ); + } + + /** + * Open URL: /session/:sessionId/url (POST) + * An alternative to $session->url($url); + * + * @param string $url + * + * @return \WebDriver\Session + */ + public function open($url) + { + $this->curl('POST', '/url', array('url' => $url)); + + return $this; + } + + /** + * Get browser capabilities: /session/:sessionId (GET) + * + * @return mixed + */ + public function capabilities() + { + if ( ! isset($this->capabilities)) { + $result = $this->curl('GET', ''); + + $this->capabilities = $result['value']; + } + + return $this->capabilities; + } + + /** + * Close session: /session/:sessionId (DELETE) + * + * @return mixed + */ + public function close() + { + $result = $this->curl('DELETE', ''); + + return $result['value']; + } + + // There's a limit to our ability to exploit the dynamic nature of PHP when it + // comes to the cookie methods because GET and DELETE request methods are indistinguishable + // from each other: neither takes parameters. + + /** + * Get all cookies: /session/:sessionId/cookie (GET) + * Alternative to: $session->cookie(); + * + * Note: get cookie by name not implemented in API + * + * @return mixed + */ + public function getAllCookies() + { + $result = $this->curl('GET', '/cookie'); + + return $result['value']; + } + + /** + * Set cookie: /session/:sessionId/cookie (POST) + * Alternative to: $session->cookie($cookie_json); + * + * @param array $cookieJson + * + * @return \WebDriver\Session + */ + public function setCookie($cookieJson) + { + $this->curl('POST', '/cookie', array('cookie' => $cookieJson)); + + return $this; + } + + /** + * Delete all cookies: /session/:sessionId/cookie (DELETE) + * + * @return \WebDriver\Session + */ + public function deleteAllCookies() + { + $this->curl('DELETE', '/cookie'); + + return $this; + } + + /** + * Delete a cookie: /session/:sessionId/cookie/:name (DELETE) + * + * @param string $cookieName + * + * @return \WebDriver\Session + */ + public function deleteCookie($cookieName) + { + $this->curl('DELETE', '/cookie/' . $cookieName); + + return $this; + } + + /** + * window methods: /session/:sessionId/window (POST, DELETE) + * - $session->window() - close current window + * - $session->window($name) - set focus + * - $session->window($window_handle)->method() - chaining + * + * @return \WebDriver\Window|\WebDriver\Session + */ + public function window() + { + // close current window + if (func_num_args() === 0) { + $this->curl('DELETE', '/window'); + + return $this; + } + + // set focus + $arg = func_get_arg(0); // window handle or name attribute + + if (is_array($arg)) { + $this->curl('POST', '/window', $arg); + + return $this; + } + + // chaining + return new Window($this->url . '/window', $arg); + } + + /** + * Delete window: /session/:sessionId/window (DELETE) + * + * @return \WebDriver\Session + */ + public function deleteWindow() + { + $this->curl('DELETE', '/window'); + + return $this; + } + + /** + * Set focus to window: /session/:sessionId/window (POST) + * + * @param mixed $name window handler or name attribute + * + * @return \WebDriver\Session + */ + public function focusWindow($name) + { + $this->curl('POST', '/window', array('name' => $name)); + + return $this; + } + + /** + * frame methods: /session/:sessionId/frame (POST) + * - $session->frame($json) - change focus to another frame on the page + * - $session->frame()->method() - chaining + * + * @return \WebDriver\Session|\WebDriver\Frame + */ + public function frame() + { + if (func_num_args() === 1) { + $arg = func_get_arg(0); // json + + $this->curl('POST', '/frame', $arg); + + return $this; + } + + // chaining + return new Frame($this->url . '/frame'); + } + + /** + * timeouts methods: /session/:sessionId/timeouts (POST) + * - $session->timeouts($json) - set timeout for an operation + * - $session->timeouts()->method() - chaining + * + * @return \WebDriver\Session|\WebDriver\Timeouts + */ + public function timeouts() + { + // set timeouts + if (func_num_args() === 1) { + $arg = func_get_arg(0); // json + + $this->curl('POST', '/timeouts', $arg); + + return $this; + } + + if (func_num_args() === 2) { + $arg = array( + 'type' => func_get_arg(0), // 'script' or 'implicit' + 'ms' => func_get_arg(1), // timeout in milliseconds + ); + + $this->curl('POST', '/timeouts', $arg); + + return $this; + } + + // chaining + return new Timeouts($this->url . '/timeouts'); + } + + /** + * ime method chaining, e.g., + * - $session->ime()->method() + * + * @return \WebDriver\Ime + */ + public function ime() + { + return new Ime($this->url . '/ime'); + } + + /** + * Get active element (i.e., has focus): /session/:sessionId/element/active (POST) + * - $session->activeElement() + * + * @return mixed + */ + public function activeElement() + { + $result = $this->curl('POST', '/element/active'); + + return $this->webDriverElement($result['value']); + } + + /** + * touch method chaining, e.g., + * - $session->touch()->method() + * + * @return \WebDriver\Touch + * + */ + public function touch() + { + return new Touch($this->url . '/touch'); + } + + /** + * local_storage method chaining, e.g., + * - $session->local_storage()->method() + * + * @return \WebDriver\Storage + */ + public function local_storage() + { + return Storage::factory('local', $this->url . '/local_storage'); + } + + /** + * session_storage method chaining, e.g., + * - $session->session_storage()->method() + * + * @return \WebDriver\Storage + */ + public function session_storage() + { + return Storage::factory('session', $this->url . '/session_storage'); + } + + /** + * application cache chaining, e.g., + * - $session->application_cache()->status() + * + * @return \WebDriver\ApplicationCache + */ + public function application_cache() + { + return new ApplicationCache($this->url . '/application_cache'); + } + + /** + * log methods: /session/:sessionId/log (POST) + * - $session->log($type) - get log for given log type + * - $session->log()->method() - chaining + * + * @return mixed + */ + public function log() + { + // get log for given log type + if (func_num_args() === 1) { + $arg = func_get_arg(0); + + if (is_string($arg)) { + $arg = array( + 'type' => $arg, + ); + } + + $result = $this->curl('POST', '/log', $arg); + + return $result['value']; + } + + // chaining + return new Log($this->url . '/log'); + } + + /** + * {@inheritdoc} + */ + protected function getElementPath($elementId) + { + return sprintf('%s/element/%s', $this->url, $elementId); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Storage.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Storage.php new file mode 100644 index 00000000000..a9764271f78 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Storage.php @@ -0,0 +1,146 @@ +<?php +/** + * Copyright 2011-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +use WebDriver\Exception as WebDriverException; + +/** + * WebDriver\Storage class + * + * @package WebDriver + * + * @method mixed getKey($key) Get key/value pair. + * @method void deleteKey($key) Delete a specific key. + * @method integer size() Get the number of items in the storage. + */ +abstract class Storage extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'key' => array('GET', 'DELETE'), + 'size' => array('GET'), + ); + } + + /** + * Get all keys from storage or a specific key/value pair + * + * @return mixed + */ + public function get() + { + // get all keys + if (func_num_args() === 0) { + $result = $this->curl('GET', ''); + + return $result['value']; + } + + // get key/value pair + if (func_num_args() === 1) { + return $this->getKey(func_get_arg(0)); + } + + throw WebDriverException::factory(WebDriverException::UNEXPECTED_PARAMETERS); + } + + /** + * Set specific key/value pair + * + * @return \WebDriver\Storage + * + * @throw \WebDriver\Exception\UnexpectedParameters if unexpected parameters + */ + public function set() + { + if (func_num_args() === 1 + && is_array($arg = func_get_arg(0)) + ) { + $this->curl('POST', '', $arg); + + return $this; + } + + if (func_num_args() === 2) { + $arg = array( + 'key' => func_get_arg(0), + 'value' => func_get_arg(1), + ); + $this->curl('POST', '', $arg); + + return $this; + } + + throw WebDriverException::factory(WebDriverException::UNEXPECTED_PARAMETERS); + } + + /** + * Delete storage or a specific key + * + * @return \WebDriver\Storage + * + * @throw \WebDriver\Exception\UnexpectedParameters if unexpected parameters + */ + public function delete() + { + // delete storage + if (func_num_args() === 0) { + $this->curl('DELETE', ''); + + return $this; + } + + // delete key from storage + if (func_num_args() === 1) { + return $this->deleteKey(func_get_arg(0)); + } + + throw WebDriverException::factory(WebDriverException::UNEXPECTED_PARAMETERS); + } + + /** + * Factory method to create Storage objects + * + * @param string $type 'local' or 'session' storage + * @param string $url URL + * + * @return \WebDriver\Storage + */ + public static function factory($type, $url) + { + // dynamically define custom storage classes + $className = ucfirst(strtolower($type)); + $namespacedClassName = __CLASS__ . '\\' . $className; + + if (!class_exists($namespacedClassName, false)) { + eval( + 'namespace ' . __CLASS__ . '; final class ' . $className . ' extends \\' . __CLASS__ . '{}' + ); + } + + return new $namespacedClassName($url); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Timeouts.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Timeouts.php new file mode 100644 index 00000000000..10981e0294b --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Timeouts.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright 2011-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +use WebDriver\Exception as WebDriverException; + +/** + * WebDriver\Timeouts class + * + * @package WebDriver + * + * @method void async_script($json) Set the amount of time, in milliseconds, that asynchronous scripts (executed by execute_async) are permitted to run before they are aborted and a timeout error is returned to the client. + * @method void implicit_wait($json) Set the amount of time the driver should wait when searching for elements. + */ +final class Timeouts extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'async_script' => array('POST'), + 'implicit_wait' => array('POST'), + ); + } + + /** + * helper method to wait until user-defined condition is met + * + * @param function $callback callback which returns non-false result if wait condition was met + * @param integer $maxIterations maximum number of iterations + * @param integer $sleep sleep duration in seconds between iterations + * @param array $args optional args; if the callback needs $this, then pass it here + * + * @return mixed result from callback function + * + * @throws \Exception if thrown by callback, or \WebDriver\Exception\Timeout if helper times out + */ + public function wait($callback, $maxIterations = 1, $sleep = 0, $args = array()) + { + $i = max(1, $maxIterations); + + while ($i-- > 0) { + $result = call_user_func_array($callback, $args); + + if ($result !== false) { + return $result; + } + + // don't sleep on the last iteration + $i && sleep($sleep); + } + + throw WebDriverException::factory(WebDriverException::TIMEOUT, 'wait() method timed out'); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Touch.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Touch.php new file mode 100644 index 00000000000..6d04d9f25a5 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Touch.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright 2011-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver\Touch class + * + * @package WebDriver + * + * @method void click($jsonElement) Single tap on the touch enabled device. + * @method void down($jsonCoordinates) Finger down on the screen. + * @method void up($jsonCoordinates) Finger up on the screen. + * @method void move($jsonCoordinates) Finger move on the screen. + * @method void scroll($jsonCoordinates) Scroll on the touch screen using finger based motion events. Coordinates are either absolute, or relative to a element (if specified). + * @method void doubleclick($jsonElement) Double tap on the touch screen using finger motion events. + * @method void longclick($jsonElement) Long press on the touch screen using finger motion events. + * @method void flick($json) Flick on the touch screen using finger motion events. + */ +final class Touch extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'click' => array('POST'), + 'down' => array('POST'), + 'up' => array('POST'), + 'move' => array('POST'), + 'scroll' => array('POST'), + 'doubleclick' => array('POST'), + 'longclick' => array('POST'), + 'flick' => array('POST'), + ); + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/WebDriver.php b/vendor/instaclick/php-webdriver/lib/WebDriver/WebDriver.php new file mode 100644 index 00000000000..d0b5c344285 --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/WebDriver.php @@ -0,0 +1,98 @@ +<?php +/** + * Copyright 2004-2014 Facebook. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Justin Bishop <jubishop@gmail.com> + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace WebDriver; + +/** + * WebDriver class + * + * @package WebDriver + * + * @method status + */ +final class WebDriver extends AbstractWebDriver +{ + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'status' => 'GET', + ); + } + + /** + * New Session: /session (POST) + * Get session object for chaining + * + * @param array|string $requiredCapabilities Required capabilities (or browser name) + * @param array $desiredCapabilities Desired capabilities + * + * @return \WebDriver\Session + */ + public function session($requiredCapabilities = Browser::FIREFOX, $desiredCapabilities = array()) + { + // for backwards compatibility when the only required capability was browser name + if (! is_array($requiredCapabilities)) { + $desiredCapabilities[Capability::BROWSER_NAME] = $requiredCapabilities ?: Browser::FIREFOX; + + $requiredCapabilities = array(); + } + + // required + $parameters = array( + 'desiredCapabilities' => array_merge($desiredCapabilities, $requiredCapabilities) + ); + + // optional + if ( ! empty($requiredCapabilities)) { + $parameters['requiredCapabilities'] = $requiredCapabilities; + } + + $result = $this->curl( + 'POST', + '/session', + $parameters, + array(CURLOPT_FOLLOWLOCATION => true) + ); + + return new Session($result['sessionUrl']); + } + + /** + * Get list of currently active sessions + * + * @return array an array of \WebDriver\Session objects + */ + public function sessions() + { + $result = $this->curl('GET', '/sessions'); + $sessions = array(); + + foreach ($result['value'] as $session) { + $sessions[] = new Session($this->url . '/session/' . $session['id']); + } + + return $sessions; + } +} diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Window.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Window.php new file mode 100644 index 00000000000..08c0ef7e5ba --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Window.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright 2011-2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + * @author Fabrizio Branca <mail@fabrizio-branca.de> + */ + +namespace WebDriver; + +/** + * WebDriver\Window class + * + * @package WebDriver + * + * @method array getSize() Get size of the window. + * @method void postSize($json) Change the size of the window. + * @method array getPosition() Get position of the window. + * @method void postPosition($json) Change position of the window. + * @method void maximize() Maximize the window if not already maximized. + */ +final class Window extends AbstractWebDriver +{ + /** + * Window handle + * + * @var string + */ + private $windowHandle; + + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'size' => array('GET', 'POST'), + 'position' => array('GET', 'POST'), + 'maximize' => array('POST'), + ); + } + + /** + * {@inheritdoc} + */ + protected function obsoleteMethods() + { + return array( + 'restore' => array('POST'), + ); + } + + /** + * Get window handle + * + * @return string + */ + public function getHandle() + { + return $this->windowHandle; + } + + /** + * Constructor + * + * @param string $url URL + * @param string $windowHandle Window handle + */ + public function __construct($url, $windowHandle) + { + $this->windowHandle = $windowHandle; + + parent::__construct($url . '/' . $windowHandle); + } +} diff --git a/vendor/instaclick/php-webdriver/phpdoc.dist.xml b/vendor/instaclick/php-webdriver/phpdoc.dist.xml new file mode 100644 index 00000000000..c58cae1823e --- /dev/null +++ b/vendor/instaclick/php-webdriver/phpdoc.dist.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<phpdoc> + <title>PHP WebDriver for Selenium 2</title> + <parser> + <target>doc</target> + <markers> + <item>TODO</item> + <item>FIXME</item> + </markers> + <extensions> + <extension>php</extension> + </extensions> + <visibility></visibility> + </parser> + <transformer> + <target>doc</target> + </transformer> + <logging> + <level>warn</level> + <paths> + <default>logs/phpdoc.log</default> + <errors>logs/phpdoc.errors.log</errors> + </paths> + </logging> + <transformations> + <template name="responsive" /> + </transformations> + <files> + <directory>lib</directory> + </files> +</phpdoc> diff --git a/vendor/instaclick/php-webdriver/phpunit.xml.dist b/vendor/instaclick/php-webdriver/phpunit.xml.dist new file mode 100644 index 00000000000..836e35da5cc --- /dev/null +++ b/vendor/instaclick/php-webdriver/phpunit.xml.dist @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html --> +<phpunit + backupGlobals = "false" + backupStaticAttributes = "false" + colors = "true" + convertErrorsToExceptions = "true" + convertNoticesToExceptions = "true" + convertWarningsToExceptions = "true" + processIsolation = "false" + stopOnFailure = "false" + syntaxCheck = "false" + bootstrap = "lib/WebDriver/ClassLoader.php" > + + <testsuites> + <testsuite name="Project Test Suite"> + <directory>test/Test</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory>lib</directory> + <exclude> + <file>__init__.php</file> + </exclude> + </whitelist> + </filter> + +</phpunit> diff --git a/vendor/instaclick/php-webdriver/test/Test/WebDriver/ExceptionTest.php b/vendor/instaclick/php-webdriver/test/Test/WebDriver/ExceptionTest.php new file mode 100644 index 00000000000..15665ae1e85 --- /dev/null +++ b/vendor/instaclick/php-webdriver/test/Test/WebDriver/ExceptionTest.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright 2011-2012 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace Test\WebDriver; + +use WebDriver\Exception; + +/** + * Test WebDriver\Exception class + * + * @package WebDriver + */ +class ExceptionTest extends \PHPUnit_Framework_TestCase +{ + /** + * test factory() + * + * @group Unit + */ + public function testFactory() + { + $out = Exception::factory(255, 'wtf'); + $this->assertTrue(get_class($out) === 'Exception'); + $this->assertTrue($out->getMessage() === 'wtf'); + + $out = Exception::factory(Exception::SUCCESS); + $this->assertTrue(get_class($out) === 'Exception'); + $this->assertTrue($out->getMessage() === 'Unknown Error'); + + $out = Exception::factory(Exception::CURL_EXEC); + $this->assertTrue($out instanceof Exception\CurlExec); + $this->assertTrue($out->getMessage() === 'curl_exec() error.'); + } +} diff --git a/vendor/instaclick/php-webdriver/test/Test/WebDriver/StorageTest.php b/vendor/instaclick/php-webdriver/test/Test/WebDriver/StorageTest.php new file mode 100644 index 00000000000..bb9f8be942f --- /dev/null +++ b/vendor/instaclick/php-webdriver/test/Test/WebDriver/StorageTest.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright 2011-2012 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace Test\WebDriver; + +use WebDriver\Storage; + +/** + * Test WebDriver\Storage class + * + * @package WebDriver + */ +class StorageTest extends \PHPUnit_Framework_TestCase +{ + /** + * test factory() + * + * @group Unit + */ + public function testFactory() + { + $out = Storage::factory('Local', '/'); + $this->assertTrue($out instanceof Storage\Local); + + $out = Storage::factory('sEsSiOn', '/'); + $this->assertTrue($out instanceof Storage\Session); + } +} diff --git a/vendor/instaclick/php-webdriver/test/Test/WebDriver/WebDriverTest.php b/vendor/instaclick/php-webdriver/test/Test/WebDriver/WebDriverTest.php new file mode 100644 index 00000000000..425d3881015 --- /dev/null +++ b/vendor/instaclick/php-webdriver/test/Test/WebDriver/WebDriverTest.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright 2014 Anthon Pang. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @package WebDriver + * + * @author Anthon Pang <apang@softwaredevelopment.ca> + */ + +namespace Test\WebDriver; + +use WebDriver\WebDriver; + +/** + * Test WebDriver\WebDriver class + * + * @package WebDriver + */ +class WebDriverTest extends \PHPUnit_Framework_TestCase +{ + private $driver; + private $session; + + /** + * {@inheritdoc} + */ + protected function setUp() + { + $this->driver = new WebDriver(); + $this->session = null; + } + + /** + * {@inheritdoc} + */ + protected function tearDown() + { + if ($this->session) { + $this->session->close(); + } + } + + /** + * @group Functional + */ + public function testSessions() + { + try { + $this->assertCount(0, $this->driver->sessions()); + + $this->session = $this->driver->session(); + } catch (\Exception $e) { + if (strpos($e->getMessage(),'Failed connect to localhost:4444; Connection refused') !== false + || strpos($e->getMessage(), 'couldn\'t connect to host') !== false + ) { + $this->markTestSkipped('selenium server not running'); + } else { + throw $e; + } + } + + $this->assertCount(1, $this->driver->sessions()); + $this->assertEquals('http://localhost:4444/wd/hub', $this->driver->getUrl()); + } + + /** + * @group Functional + */ + public function testStatus() + { + try { + $status = $this->driver->status(); + } catch (\Exception $e) { + if (strpos($e->getMessage(),'Failed connect to localhost:4444; Connection refused') !== false + || strpos($e->getMessage(), 'couldn\'t connect to host') !== false + ) { + $this->markTestSkipped('selenium server not running'); + } else { + throw $e; + } + } + + $this->assertCount(3, $status); + $this->assertTrue(isset($status['java'])); + $this->assertTrue(isset($status['os'])); + $this->assertTrue(isset($status['build'])); + } +} -- GitLab