lib/site-object/site.rb
# Returns true or false depending on whether the specified page is displayed. You can use a page
# object or a PageObject class name to identify the page you are looking for. Examples:
#
#  page = site.account_summary_page
#  =>#<AccountSummaryPage:70341126478080 ...>
#  site.on_page? page
#  =>true
#
#  site.on_page? AccountSummaryPage
#  =>true
Returns true or false depending on whether the specified page is displayed. You can use a page
object or a PageObject class name to identify the page you are looking for. Examples.




Returns true or false depending on whether the specified page is displayed . You can use a page object or a PageObject class name to identify the page you are looking for . Examples .
def on_page?(page_arg)
    if @browser.is_a? Watir::Browser
      url = @browser.url
    elsif @browser.is_a? Selenium::WebDriver::Driver
      url = @browser.current_url
    else
      raise SiteObject::BrowserLibraryNotSupportedError, "Unsupported browser library: #{@browser.class}"
    end
    if page_arg.url_matcher && page_arg.url_matcher =~ url
      return true
    elsif page_arg.url_template.match url
      return true
    else
      return false
    end
  end
def on_page? ( page_arg ) if @browser . is_a? Watir :: Browser url = @browser . url elsif @browser . is_a? Selenium :: WebDriver :: Driver url = @browser . current_url else raise SiteObject :: BrowserLibraryNotSupportedError , "Unsupported browser library: #{@browser.class}" end if page_arg . url_matcher && page_arg . url_matcher =~ url return true elsif page_arg . url_template . match url return true else return false end end
Returns true or false depending on whether the specified page is displayed.
Returns true or false depending on whether the specified page is displayed .
page_arg
<not_specific>