your_app/page/abstract_page.rb
# INFO: Good Practice
# Example #7 - use full system checks to verify optional elements
Good Practice
Example #7 - use full system checks to verify optional elements
Good Practice Example #7 - use full system checks to verify optional elements
def wait_for_optional_element_text(expected_lexeme:, locator:)
    Assertions.assert_not_nil(locator, 'locator should be specified')
    if expected_lexeme.nil?
      Assertions.assert_false(elements_displayed?(locator), "Element '#{locator}' should not be displayed")
    else
      wait_for_element_text(expected_lexeme: expected_lexeme, locator: locator)
    end
  end
def wait_for_optional_element_text ( expected_lexeme : , locator : ) Assertions . assert_not_nil ( locator , 'locator should be specified' ) if expected_lexeme . nil? Assertions . assert_false ( elements_displayed? ( locator ) , "Element '#{locator}' should not be displayed" ) else wait_for_element_text ( expected_lexeme : expected_lexeme , locator : locator ) end end
INFO: Good Practice
Example #7 - use full system checks to verify optional elements
INFO : Good Practice Example #7 - use full system checks to verify optional elements
expected_lexeme
<not_specific>
locator
<not_specific>