Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2012 15:45
Show Gist options
  • Save anonymous/3305293 to your computer and use it in GitHub Desktop.
Save anonymous/3305293 to your computer and use it in GitHub Desktop.
$this->openSquirrelMail();
for ($i = 1; $i < 4; $i++) {
$lastExceptionMessage = '';
for ($second = 0; ; $second+=2) {
if ($second > 45) {
$this->fail('"WaitFor timeout. \n"
. "Last exception message: \n" . $lastExceptionMessage');
}
$this->clickAndWait('link=Search');
$this->type('css=input[name=what]', $users[$i]->email);
$this->select('css=select[name=where]', 'To');
$this->clickAndWait('css=input[type=submit][value=Search]');
try {
$this->assertElementPresent("xpath=(//a[contains(@title, 'This is a test.')])[last()]");
break;
}
catch (Exception $e) {
$lastExceptionMessage = $e->getMessage();
}
$this->clickAndWait('link=INBOX');
sleep(2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment