'should not see "(<text>)"' mink base step returns false when text is hidden
Closed this issue · 5 comments
Example:
Html:
<span style="display:none">Future</span>
behat:
Then I should not see "Future"
Always returns false so behat sees that text.
@pcaldentey Thanks for the report.
@stof: I have been reviewing bugs where to work on and this looks like a problem in the getText method of the DriverInterface for Mink.
Should getText method only return the visible text inside the XPath?. I mean the "visible" feature can only be done on Selenium and PhantomJS.
@jcalderonzumba no, we don't take the CSS visibility into account in getText
, because it would be too hard to implement this in most drivers (BrowserKit, Goutte and Zombie.js are not handling CSS at all). And having a different behavior depending on the driver totally defeats the goal of an abstraction.
Fair enough,
@pcaldeldentey probably one option is for this Driver to have more methods that are not in the DriverInterface so Behat users when writing the steps implementations can use such methods.
In this particular case it could be getVisibleText();
@pcaldentey won't fix the method as per driver definition, what i will do is create a new non DriverInterface method that will allow to get only the visible text ok?