Skip to content

Instantly share code, notes, and snippets.

@tomphp
Last active March 3, 2016 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomphp/7680261 to your computer and use it in GitHub Desktop.
Save tomphp/7680261 to your computer and use it in GitHub Desktop.
Waiting for a certain page to load in using Mink & Behat
<?php
private function waitForPageToLoad($pageName, $timeout = 10)
{
$count = 10;
while (0 !== stripos($this->getSession()->getCurrentUrl(), $pageName)) {
sleep(1);
if (0 === $count--) {
throw new \Exception('Didn\'t return to site');
}
}
}
@JanisBukowskis
Copy link

this function dont shows at example.feature file?? why?? i wont use this function in test (using behat)

@JanisBukowskis
Copy link

And what do u mean pagename ?? its <<title>> facebook signup <</title>> ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment