module-webdriver icon indicating copy to clipboard operation
module-webdriver copied to clipboard

Inconsistent newline characters for Windows

Open dima-stefantsov opened this issue 9 years ago • 1 comments

  1. Methods seeInSource and seeInPageSource have different descriptions and run different code paths, but ultimately do the very save comparison. Meaning there should be no seeInPageSource method. Please remove.
  2. I am trying to use either of them, let's say seeInSource. It works fine in PhpBrowser. But it fails for WebDriver. I have found the solution: I could do str_replace(chr(13), '', $whatIWantToSeeMultiline) and it will work for WebDriver. This is the old good \n vs \r\n. Could you please compare more intelligently, keeping in mind newline may differ?

Webserver is Apache and it's run on same Windows machine, by the way.

dima-stefantsov avatar Jun 03 '16 17:06 dima-stefantsov

Thanks for this report. Removing methods is complicated because it will break tests for some users.

Some history: WebDriver::seeInPageSource was created in June 2014 and didn't have equivalent in PhpBrowser. In fact, PhpBrowser::see matched page source. Last year a user complained about that and strip_tags was applied to page source. 2 months later someone else wanted to match page source, so seeInSource method was added to PhpBrowser (and to WebDriver for consistency).

Naktibalda avatar Jun 03 '16 20:06 Naktibalda