Sha256: ac9b992981a159edd07a87d0bbb4fb594a63c695653e19175ccc7725fafa3bbf

Contents?: true

Size: 936 Bytes

Versions: 2

Compression:

Stored size: 936 Bytes

Contents

module WebConditions

  # @method title_to_match
  # @param [title] -- expected title to match the actual title of the web page
  # @return [Boolean true] -- if expected title matches the actual title on the web page
  # @return [Boolean false] -- if expected title does not match the actual title on the web page

  def title_to_match(title)
    actual = @driver.title
    if actual == title
      true
    else
      false
    end
  end

  # @method title_to_include
  # @param [title] -- expected title to match the actual title of the  web page
  # @return [Boolean true] -- if expected title is included in the actual title on the web page
  # @return [Boolean false] -- if expected title is not included in the actual title on the web page

  def title_to_include(title)
    actual = @driver.title
    if actual.include?(title)
      true
    else
      false
    end
  end
  alias_method :title_to_contain, :title_to_include

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
web-object-0.5 lib/web-object/conditions/title.rb
web-object-0.4 lib/web-object/conditions/title.rb