Getting Behat to Beep When it’s Finished
Some times when you’ve got a big Behat test suite to run you want to go off an do other things. Which means you have to constantly check back on your terminal to see if its done. Wouldn’t it be better if the terminal beeped when it was done? Well using Behat’s hook its as easy as:
/**
* @AfterSuite
*/
public static function beep(Behat\Behat\Event\SuiteEvent $event) {
echo "\007";
}
If you are on a mac and are feeling particularly fancy you can do:
/**
* @AfterSuite
*/
public static function beep(Behat\Behat\Event\SuiteEvent $event) {
$params = $event->getContextParameters();
$result = $event->getLogger()->getFeaturesStatuses();
if (isset($params['announce_completion']) && $params['announce_completion']) {
if ($result['failed']) {
exec("say behat failed");
} else {
exec("say behat succeeded");
}
}
}
To enable the audio prompt go into behat.yml and add:
default:
context:
parameters:
announce_completion: true
This allow you to enable on a profile by profile basis.
A magazine is an iPad that does not work!
You’re going to change your mind a thousand times. That’s a good thing. Only imbeciles never change their minds.
I was interested to see the mobile app you are developing at Kent and your posts about Agile. I've started as the Head of Web Services at York and I would be interested to talk to you about both of these subjects.
Cool, I don’t know if you’ve seen it yet but we have a web team blog at http://blogs.kent.ac.uk/webdev, which may be of interested. Would be happy to chat about stuff, would be interested to hear about your plans in these areas for York.
Unicorns are real
- @jodykemsley: Look a horse!
- @jodykemsley: Oh no, its not a horse.
- @msaspence: <sarcasm>Well its not a unicorn.</sarcasm>
- @jodykemslet: No I don't think it's either.