File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ from codebender_testing .utils import SeleniumTestCase
2
+ from selenium .webdriver .common .by import By
3
+
4
+ # Global variables
5
+ ERROR_MESSAGE = 'Oops! Something seems to be broken :/'
6
+ ROUTES_404 = [
7
+ '/hello' ,
8
+ '/foo' ,
9
+ '/bar'
10
+ ]
11
+
12
+ class Test404Page (SeleniumTestCase ):
13
+ def test_404_page (self , testing_url ):
14
+ """
15
+ Test for 404 error page.
16
+ Visits URLs registered at ROUTES_404 and verifies that the 404 error page opens
17
+ """
18
+
19
+ for url in ROUTES_404 :
20
+ self .open (url )
21
+ logo = self .get_element (By .CSS_SELECTOR , '.brand' )
22
+ assert logo .get_attribute ('href' )[:- 1 ] == self .site_url # check href attribute of .brand
23
+
24
+ error_message = self .get_element (By .CSS_SELECTOR , '.container-fluid .span12 .span12 h1' )
25
+ assert error_message .text .strip () == ERROR_MESSAGE # check text value of error message h1
You can’t perform that action at this time.
0 commit comments