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

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

Open
aik099 opened this issue Sep 16, 2016 · 1 comment
Open
Labels

Comments

@aik099
Copy link
Member

aik099 commented Sep 16, 2016

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' = '[email protected]',
  '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' = '[email protected]',
  '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.

@volkyeth
Copy link

volkyeth commented Mar 4, 2017

I think this is related to some Firefox API changes. The WebDriver call to get the page source relies on the Browser, which may or may decode HTML entities.

The Docker image selenium/standalone-firefox:2.53.1 used on the test suite was last changed around the same time this issue began to appear. Maybe they changed the Firefox version on that tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants