Skip to content

The "Selenium2Driver::getContent" method is html-decoding it's result #245

@aik099

Description

@aik099

The GeneralTest::testAdvancedForm test started to fail recently:

1) Behat\Mink\Tests\Driver\Form\GeneralTest::testAdvancedForm
Failed asserting that '<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <title>Advanced form save</title>
    <meta content="text/html;charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
array (
  'agreement' = 'on',
  'email' = 'ever.zet@gmail.com',
  'first_name' = 'Foo "item"',
  'last_name' = 'Bar',
  'notes' = 'new notes',
  'select_number' = '30',
  'sex' = 'm',
  'submit' = 'Register',
)
some_file.txt
1 uploaded file
</body></html>' contains "array (
  'agreement' = 'on',
  'email' = 'ever.zet@gmail.com',
  'first_name' = 'Foo &quot;item&quot;',
  'last_name' = 'Bar',
  'notes' = 'new notes',
  'select_number' = '30',
  'sex' = 'm',
  'submit' = 'Register',
)
some_file.txt
1 uploaded file".
/home/travis/build/minkphp/MinkSelenium2Driver/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php:220

Here is why:

  1. not long ago as XSS protection we started to html-escape output on .../vendor/behat/mink/driver-testsuite/web-fixtures/advanced_form_post.php page used in above mentioned test
  2. for unknown reasons the source API call of JsonWireProtocol (see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidsource) that we're using for Selenium2Driver::getContent method (see https://github.com/minkphp/MinkSelenium2Driver/blob/master/src/Selenium2Driver.php#L475) started to html-decode (e.g. convert &quot; into ") it's result
  3. now this test fails

I'm not sure how to approach this, because we can't html-encode all page source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions