Ejemplo n.º 1
0
 def test_set_attribute(self):
     attribute_name = "testAttr"
     value = "testValue"
     self.clickable_item.set_attribute(attribute_name, value)
     Assert.assert_equal(
         self.clickable_item.get_element().get_attribute(attribute_name),
         value)
Ejemplo n.º 2
0
 def check_action_throw_error(action, message):
     try:
         action()
     except Exception as ex:
         Assert.assert_contains(str(ex), message)
         return
     raise Exception("Exception not thrown")
Ejemplo n.º 3
0
 def test_add_cookie(self):
     cookie = {'name': 'key', 'value': 'value'}
     self.get_driver().delete_all_cookies()
     Assert.is_true(not len(self.get_driver().get_cookies()))
     EpamJDISite.contact_form_page.add_cookie(cookie)
     Assert.assert_equal(
         self.get_driver().get_cookie(cookie["name"])["value"],
         cookie["value"])
Ejemplo n.º 4
0
 def test_focus(self):
     value = "value"
     attribute_name = "focusTest"
     self.text_field.set_attribute(attribute_name, value)
     self.text_field.focus()
     driver = JDISettings.get_driver_factory().get_driver()
     result_value = driver._switch_to.active_element.get_attribute(attribute_name)
     Assert.assert_equal(value, result_value)
Ejemplo n.º 5
0
 def test_refresh(self):
     EpamJDISite.contact_form_page.contact_form.submit.click()
     Assert.assert_equal(EpamJDISite.contact_form_page.result.get_text(),
                         "Summary: 3")
     EpamJDISite.contact_form_page.refresh()
     Assert.assert_equal(EpamJDISite.contact_form_page.result.get_text(),
                         "")
     EpamJDISite.contact_form_page.check_opened()
Ejemplo n.º 6
0
 def test_column_by_criteria_name(self):
     actual_column = "".join(
         list(
             map(
                 lambda x: "{0}:{1} ".format(str(x[0]), x[1].get_text()),
                 self.table.column("TestNG, JUnit, Custom", Row.row("3")),
             )))
     Assert.assert_equal(actual_column, self.expected_column)
Ejemplo n.º 7
0
 def test_focus(self):
     value = "value"
     attribute_name = "focusTest"
     self.text_field.set_attribute(attribute_name, value)
     self.text_field.focus()
     driver = JDISettings.get_driver_factory().get_driver()
     result_value = driver._switch_to.active_element.get_attribute(attribute_name)
     Assert.assert_equal(value, result_value)
Ejemplo n.º 8
0
 def test_row_by_criteria_int(self):
     actual_column = "".join(
         list(
             map(
                 lambda x: "{0}:{1} ".format(str(x[0]), x[1].get_text()),
                 self.table.row("MSTest, NUnit, Epam", Column.column(3)),
             )))
     Assert.assert_equal(actual_column, self.expected_row)
Ejemplo n.º 9
0
 def check_action_throw_error(action, message):
     try:
         action()
     except RuntimeError as e:
         logging.exception(e)
     except Exception as ex:
         Assert.assert_contains(str(ex), message)
         return
     raise RuntimeError("No exception was raised")
Ejemplo n.º 10
0
    def check_action_throw_error(action, message):
        try:
            action()
        except Exception as ex:
            Assert.assert_contains(str(ex), message)
            return
        except:
            d = 8

        raise Exception("Exception not thrown")
Ejemplo n.º 11
0
 def test_wait_reference_test(self):
     Preconditions.SUPPORT_PAGE.is_in_state()
     EpamJDISite.home_page.open()
     Assert.wait_assert_equal(lambda: self.link.get_reference(), EpamJDISite.support_page.url)
Ejemplo n.º 12
0
 def test_is_check(self):
     Assert.is_false(self.check_box.is_checked())
     self.check_box.click()
     Assert.is_true(self.check_box.is_checked())
Ejemplo n.º 13
0
 def test_is_selected(self):
     Assert.assert_equal(self.radio_buttons.is_selected("7"), False)
     Assert.assert_equal(self.radio_buttons.is_selected("1"), True)
