SahiClient
SahiClient copied to clipboard
Incorrect getText() behaviour
I found differences between drivers behaviour (Selenium2 and Sahi).
I have following html: https://gist.github.com/2407644 (all li elements are hidden) and mink scenario:
Then I should not see "penny" in the "#friend-picker-container" element
When I'm using Selenium 2 driver my test is passing, and everything is ok, but, when Sahi driver is in use I'm getting failure.
After debugging i found what cause problem - in method
public function assertElementNotContainsText($element, $text) (BaseMinkContext class)
function $node->getText() returns string(0) "" for Selenium2 but for Sahi result is string(75) "Me Add to Bill (penny) Add to Bill (lennard) Add to Bill (rash) Add to Bill"
In Sahi, implementation of this method is following: return $this->con->evaluateJavascript(sprintf('_sahi._getText(%s)', $this->getAccessor())); but (according to Sahi documentation) _sahi._getText() returns whole text (from invisible child elements too)
confirmed
I'm sorry, I forgot environment spec: Firefox 11.0, Ubuntu 11.10 64bit, Sahi OS 20110719
@cakper, can you send an PR with a fix? Be sure to include new test case (that specifically tests, that a visible only text is returned) in GeneralDriverTest (separate pr to Behat\Mink repo).