PhpBrowser and WebDriver see() different behavior
I found some difference between see() functions in PhpBrowser and WebDriver. PhpBrowser see() text outside of body, but WebDriver doesn't. There aren't mentioned any differences in documentation, so i think its a bug.
Reproduce steps
Create page with content:
<html>
<head>
<title>Some text</title>
</head>
<body>
</body>
</html>
And create test like this:
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that frontpage works');
$I->amOnPage('/');
$I->see('Some text');
Now run test with PhpBrowser and then with WebDriver. The WebDriver test will fail, but PhpBrowser doesn't.
I have configured phantomjs as a browser for WebDriver, I didn't test other browsers. If it is intended behavior, i think it should be mentioned somewhere in documentation.
Yes, WebDriver's see works only with visible data. PhpBrowser has no means to detect visible and invisible elements, so it considers everything ot be visible. To see all elements on page use seeInDOM method of WebDriver
Thanks for help. Little mention in documentation (that functions with same name can behave differently across drivers) would be great for beginners.