_tests/test_http_status.py
changeset 233 c97120328e9c
parent 194 ead607927876
equal deleted inserted replaced
232:ec1bb552ce55 233:c97120328e9c
     1 from selenium import webdriver
       
     2 from selenium.common.exceptions import NoSuchElementException
       
     3 import time
       
     4 import unittest
       
     5 
       
     6 from sayings import get_saying
       
     7 
       
     8 class HTTPStatusTest(unittest.TestCase):
       
     9     def checkURL(self, url):
       
    10         self.browser.get(url)
       
    11         try:
       
    12             h1 = self.browser.find_element_by_xpath("//h1")
       
    13             self.assertNotEqual(h1.text, "Page Not Found")
       
    14         except NoSuchElementException:
       
    15             pass
       
    16 
       
    17 
       
    18     def runTest(self):
       
    19         self.browser = webdriver.Firefox()
       
    20         path = "http://127.0.0.1:5014/"
       
    21         urls = ["", "index", "competition", "task", "submission", "coursematerial",
       
    22                 "imprint", "privacy"]
       
    23         for url in urls:
       
    24             self.checkURL(path + url)
       
    25 
       
    26 
       
    27 if __name__ == "__main__":
       
    28     unittest.main()
       
Impressum Datenschutzerklärung