Beispiel #1
0
    def has_error(self, inputBox):
        """

        :param inputBox: the section where users send input strings
        :return: returns true if 'has-error' is in the inputBox class
        """
        driver = SeleniumDriver(self.driver)

        driver.get_element(inputBox, XPATH)
        inputBoxClass = driver.get_element_attribute(inputBox, XPATH, ClASS)

        if 'has-error' in inputBoxClass:
            return True
        else:
            return False
Beispiel #2
0
    def is_on(self, element):
        """

        :param element: the current element (XPATH)
        :return: returns true if 'state-on' or 'state1' is in the element's class
        """
        driver = SeleniumDriver(self.driver)

        driver.get_element(element, XPATH)
        element_class = driver.get_element_attribute(element, XPATH, ClASS)

        if 'state-on' in element_class or 'state1' in element_class:
            return True
        else:
            return False