MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

Fix NL replace (do not replace \r\n with two spaces)

Open mvorisek opened this issue 4 years ago • 3 comments

previously \r\n was replaced by 2 spaces

mvorisek avatar Jan 13 '21 13:01 mvorisek

Problem uncovered by this PR: we're not testing the normalization logic of the getText method, because:

  • tests haven't failed after the change in this PR
  • each of drivers does its own normalization (Zombie replaces any trailing whitespace with a single space; BrowserKit replaces \n with a single space and then replaces all trailing spaces with a single space; Selenium2 replace any line break with a single space)

Proposed next steps:

  1. decide what we can test (not sure if \r could properly be tested in headless drivers)
  2. add a new test and restart all driver repo builds to see which drivers actually comply
  3. rebase this PR to see how the Selenium2 driver is doing

aik099 avatar Jan 23 '21 16:01 aik099

I have removed https://github.com/minkphp/MinkSelenium2Driver/commit/4391f590d3b0fe0adc7033edc45900df0a61b1c3 commit to not trim and keep this PR to bare minimum of the described problem.

mvorisek avatar Oct 16 '22 16:10 mvorisek

@mvorisek , now I like the change.

@stof , what about testing considering that each driver is doing it differently?

aik099 avatar Oct 20 '22 07:10 aik099