Beispiel #1
0
 def test_method_deselect_notdropdown(self, text):
     """Testcase: test_method_deselect_notdropdown"""
     control = ControlDropdown(self.bot, **self.dd_multiple)
     control.select(text)
     control.dropdown = None
     control.deselect(text)
     ASSERT.is_instance(control.dropdown, Select)
Beispiel #2
0
 def test_method_reload_form(self, auto_reload):
     """Testcase: test_method_reload_form"""
     # must be supported
     cfg = self.dd_base
     cfg.update({
         "auto_reload": auto_reload,
         "on_instance_search": False,
     })
     ctl = ControlDropdown(self.bot, **cfg)
     ASSERT.equals(ctl.on_instance_search, False)
     ASSERT.none(ctl.element)
     ASSERT.none(ctl.dropdown)
     # Real test behaviour
     cfg.update({"on_instance_search": True})
     ctl.reload(**cfg)
     ASSERT.equals(ctl.on_instance_search, True)
     ASSERT.is_instance(ctl.element, WebElement)
     ASSERT.is_instance(ctl.dropdown, Select)
Beispiel #3
0
 def test_method_deselect_all_reload(self):
     """Testcase: test_method_deselect_all_reload"""
     texts = ["Link 1.1", "Link 1.2"]
     control = ControlDropdown(self.bot, **self.dd_multiple)
     for text in texts:
         control.select(text)
     control.element = None
     control.deselect_all()
Beispiel #4
0
 def test_method_deselect_all_notdropdown(self):
     """Testcase: test_method_deselect_all_notdropdown"""
     texts = ["Link 1.1", "Link 1.2"]
     control = ControlDropdown(self.bot, **self.dd_multiple)
     for text in texts:
         control.select(text)
     control.dropdown = None
     control.deselect_all()
     ASSERT.is_instance(control.dropdown, Select)
Beispiel #5
0
 def test_controldropdown_instance(self, on_instance_search, rules,
                                   auto_reload):
     """Testcase: test_001_instance_selector"""
     cfg = self.dd_base
     cfg.update({
         "instance": "ControlDropdown",
         "on_instance_search": on_instance_search,
         "auto_reload": auto_reload,
         "rules": rules
     })
     # functional testcases
     ctl = ControlDropdown(self.bot, **cfg)
     ASSERT.is_instance(ctl, ControlDropdown)
     ASSERT.equals(ctl.selector, cfg.get('selector'))
     ASSERT.equals(ctl.name, cfg.get('name'))
     ASSERT.equals(ctl.locator, 'css selector')
     ASSERT.equals(ctl.on_instance_search, cfg.get('on_instance_search'))
     ASSERT.equals(ctl.auto_reload, cfg.get('auto_reload'))
     if on_instance_search:
         ASSERT.is_instance(ctl.element, WebElement)
     if auto_reload is not None:
         ASSERT.none(ctl.dropdown)
         ctl.reload(**ctl.settings)
         ASSERT.is_instance(ctl.dropdown, Select)
Beispiel #6
0
 def test_method_deselect_by_index_raises(self, text):
     """Testcase: test_method_deselect_by_text"""
     control = ControlDropdown(self.bot, **self.dd_multiple)
     control.select(0, by_index=True)
     with pytest.raises(ControlException):
         control.deselect(text, by_index=True)
Beispiel #7
0
 def test_method_deselect_by_index(self, index):
     """Testcase: test_method_deselect_by_index"""
     control = ControlDropdown(self.bot, **self.dd_multiple)
     control.select(index, by_index=True)
     control.deselect(index, by_index=True)
Beispiel #8
0
 def test_method_deselect_by_value(self, text):
     """Testcase: test_method_deselect_by_value"""
     control = ControlDropdown(self.bot, **self.dd_multiple)
     control.select(text, by_value=True)
     control.deselect(text, by_value=True)
Beispiel #9
0
 def test_method_deselect_reload(self, text):
     """Testcase: test_method_deselect_reload"""
     control = ControlDropdown(self.bot, **self.dd_multiple)
     control.select(text)
     control.element = None
     control.deselect(text)
Beispiel #10
0
 def test_method_deselect_by_text(self, text):
     """Testcase: test_method_deselect_by_text"""
     control = ControlDropdown(self.bot, **self.dd_multiple)
     control.select(text)
     control.deselect(text)
Beispiel #11
0
 def test_method_select_by_index_raises(self, index):
     """Testcase: test_method_select_by_index_raises"""
     control = ControlDropdown(self.bot, **self.dd_base)
     with pytest.raises(ControlException):
         control.select(index, by_index=True)
Beispiel #12
0
 def test_method_select_badparams(self, text):
     """Testcase: test_method_select_badparams"""
     control = ControlDropdown(self.bot, **self.dd_base)
     control.element = None
     with pytest.raises(ControlException):
         control.select(text, by_value=True, by_index=True)
Beispiel #13
0
 def test_method_select_notdropdown(self, text):
     """Testcase: test_method_select_notdropdown"""
     control = ControlDropdown(self.bot, **self.dd_base)
     control.dropdown = None
     control.select(text)