File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -475,6 +475,45 @@ public function seeInCurrentRoute($routeName)
475475 $ this ->assertEquals ($ matchedRouteName , $ routeName );
476476 }
477477
478+ /**
479+ * Goes to a page and check that it can be accessed.
480+ *
481+ * ```php
482+ * <?php
483+ * $I->seePageIsAvailable('/dashboard');
484+ * ```
485+ *
486+ * @param string $url
487+ */
488+ public function seePageIsAvailable ($ url )
489+ {
490+ $ this ->amOnPage ($ url );
491+ $ this ->seeResponseCodeIsSuccessful ();
492+ $ this ->seeInCurrentUrl ($ url );
493+ }
494+
495+ /**
496+ * Goes to a page and check that it redirects to another.
497+ *
498+ * ```php
499+ * <?php
500+ * $I->seePageRedirectsTo('/admin', '/login');
501+ * ```
502+ *
503+ * @param string $page
504+ * @param string $redirectsTo
505+ */
506+ public function seePageRedirectsTo ($ page , $ redirectsTo )
507+ {
508+ $ this ->client ->followRedirects (false );
509+ $ this ->amOnPage ($ page );
510+ $ this ->assertTrue (
511+ $ this ->client ->getResponse ()->isRedirection ()
512+ );
513+ $ this ->client ->followRedirect ();
514+ $ this ->seeInCurrentUrl ($ redirectsTo );
515+ }
516+
478517 /**
479518 * Checks if the desired number of emails was sent.
480519 * If no argument is provided then at least one email must be sent to satisfy the check.
You can’t perform that action at this time.
0 commit comments