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)
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"])
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)
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()
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)
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)
def test_get_selected(self): Assert.assert_equal(self.dropdown.get_selected(), "Colors")
def test_is_selected_enum(self): Assert.assert_equal(self.dropdown.is_selected(Colors.COLORS), True)
def test_get_value(self): Assert.assert_equal(self.radio_buttons.get_value(), "1")
def test_get_options_as_text(self): Assert.assert_equal(self.dropdown.get_options_as_text(), "Colors, Red, Green, Blue, Yellow")
def test_get_values(self): Assert.assert_equal(self.dropdown.get_values(), self.odd_options)
def test_set_attribute(self): attribute_name = "testAttr" value = "testValue" self.text_item.set_attribute(attribute_name, value) Assert.assert_equal(self.text_item.get_web_element().get_attribute(attribute_name), value)
def test_get_value(self): Assert.assert_equal(self.dropdown.get_value(), "Colors")
def test_get_values(self): Assert.assert_equal(self.check_list.get_values(), self.nature_options)
def test_is_selected(self): Assert.assert_equal(self.dropdown.is_selected("Colors"), True)
def test_get_name(self): Assert.assert_equal(self.dropdown.get_name(), "color_dropdown")
def test_get_reference(self): Assert.assert_equal(self.link.get_reference(), EpamJDISite.support_page.url)
def test_are_selected(self): Assert.assert_equal(self.check_list.are_selected(), [])
def test_get_value(self): Assert.assert_equal(self.check_list.get_value(), None)
def test_get_selected_index(self): Assert.assert_equal(self.radio_buttons.get_selected_index(), 0)
def test_get_name(self): Assert.assert_equal(self.check_list.get_name(), "nature_check_list")
def test_get_name(self): Assert.assert_equal(self.radio_buttons.get_name(),"odds_radio_buttons")
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)
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)
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)
def test_new_input(self): self.text_field.new_input(self.input_text) Assert.assert_equal(self.text_field.get_text(), self.input_text)
def test_clear(self): self.text_field.clear() Assert.assert_equal(self.text_field.get_text(), "")
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)
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])
def test_fill(): W3cSite.frame_page.try_it_button.click() Assert.assert_equal(W3cSite.frame_page.i_frame.label_button.get_text(), "Click Me!")
def test_input_line(self): self.text_item.input_lines(self.LINES) lines = self.text_item.get_lines() Assert.assert_equal(lines, self.LINES)
def test_are_deselected(self): Assert.assert_equal(self.check_list.are_deselected(), self.nature_options)
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)
def test_get_options_as_text(self): Assert.assert_equal(self.check_list.get_options_as_text(), self.all_values)
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")
def test_get_values(self): Assert.assert_equal(self.radio_buttons.get_values(), self.odd_options)
def test_get_options_as_text(self): Assert.assert_equal(self.radio_buttons.get_options_as_text(), ", ".join(self.odd_options))
def test_get_name(self): Assert.assert_equal(self.radio_buttons.get_name(), "odds_selector")
def test_get_selected(self): Assert.assert_equal(self.radio_buttons.get_selected(), "1")
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)