forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_various_pages.py
31 lines (24 loc) · 986 Bytes
/
check_various_pages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest
from base_test_class import BaseTestCase
from selenium.webdriver.common.by import By
import sys
class VariousPagesTest(BaseTestCase):
def test_user_status(self):
driver = self.driver
driver.get(self.base_url + "user")
def test_calendar_status(self):
driver = self.driver
driver.get(self.base_url + "calendar")
# click apply to see if this helps webdriver to catch the javascript errors we're seeing
driver.find_element(By.CSS_SELECTOR, "input.btn.btn-primary").click()
def suite():
suite = unittest.TestSuite()
suite.addTest(BaseTestCase('test_login'))
suite.addTest(VariousPagesTest('test_user_status'))
suite.addTest(VariousPagesTest('test_calendar_status'))
return suite
if __name__ == "__main__":
runner = unittest.TextTestRunner(descriptions=True, failfast=True, verbosity=2)
ret = not runner.run(suite()).wasSuccessful()
BaseTestCase.tearDownDriver()
sys.exit(ret)