Ejemplo n.º 14
0
 def test_get_options_as_text(self):
     Assert.assert_equal(self.radio_buttons.get_options_as_text(), ", ".join(self.odd_options))
Ejemplo n.º 15
0
 def test_get_name(self):
     Assert.assert_equal(self.dropdown.get_name(), "color_dropdown")
Ejemplo n.º 16
0
 def test_get_values(self):
     Assert.assert_equal(self.check_list.get_values(), self.nature_options)
Ejemplo n.º 17
0
 def check_action(text, line_number=0):
     Assert.assert_contains(EpamJDISite.actions_log.get_text_by_line(line_number), text)
Ejemplo n.º 18
0
 def test_get_value(self):
     Assert.assert_equal(self.dropdown.get_value(), "Colors")
Ejemplo n.º 19
0
 def test_is_selected_enum(self):
     Assert.assert_equal(self.dropdown.is_selected(Colors.COLORS), True)
Ejemplo n.º 20
0
 def test_is_selected(self):
     Assert.assert_equal(self.dropdown.is_selected("Colors"), True)
Ejemplo n.º 21
0
 def test_is_check(self, checkbox_setup):
     Assert.assert_false(self.check_box.is_checked())
     self.check_box.click()
     Assert.assert_true(self.check_box.is_checked())
Ejemplo n.º 22
0
 def test_input(self):
     self.text_field.input(self.input_text)
     Assert.assert_equal(self.text_field.get_text(), self.initial_text+self.input_text)
Ejemplo n.º 23
0
 def test_get_name(self):
     Assert.assert_equal(self.check_list.get_name(), "nature_check_list")
Ejemplo n.º 24
0
 def test_send_key(self):
     self.text_field.send_keys(self.input_text)
     Assert.assert_equal(self.text_field.get_text(), self.initial_text+self.input_text)
Ejemplo n.º 25
0
 def test_get_tip(self):
     Assert.check_text(self.clickable_item.get_alt(), self.ALT)
Ejemplo n.º 26
0
 def test_new_input(self):
     self.text_field.new_input(self.input_text)
     Assert.assert_equal(self.text_field.get_text(), self.input_text)
Ejemplo n.º 27
0
 def test_get_selected(self):
     Assert.assert_equal(self.radio_buttons.get_selected(), "1")
Ejemplo n.º 28
0
 def test_clear(self):
     self.text_field.clear()
     Assert.assert_equal(self.text_field.get_text(), "")
Ejemplo n.º 29
0
 def test_get_value(self):
     Assert.assert_equal(self.radio_buttons.get_value(), "1")
Ejemplo n.º 30
0
 def test_multi_key(self):
     for letter in self.input_text:
         self.text_field.send_keys(letter)
     Assert.assert_equal(self.text_field.get_text(), self.initial_text+self.input_text)
Ejemplo n.º 31
0
 def test_get_value(self):
     Assert.assert_equal(self.dropdown.get_value(), "Colors")
Ejemplo n.º 32
0
 def test_add_new_line(self):
     new_line = "newLine"
     self.text_item.send_keys("garbageString")
     self.text_item.add_new_line(new_line)
     lines = self.text_item.get_lines()
     Assert.assert_equal(new_line, lines[1])
Ejemplo n.º 33
0
 def test_get_reference(self):
     Assert.assert_equal(self.link.get_reference(), EpamJDISite.support_page.url)
Ejemplo n.º 34
0
 def test_fill():
     W3cSite.frame_page.try_it_button.click()
     Assert.assert_equal(W3cSite.frame_page.i_frame.label_button.get_text(), "Click Me!")
Ejemplo n.º 35
0
 def test_input_line(self):
     self.text_item.input_lines(self.LINES)
     lines = self.text_item.get_lines()
     Assert.assert_equal(lines, self.LINES)
Ejemplo n.º 36
0
 def test_get_selected(self):
     Assert.assert_equal(self.dropdown.get_selected(), "Colors")
