@@ 841-853 (lines=13) @@ | ||
838 | * |
|
839 | * @Given /^I wait for (\d+) seconds until I see the "([^"]*)" element$/ |
|
840 | **/ |
|
841 | public function iWaitXUntilISee($wait, $selector) { |
|
842 | $page = $this->getSession()->getPage(); |
|
843 | ||
844 | $this->spin(function($page) use ($page, $selector){ |
|
845 | $element = $page->find('css', $selector); |
|
846 | ||
847 | if(empty($element)) { |
|
848 | return false; |
|
849 | } else { |
|
850 | return $element->isVisible(); |
|
851 | } |
|
852 | }); |
|
853 | } |
|
854 | ||
855 | /** |
|
856 | * Wait until a particular element is visible, using a CSS selector. Useful for content loaded via AJAX, or only |
|
@@ 863-873 (lines=11) @@ | ||
860 | * |
|
861 | * @Given /^I wait until I see the "([^"]*)" element$/ |
|
862 | */ |
|
863 | public function iWaitUntilISee($selector) { |
|
864 | $page = $this->getSession()->getPage(); |
|
865 | $this->spin(function($page) use ($page, $selector){ |
|
866 | $element = $page->find('css', $selector); |
|
867 | if(empty($element)){ |
|
868 | return false; |
|
869 | } else{ |
|
870 | return ($element->isVisible()); |
|
871 | } |
|
872 | }); |
|
873 | } |
|
874 | ||
875 | /** |
|
876 | * Wait until a particular string is found on the page. Useful for content loaded via AJAX, or only populated after |