Source code for django_landing_simple.test.test_landing_simple_home

"""
test program for the django template "home"
based on the "unittest" and "selenium" functionality
"""

import unittest
from selenium.webdriver.common.by    import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support      import expected_conditions as EC

# Import base test case for automatic cleanup
from django_landing_simple.test.base_test_case import ReadOnlyDjangoTestCase

[docs] class test_landing_simple_home(ReadOnlyDjangoTestCase): """ Class for the test cases of the django template "home" """
[docs] def test_cases(self): """ test cases for the template "home" """ # Get test parameters from configuration custom_url = self.config_global.get('settings_django_server', 'url') custom_title_homepage = self.config_test.get('get_settings_title', 'title_homepage') # url of template "home = '/landing_simple/home' self.driver.get(custom_url + '/landing_simple/home') # Wait and assert home page title WebDriverWait(self.driver, 10).until(EC.title_contains(custom_title_homepage)) self.assertIn(custom_title_homepage, self.driver.title)
if __name__ == "__main__": unittest.main()