- $condition = "(typeof jQuery !== 'undefined' && jQuery('$selector').length === 0)";
- $this->assertJsCondition($condition, $timeout);
+
+ $start = microtime(TRUE);
+ $end = $start + ($timeout / 1000);
+ $page = $this->getSession()->getPage();
+
+ do {
+ $result = $page->find('css', $selector);
+
+ if (empty($result)) {
+ return;
+ }
+
+ usleep(100000);
+ } while (microtime(TRUE) < $end);
+
+ $this->assertEmpty($result, 'Element was not on the page after wait.');