I am trying the webdriver patch over at #2775653: JavascriptTests with webDriver but I think this is a general issue ...

If one passes a mink driver config that contains associative arrays (which get turned into objects when converting to JSON),
like:
'["chrome",{"chrome":{"switches":["disable-gpu"],"binary":"\/Applications\/Google Chrome Canary.app\/Contents\/MacOS\/Google Chrome Canary"}}]'

one gets an Exception:
Error: Cannot use object of type stdClass as array

The reason for this is that the minkDefaultDriverArgs property is supposed to be an array structure but json_decode creates stdClass objects by default. Will upload a patch that addresses this.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

cspitzlay created an issue. See original summary.

cspitzlay’s picture

cspitzlay’s picture

Status: Active » Needs review
cspitzlay’s picture

Issue summary: View changes

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dawehner’s picture

I totally agree. None of those configurations uses stdclass objects.

Here is a test

Status: Needs review » Needs work

The last submitted patch, 6: 2894482-6.patch, failed testing. View results

dawehner’s picture

Status: Needs work » Needs review
FileSize
768 bytes
1.41 KB

Here is a proper failing and passing test.

Lendude’s picture

The docblock for minkDefaultDriverArgs already states that this should be an array, so this gets the actual data in line with the API.

  /*
   * Mink default driver params.
   *
   * If it's an array its contents are used as constructor params when default
   * Mink driver class is instantiated.
   *
   * Can be overridden using the environment variable MINK_DRIVER_ARGS. In this
   * case that variable should be a JSON array, for example:
   * '["firefox", null, "http://localhost:4444/wd/hub"]'.
   *
   *
   * @var array
   */
  protected $minkDefaultDriverArgs;

The last submitted patch, 8: 2894482-fail.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Lendude’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: 2894482-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Lendude’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated fail

  • catch committed 324d558 on 8.5.x
    Issue #2894482 by dawehner, cspitzlay: MINK_DRIVER_ARGS does not support...

  • catch committed b7dd64b on 8.4.x
    Issue #2894482 by dawehner, cspitzlay: MINK_DRIVER_ARGS does not support...

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: 2894482-7.patch, failed testing. View results

dawehner’s picture

Status: Needs work » Fixed

I guess this should be marked as fixed now :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.