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"""importunittestfromselenium.webdriver.common.byimportByfromselenium.webdriver.support.waitimportWebDriverWaitfromselenium.webdriver.supportimportexpected_conditionsasEC# Import base test case for automatic cleanupfromdjango_landing_simple.test.base_test_caseimportReadOnlyDjangoTestCase
[docs]classtest_landing_simple_home(ReadOnlyDjangoTestCase):""" Class for the test cases of the django template "home" """
[docs]deftest_cases(self):""" test cases for the template "home" """# Get test parameters from configurationcustom_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 titleWebDriverWait(self.driver,10).until(EC.title_contains(custom_title_homepage))self.assertIn(custom_title_homepage,self.driver.title)