Code Duplication    Length = 11-13 lines in 2 locations

src/SilverStripe/BehatExtension/Context/BasicContext.php 2 locations

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