minkphp / MinkZombieDriver

Zombie.js driver for Mink framework
41 stars 49 forks source link

ZombieDriver::wait() does not honor the DriverInterface spec #147

Closed 1ma closed 8 years ago

1ma commented 8 years ago

It returns the result of a json_decode operation, whereas Mink's DriverInterface specifies that this method should return a boolean.

This prevents from using the following testing construct when using this driver:

// Passes if the JS expression returns a truthy value before the timeout expires
$this->assertTrue($minkSession->wait(1000, "JS expression"));
aik099 commented 8 years ago

Same/similar problem with other drivers?

aik099 commented 8 years ago

I see no problem in changing https://github.com/minkphp/MinkZombieDriver/blob/master/src/ZombieDriver.php#L825 line to the

return (bool)json_decode($this->server->evalJS($js));

as long as test passes. Would you please submit a PR?

1ma commented 8 years ago

Sure.

aik099 commented 8 years ago

Maybe, but this doesn't sound too critical a test (in main Mink repo) needs to be added/updated to ensure that wait method returns true and false specifically.

stof commented 8 years ago

Yeah, this may be buggy in case the JS expression does not return a real boolean

stof commented 8 years ago

The testsuite passes currently, because all expressions used in it are returning a real boolean

aik099 commented 8 years ago

Closed via 39f6308923abf80d86114b2f158ac83dd77a89d4.