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 @@ -455,6 +455,45 @@ public function seeInCurrentRoute($routeName)
455455 $ this ->assertEquals ($ matchedRouteName , $ routeName );
456456 }
457457
458+ /**
459+ * Goes to a page and check that it can be accessed.
460+ *
461+ * ```php
462+ * <?php
463+ * $I->seePageIsAvailable('/dashboard');
464+ * ```
465+ *
466+ * @param string $url
467+ */
468+ public function seePageIsAvailable ($ url )
469+ {
470+ $ this ->amOnPage ($ url );
471+ $ this ->seeResponseCodeIsSuccessful ();
472+ $ this ->seeInCurrentUrl ($ url );
473+ }
474+
475+ /**
476+ * Goes to a page and check that it redirects to another.
477+ *
478+ * ```php
479+ * <?php
480+ * $I->seePageRedirectsTo('/admin', '/login');
481+ * ```
482+ *
483+ * @param string $page
484+ * @param string $redirectsTo
485+ */
486+ public function seePageRedirectsTo ($ page , $ redirectsTo )
487+ {
488+ $ this ->client ->followRedirects (false );
489+ $ this ->amOnPage ($ page );
490+ $ this ->assertTrue (
491+ $ this ->client ->getResponse ()->isRedirection ()
492+ );
493+ $ this ->client ->followRedirect ();
494+ $ this ->seeInCurrentUrl ($ redirectsTo );
495+ }
496+
458497 /**
459498 * Checks if the desired number of emails was sent.
460499 * 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