def element_not_equals_text(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, text): actual_text = selenium_generics.get_text_from_element(locators.parse_and_get(locator_path)) assert_that(actual_text).is_not_equal_to(text)
def contains_any_text(selenium_generics: SeleniumGenerics, locators: Locators, locator_path): actual_text = selenium_generics.get_text_from_element(locators.parse_and_get(locator_path)) assert_that(actual_text).matches(r'(.*?)')
def check_css_property_is_not(attribute, selenium_generics: SeleniumGenerics, locators: Locators, locator_path, value): actual_value = selenium_generics.get_css_attribute_of_element(locators.parse_and_get(locator_path), attribute) assert_that(actual_value).is_not_equal_to(value)
def check_does_not_contain_same_text(selenium_generics: SeleniumGenerics, locators: Locators, locator_path1, locator_path2): actual_text1 = selenium_generics.get_text_from_element(locators.parse_and_get(locator_path1)) actual_text2 = selenium_generics.get_text_from_element(locators.parse_and_get(locator_path2)) assert_that(actual_text1).is_not_equal_to(actual_text2)
def does_not_contain_text(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, text): actual_text = selenium_generics.get_text_from_element(locators.parse_and_get(locator_path)) assert_that(actual_text).does_not_contain(text)
def hover_over_shadow_element(selenium_generics: SeleniumGenerics, locators: Locators, element_path): parent_xpath = locators.parse_and_get(element_path['parent_xpath']) locator_paths = [ locators.parse_and_get(path) for path in element_path['shadow_path'].split(' ~ ') ] selenium_generics.shadow_hover(parent_xpath, *locator_paths)
def nextgen_simple_card_style(selenium_generics: SeleniumGenerics, component_locator, data_table): selenium_generics.set_component_style(component_locator, data_table)
def click_on_element(selenium_generics: SeleniumGenerics, locators: Locators, locator_path): xpath = locators.parse_and_get(locator_path) selenium_generics.scroll_into_view(selector=xpath) selenium_generics.click(selector=xpath)
def hover_over_element(selenium_generics: SeleniumGenerics, locators: Locators, locator_path): xpath = locators.parse_and_get(locator_path) selenium_generics.scroll_into_view(selector=xpath) selenium_generics.hover(selector=xpath)
def page_loaded(selenium_generics: SeleniumGenerics, page_url): selenium_generics.validate_page_loaded(page_url)
def page_scroll_position(selenium_generics: SeleniumGenerics, scroll_position): selenium_generics.validate_scroll_position(scroll_position)
def header_menu_button_style(selenium_generics: SeleniumGenerics, data_table): selenium_generics.validate_shadow_element_style(data_table)
def header_menu_button_style(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, data_table): xpath = locators.parse_and_get(locator_path) selenium_generics.validate_element_style(xpath, data_table)
def element_text(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, expected_text): xpath = locators.parse_and_get(locator_path) selenium_generics.validate_element_text(xpath, expected_text)
def element_is_hidden(selenium_generics: SeleniumGenerics, locators: Locators, locator_path): xpath = locators.parse_and_get(locator_path) selenium_generics.is_element_invisible(xpath)
def element_is_displayed(selenium_generics: SeleniumGenerics, locators: Locators, locator_path): xpath = locators.parse_and_get(locator_path) selenium_generics.is_element_visible(xpath)