@@ -691,4 +691,40 @@ public function testSetUserAgentUsingConfig()
691
691
$ response = $ this ->module ->grabPageSource ();
692
692
$ this ->assertEquals ('Codeception User Agent Test 1.0 ' , $ response , 'Incorrect user agent ' );
693
693
}
694
+
695
+ public function testIfStatusCodeIsWithin2xxRange ()
696
+ {
697
+ $ this ->module ->amOnPage ('https://httpstat.us/200 ' );
698
+ $ this ->module ->seeResponseCodeIsSuccessful ();
699
+
700
+ $ this ->module ->amOnPage ('https://httpstat.us/299 ' );
701
+ $ this ->module ->seeResponseCodeIsSuccessful ();
702
+ }
703
+
704
+ public function testIfStatusCodeIsWithin3xxRange ()
705
+ {
706
+ $ this ->module ->amOnPage ('https://httpstat.us/300 ' );
707
+ $ this ->module ->seeResponseCodeIsRedirection ();
708
+
709
+ $ this ->module ->amOnPage ('https://httpstat.us/399 ' );
710
+ $ this ->module ->seeResponseCodeIsRedirection ();
711
+ }
712
+
713
+ public function testIfStatusCodeIsWithin4xxRange ()
714
+ {
715
+ $ this ->module ->amOnPage ('https://httpstat.us/400 ' );
716
+ $ this ->module ->seeResponseCodeIsClientError ();
717
+
718
+ $ this ->module ->amOnPage ('https://httpstat.us/499 ' );
719
+ $ this ->module ->seeResponseCodeIsClientError ();
720
+ }
721
+
722
+ public function testIfStatusCodeIsWithin5xxRange ()
723
+ {
724
+ $ this ->module ->amOnPage ('https://httpstat.us/500 ' );
725
+ $ this ->module ->seeResponseCodeIsServerError ();
726
+
727
+ $ this ->module ->amOnPage ('https://httpstat.us/599 ' );
728
+ $ this ->module ->seeResponseCodeIsServerError ();
729
+ }
694
730
}
0 commit comments