Ejemplo n.º 37
0
 def test_get_lines(self):
     self.text_item.send_keys(self.LINES[0] + "\n" + self.LINES[1] + "\n" +
                              self.LINES[2])
     Assert.assert_equal(self.text_item.get_lines(), self.LINES)
Ejemplo n.º 38
0
 def test_get_values(self):
     Assert.assert_equal(self.dropdown.get_values(), self.odd_options)
Ejemplo n.º 39
0
 def test_submit_spec_button_string(self):
     self.form.submit_form(self.contact, "calculate")
     Assert.assert_equal(EpamJDISite.contact_form_page.result.get_text(), "Summary: 3")
Ejemplo n.º 40
0
 def test_is_check(self):
     Assert.assert_false(self.check_box.is_checked())
     self.check_box.click()
     Assert.assert_true(self.check_box.is_checked())
Ejemplo n.º 41
0
 def check(self, entity):
     res = self.verify(entity)
     Assert.is_true(res, "Check form failed")
Ejemplo n.º 42
0
 def test_are_deselected(self):
     Assert.assert_equal(self.check_list.are_deselected(),
                         self.nature_options)
Ejemplo n.º 43
0
 def test_get_options_as_text(self):
     Assert.assert_equal(self.check_list.get_options_as_text(),
                         self.all_values)
Ejemplo n.º 44
0
 def check_all_unchecked(self):
     driver = JDISettings.get_driver_factory().get_driver()
     els = driver.find_elements(By.CSS_SELECTOR,
                                value="#elements-checklist input")
     for el in els:
         Assert.assert_true(el.get_attribute("checked") in ["false", None])
Ejemplo n.º 45
0
 def test_are_selected(self):
     Assert.assert_equal(self.check_list.are_selected(), [])
Ejemplo n.º 46
0
 def test_get_options_as_text(self):
     Assert.assert_equal(self.dropdown.get_options_as_text(), "Colors, Red, Green, Blue, Yellow")
Ejemplo n.º 47
0
 def test_get_value(self):
     Assert.assert_equal(self.check_list.get_value(), None)
Ejemplo n.º 48
0
def check_page_opened(num):
    Assert.assert_true(JDISettings.get_driver_factory().get_driver().current_url.endswith("/page{0}.htm".format(num)))
Ejemplo n.º 49
0
 def test_get_source(self):
     Assert.check_text(self.clickable_item.get_source(), self.SRC)
Ejemplo n.º 50
0
 def check(self, entity):
     res = self.verify(entity)
     Assert.assert_true(res)
Ejemplo n.º 51
0
 def test_get_values(self):
     Assert.assert_equal(self.radio_buttons.get_values(), self.odd_options)
Ejemplo n.º 52
0
 def test_get_options_as_text(self):
     Assert.assert_equal(self.dropdown.get_options_as_text(),
                         "Colors, Red, Green, Blue, Yellow")
Ejemplo n.º 53
0
 def test_get_name(self):
     Assert.assert_equal(self.radio_buttons.get_name(),"odds_radio_buttons")
Ejemplo n.º 54
0
 def test_get_name(self):
     Assert.assert_equal(self.dropdown.get_name(), "color_dropdown")
Ejemplo n.º 55
0
 def test_get_selected_index(self):
     Assert.assert_equal(self.radio_buttons.get_selected_index(), 0)
Ejemplo n.º 56
0
 def test_get_selected(self):
     Assert.assert_equal(self.dropdown.get_selected(), "Colors")
Ejemplo n.º 57
0
 def test_is_selected_enum(self):
     Assert.assert_equal(self.radio_buttons.is_selected(Odds.SEVEN), False)
     Assert.assert_equal(self.radio_buttons.is_selected(Odds.ONE), True)
Ejemplo n.º 58
0
 def test_is_selected(self):
     Assert.assert_equal(self.dropdown.is_selected("Colors"), True)
Ejemplo n.º 59
0
 def test_click(self):
     self.button.click()
     Assert.assert_element_test(self.button, "CALCULATE")
Ejemplo n.º 60
0
 def test_is_selected_enum(self):
     Assert.assert_equal(self.dropdown.is_selected(Colors.COLORS), True)