Skip to content

Commit

Permalink
[qacode] more #143 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
netzulo committed Apr 7, 2020
1 parent ab81547 commit a4f8b05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
21 changes: 6 additions & 15 deletions qacode/core/webs/controls/control_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,17 +408,12 @@ def __repr__(self):
"""Show basic properties for this object"""
return ("{}: name={}, "
"bot.browser={}, bot.mode={} \n"
"settings={} \n"
"is_displayed={}, "
"is_enabled={}, is_selected={}").format(
"settings={}").format(
self.__class__.__name__,
self.name,
self.bot.settings.get('browser'),
self.bot.settings.get('mode'),
self.settings,
self.is_displayed,
self.is_enabled,
self.is_selected)
self.settings)

@property
def bot(self):
Expand Down Expand Up @@ -511,23 +506,19 @@ def tag(self):
@property
def text(self):
"""GET for element text attribute"""
self.__check_element_ready__()
return self._browser.elements.get_text(self._element)
return self._text

@property
def is_displayed(self):
"""TODO: doc method"""
self.__check_element_ready__()
return self.bot.navigation.ele_is_displayed(self.element)
return self.bot.navigation.ele_is_displayed(self.element) or None

@property
def is_enabled(self):
"""TODO: doc method"""
self.__check_element_ready__()
return self.bot.navigation.ele_is_enabled(self.element)
return self.bot.navigation.ele_is_enabled(self.element) or None

@property
def is_selected(self):
"""TODO: doc method"""
self.__check_element_ready__()
return self.bot.navigation.ele_is_selected(self.element)
return self.bot.navigation.ele_is_selected(self.element) or None
16 changes: 0 additions & 16 deletions tests/001_functionals/suite_005_controlbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,6 @@ def test_method_gettext(self):
control = ControlBase(self.bot, **cfg_btn)
ASSERT.equals(control.get_text(), 'Login')

@pytest.mark.skipIf(SKIP_CONTROLS, SKIP_CONTROLS_MSG)
def test_property_attr_id(self):
"""Testcase: test_property_attr_id"""
cfg_input = self.txt_username.copy()
cfg_input.update({"on_instance_search": True})
control = ControlBase(self.bot, **cfg_input)
ASSERT.not_none(control.attr_id)

@pytest.mark.skipIf(SKIP_CONTROLS, SKIP_CONTROLS_MSG)
def test_property_attr_class(self):
"""Testcase: test_property_attr_class"""
cfg_form = self.form_login.copy()
cfg_form.update({"on_instance_search": True})
control = ControlBase(self.bot, **cfg_form)
ASSERT.in_list('ember-view', control.attr_class)

@pytest.mark.skipIf(SKIP_CONTROLS, SKIP_CONTROLS_MSG)
def test_method_getattrvalue(self):
"""Testcase: test_method_getattrvalue"""
Expand Down

0 comments on commit a4f8b05

Please sign in to comment.