def test_2001_add_form(self):
        """
        Test add a new form.
        """
        # Clean up database
        db_clean_up()

        self.__test_add_form(wait=WAIT_FOR)
    def test_4002_remove_form_handlers(self):
        """
        Test remove form handler.
        """
        # Clean up database
        db_clean_up()

        self.__test_add_form_handlers(create_form=True)

        self.__test_remove_form_handlers()
    def test_3002_remove_form_elements(self):
        """
        Test remove form element.
        """
        # Clean up database
        db_clean_up()

        self.__test_add_form_elements(create_form=True)

        self.__test_remove_form_elements()
    def test_3001_add_form_elements(self, wait=WAIT_FOR):
        """
        Test adding form elements.
        """
        # Clean up database
        db_clean_up()

        self.__test_add_form_elements(create_form=True)

        self.__sleep(wait)
    def test_4001_add_form_handlers(self, wait=WAIT_FOR):
        """
        Test of adding a single form handler. At this point, if form isn't
        created, it should be.
        """
        # Clean up database
        db_clean_up()

        self.__test_add_form_handlers(create_form=True)

        self.__sleep(wait)
    def test_2004_submit_form(self, wait=WAIT_FOR):
        """
        Test submit form.
        """
        # Clean up database
        db_clean_up()

        # Add form elements
        self.__test_add_form_elements(create_form=True)

        # self.__sleep(wait)

        # Getting a form object
        form = self.__get_form()

        # Getting the form URL
        url = reverse("fobi.view_form_entry", args=[form.slug])
        self.selenium.get("{0}{1}".format(self.__get_live_server_url(), url))

        # Wait until the edit widget form opens
        WebDriverWait(self.selenium, timeout=TIMEOUT).until(
            lambda driver: driver.find_element_by_xpath('//body[contains(@class, "theme-bootstrap3")]')
        )

        for field_name, field_value in TEST_FORM_FIELD_DATA.items():
            field_input = self.selenium.find_element_by_name(field_name)
            field_input.send_keys(field_value)

        self.__sleep(2)

        # Click add widget button
        self.selenium.find_element_by_xpath('//button[@type="submit"]').click()

        # Wait until the submit success page opens a clear success message.
        WebDriverWait(self.selenium, timeout=TIMEOUT).until(
            lambda driver: driver.find_element_by_xpath(
                """//div[contains(text(), 'Form {0} was submitted successfully.') and contains(@class, "alert-info")]""".format(
                    constants.TEST_FORM_NAME
                )
            )
        )

        self.__sleep(wait)