This is very similar to: adding php variable into Xpath But slightly different...
What I'm trying to do is this:
$status = "Test!";
//ajax request to update the page
$this->postToPage($status);
//This is the part that is failing..
$this->waitUntil(function ()
{
if ($this->byXPath("//span[contains(text(),'{$status}')]"))
{
return true;
}
return null;
}, 20000);
$elementtext = $this->byXpath("//span[contains(text(),'{$status}')]")->text();
$this->assertEquals($status, $elementtext);
Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'Test!' +'Test!.'
Any idea why $elementtext is being set to "Test!." with the dot on the end? I've come to a stalemate here and have no idea why on earth it is appending the dot.