Basically the problem is with the way it is, is that text() only will find information if that is the only thing within the element. So for instance, if you have an icon within a button like:
I'm not sure there are any downsides to the change, but I'm not an xpath expert so can't be 100% sure of that. But buttons and links often have other elements within and the current implementation with text() does not seem to work with that.
OK, I've been playing around with both of these methods and how it searches through xpath. I think they should be changed from this:
$this->findElement($text, "//button[contains(text(), '{$text}')]")->click();
to
$this->findElement($text, "//button[contains(., '{$text}')]")->click();
Basically the problem is with the way it is, is that text() only will find information if that is the only thing within the element. So for instance, if you have an icon within a button like:
It will not find the text "Delete". It only finds it if it is just
Same thing for the click method. Change it from this:
$this->findElement($textOrId, "//a[contains(text(), '{$textOrId}')]");
to
$this->findElement($textOrId, "//a[contains(., '{$textOrId}')]");
I'm not sure there are any downsides to the change, but I'm not an xpath expert so can't be 100% sure of that. But buttons and links often have other elements within and the current implementation with text() does not seem to work with that.