Example #1
0
    def click_on_node(self, node):
        try:
            highlight(node)
            self.click_me(node)

        except Exception:
            dump(self.get_driver(), reason=self.click_on_node.__name__)
Example #2
0
    def collapse_tree_node(self, node):
        try:
            parent_node = self.get_parent_node(node)
            arrow = self.find_it(UI.get_theia_expand_arrow_locator(), parent=parent_node)
            is_expanded = self.is_element_expanded(arrow)
            if is_expanded:
                self.click_me(node)

        except Exception:
            dump(self.get_driver(), reason=self.collapse_tree_node.__name__)
    def __init__(self, driver=None, call_from=None, msg=""):
        self.driver = driver
        self.msg = msg
        super(GeneralException, self).__init__(msg)
        if msg != "":
            print(msg)

        reason = self.__class__.__name__
        if call_from is not None:
            reason = "{0}: {1}".format(reason, call_from)

        dump(self.driver, reason=reason)
    def find_active_hover_element(self, editor=None):
        if editor is None:
            editor = self.get_editor_element()

        hovers = self.find_them(UI.get_monako_hover_locator(), parent=editor)
        print("hovers", hovers, len(hovers))

        for hover in hovers:
            print("hover class", hover.get_attribute(constants.TYPE_CLASS))
            if constants.STATE_HIDDEN not in hover.get_attribute(
                    constants.TYPE_CLASS):
                return hover

        dump(self.get_driver(), reason=self.find_active_hover_element.__name__)
        raise WebDriverException
    def find_errors_on_screen(self, editor=None, error_type="error"):
        if editor is None:
            editor = self.get_editor_element()

        error_lines = list()

        error_divs = self.error_should_present(editor=editor,
                                               error_type=error_type)
        print("error_divs: '{0}'".format(error_divs))
        # debug!
        if not len(error_divs):
            dump(self.get_driver(), reason=self.find_errors_on_screen.__name__)

        for error_div in error_divs:
            parent = self.get_parent_node(error_div)
            top = self.get_element_top(parent)
            line_num = self.get_line_number_from_top(top, editor)
            error_lines.append(line_num)

        return error_lines