]> BookStack Code Mirror - bookstack/blobdiff - tests/TestCase.php
Added tests for profile pages
[bookstack] / tests / TestCase.php
index 24685321fcf84bac451c9e91fa1d96b8e2e59f92..4b8578a43280aae82c51e57bdafeee670c157eef 100644 (file)
@@ -109,4 +109,18 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
 
         return $this;
     }
+
+    /**
+     * Click the text within the selected element.
+     * @param $parentElement
+     * @param $linkText
+     * @return $this
+     */
+    protected function clickInElement($parentElement, $linkText)
+    {
+        $elem = $this->crawler->filter($parentElement);
+        $link = $elem->selectLink($linkText);
+        $this->visit($link->link()->getUri());
+        return $this;
+    }
 }