I am using facebook php-webdriver for my web app testing. There is a function in webdriver that works as below
$webdriver->wait($timeOut, $pollInterval)->until(
//condition to wait
);
This "condition to wait" is passed as a method such as;
$val = WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user"))
So the full code block is like;
$webdriver->wait($timeOut, $pollInterval)->until(
$val = WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user"))
);
I then have anther method such as;
function get($url, [few more params], $expectedCondition){
//do some work here and execute below wait condition
$webdriver->wait($timeOut, $pollInterval)->until(
$expectedCondition //this executes fine
);
}
I will call the above method as below; get ([other params], WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user"))
As you see the last parameter above is a method call in itself that comes into my GET method. It'll execute properly as below
$webdriver->wait($timeOut, $pollInterval)->until(
$expectedCondition //this will basically executes WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user")) properly
);
However I can't get the return value after executing $expectedCondition.
eval() doesn't work