def test_psychiatrist_settings_button_click(self):
            PsychiatristNavBar.click_acc_settings_button()

            page_status_code = CommonPageObject.get_page_response(self)

            self.assertEqual(
                page_status_code, 200
            )  # Our page status code should equal 200 if it is functional.

            page_url = CommonPageObject.get_page_url(self)

            self.assertTrue(
                compare_and_evaluate_relative_urls(
                    page_url, 'acc_settings_bp.psychiatrist_acc_settings'))
    def test_patient_logout_button_click(self):

        PatientNavBar.click_logout_button()

        page_status_code = CommonPageObject.get_page_response(self)

        self.assertEqual(
            page_status_code,
            200)  # Our page status code should equal 200 if it is functional.

        page_url = CommonPageObject.get_page_url(self)

        self.assertTrue(
            compare_and_evaluate_relative_urls(page_url, 'auth_bp.logout'))
    def test_about_button_click(
        self
    ):  # A test to check the functionality of clicking the 'about' button.

        MainNavBar.click_home_button()

        page_status_code = CommonPageObject.get_page_response(self)

        self.assertEqual(
            page_status_code,
            200)  # Our page status code should equal 200 if it is functional.

        page_url = CommonPageObject.get_page_url(self)

        self.assertTrue(
            compare_and_evaluate_relative_urls(page_url, 'main_bp.about'))
    def test_page_footer(
            self):  # A test to check that the page footer is correct.
        get_page_footer = CommonPageObject.get_page_footer(self)[
            'text']  # Retrieve text from page footer.

        print_assertion_to_console('page footer', get_page_footer,
                                   self.footer_assertion)

        self.assertEqual(get_page_footer, self.footer_assertion)
    def test_page_title(
            self):  # A test to check that the title of our page is correct.
        get_page_title = CommonPageObject.get_page_title(
            self)  # Retrieve the page title.

        print_assertion_to_console('page title', get_page_title,
                                   self.title_assertion)

        self.assertEqual(get_page_title, self.title_assertion)
    def test_page_favicon(
            self):  # A test to check that the correct favicon is displaying.
        get_favicon_name = CommonPageObject.get_favicon_element(self)[
            'name']  # Retrieve favicon name.

        print_assertion_to_console('page favicon', get_favicon_name,
                                   self.favicon_assertion_name)

        self.assertEqual(get_favicon_name,
                         self.favicon_assertion_name)  # Make test assertion.
Example #7
0
    def test_server_is_up_and_running(self):

        # Ignore PEP3. We want to call our class method from CommonPageObject with class instance of LiveServerTestCase.

        page_status_code = CommonPageObject.get_page_response(
            self)  # Set status code by calling 'get_page_response'.

        self.assertEqual(
            page_status_code,
            200)  # Our page status code should equal 200 if it is functional.