Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with WebDriver 1.4 for cookie handling (Set/receive cookie using Cookie value object instead of an array) #4073

Closed
ginside opened this issue Mar 23, 2017 · 3 comments

Comments

@ginside
Copy link

@ginside ginside commented Mar 23, 2017

What are you trying to achieve?

Save a session snapshot

Conflicts with changes introduced by
php-webdriver/php-webdriver@c2e3e30

What do you get instead?

Provide console output if related. Use -vvv mode for more details.

  [TypeError] Argument 1 passed to Codeception\Module\WebDriver::cookieDomainMatchesConfigUrl() must be of the type array, object given, called in /***project_root***/vendor/codeception/codeception/src/Codeception/Module/WebDriver.php on line 2714

Provide test source code if related

// paste test

Details

  • Codeception version: 2.2.9
  • PHP Version: 7.1.2
  • Operating System: Centos 7
  • Installation type: Composer
  • List of installed packages (composer show)

behat/gherkin v4.4.5 Gherkin DSL parser for PHP 5.3
codeception/aspect-mock 2.0.1 Experimental Mocking Framework powered by Aspects
codeception/c3 2.0.10 CodeCoverage collector for Codeception
codeception/codeception 2.2.9 BDD-style testing framework
container-interop/container-interop 1.2.0 Promoting the interoperability of container objects (DIC, SL, etc.)
doctrine/annotations v1.4.0 Docblock Annotations Parser
doctrine/inflector v1.1.0 Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator 1.0.5 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
facebook/webdriver 1.4.0 A PHP client for Selenium WebDriver
goaop/framework 2.1.0 Framework for aspect-oriented programming in PHP.
goaop/parser-reflection 1.2.0 Provides reflection information, based on raw source
guzzlehttp/guzzle 6.2.3 Guzzle is a PHP HTTP client library
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also provides common utility methods
hellogerard/jobby v3.2.2 Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.
herloct/codeception-slim-module 1.1.0 Codeception Module for Slim 3 Microframework.
illuminate/container v5.4.13 The Illuminate Container package.
illuminate/contracts v5.4.13 The Illuminate Contracts package.
illuminate/database v5.4.13 The Illuminate Database package.
illuminate/support v5.4.13 The Illuminate Support package.
jakubledl/dissect v1.0.1 Lexing and parsing in pure PHP
jeremeamia/SuperClosure 2.3.0 Serialize Closure objects, including their context and binding
monolog/monolog 1.22.1 Sends your logs to files, sockets, inboxes, databases and various web services
mtdowling/cron-expression v1.2.0 CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
myclabs/deep-copy 1.6.0 Create deep copies (clones) of your objects
nesbot/carbon 1.22.1 A simple API extension for DateTime.
nikic/fast-route v1.2.0 Fast request router for PHP
nikic/php-parser v3.0.5 A PHP parser written in PHP
paragonie/random_compat v2.0.10 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-common 1.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 3.1.1 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver 0.2.1
phpspec/prophecy v1.7.0 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 4.0.7 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 1.4.2 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.9 Utility class for timing
phpunit/php-token-stream 1.4.11 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 5.7.17 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 3.4.3 Mock Object library for PHPUnit
pimple/pimple v3.0.2 Pimple, a simple Dependency Injection Container
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.0.2 Common interface for logging libraries
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 1.2.4 Provides the functionality to compare PHP values for equality
sebastian/diff 1.4.1 Diff implementation
sebastian/environment 2.0.0 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 2.0.0 Provides the functionality to export PHP variables for visualization
sebastian/global-state 1.1.1 Snapshotting of global state
sebastian/object-enumerator 2.0.1 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/recursion-context 2.0.0 Provides functionality to recursively process PHP variables
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
slim/slim 3.8.1 Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs
slim/twig-view 2.2.0 Slim Framework 3 view helper built on top of the Twig 2 templating component
swiftmailer/swiftmailer v5.4.6 Swiftmailer, free feature-rich PHP mailer
symfony/browser-kit v3.2.6 Symfony BrowserKit Component
symfony/console v3.2.6 Symfony Console Component
symfony/css-selector v3.2.6 Symfony CssSelector Component
symfony/debug v3.2.6 Symfony Debug Component
symfony/dom-crawler v3.2.6 Symfony DomCrawler Component
symfony/event-dispatcher v3.2.6 Symfony EventDispatcher Component
symfony/finder v3.2.6 Symfony Finder Component
symfony/polyfill-mbstring v1.3.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56 v1.3.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-util v1.3.0 Symfony utilities for portability of PHP codes
symfony/process v3.2.6 Symfony Process Component
symfony/translation v3.2.6 Symfony Translation Component
symfony/yaml v3.2.6 Symfony Yaml Component
twig/twig v2.3.0 Twig, the flexible, fast, and secure template language for PHP
webmozart/assert 1.2.0 Assertions to validate method input/output with nice error messages.

  • Suite configuration:
class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: %CODECEPTION_ACCEPTANCE_TEST_URL%
            browser: chrome
            window_size: 1440x860
            capabilities:
                chromeOptions:
                    args:
                        - proxy-server=%http_proxy%
        - \Helper\Acceptance
        - \Codeception\Module\Asserts
extensions:
    enabled:
        - Codeception\Extension\Recorder:
            delete_successful: false

I added a version constraint on facebook/webdriver

"facebook/webdriver": ">=1.0.1 <=1.3"

in composer.json to pass through this issue for now..

@DavertMik
Copy link
Member

@DavertMik DavertMik commented Mar 23, 2017

Thanks for the reporting. This is a priority issue.

@igoryan
Copy link

@igoryan igoryan commented Mar 23, 2017

Hi, a quick workaround (and probably a fix) that worked for me:

Codeception/Module/WebDriver.php:
saveSessionSnapshot method

change

if ($this->cookieDomainMatchesConfigUrl($cookie)) {

to:

if ($this->cookieDomainMatchesConfigUrl($cookie->toArray())) {
@ginside
Copy link
Author

@ginside ginside commented Mar 23, 2017

Hi @igoryan , there are other methods affected. As I mentionned, you better should add this constraint in your composer.json file "facebook/webdriver": ">=1.0.1 <=1.3" which is more restrictive than codeception/codeception's constraint ("facebook/webdriver": ">=1.0.1 <2.0") and works fine for now.

Naktibalda added a commit to Naktibalda/Codeception that referenced this issue Mar 23, 2017
Naktibalda added a commit to Naktibalda/Codeception that referenced this issue Mar 23, 2017
DavertMik added a commit that referenced this issue Mar 24, 2017
* Fixed broken test before making more changes

* [WebDriver] Fixed compatibility with facebook/webdriver 1.4.0

Fixes #4073

* Ignore codecept.phar file
chris1312 pushed a commit to chris1312/Codeception that referenced this issue Jun 16, 2017
…ption#4076)

* Fixed broken test before making more changes

* [WebDriver] Fixed compatibility with facebook/webdriver 1.4.0

Fixes Codeception#4073

* Ignore codecept.phar file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.