class SpecTest::WebObjects::TextField

Public Class Methods

new(web_object, platform) click to toggle source
# File lib/spectest/web_objects/text_field.rb, line 5
def initialize(web_object, platform)
  @web_object = web_object
  mixin_web_objects_for platform
end

Protected Class Methods

locators_for_selenium() click to toggle source
# File lib/spectest/web_objects/text_field.rb, line 20
def self.locators_for_selenium
  super + [:css]
end
locators_for_watir() click to toggle source
# File lib/spectest/web_objects/text_field.rb, line 12
def self.locators_for_watir
  super + [:tag_name]
end
mappings_for_selenium() click to toggle source
# File lib/spectest/web_objects/text_field.rb, line 24
def self.mappings_for_selenium
  super.merge({:tag_name => :css})
end
mappings_for_watir() click to toggle source
# File lib/spectest/web_objects/text_field.rb, line 16
def self.mappings_for_watir
  super.merge({:css => :tag_name})
end

Protected Instance Methods

mixin_web_objects_for(platform) click to toggle source
# File lib/spectest/web_objects/text_field.rb, line 28
def mixin_web_objects_for(platform)
  super
  if platform[:platform] == :watir_webdriver
    require "spectest/platform_watir/web_objects/text_field"
    self.class.send :include, SpecTest::Platforms::WatirWebDriver::TextField
  elsif platform[:platform] == :selenium_webdriver
    require "spectest/platform_selenium/web_objects/text_field"
    self.class.send :include, SpecTest::Platforms::SeleniumWebDriver::TextField
  else
    raise ArgumentError, "Unable to mixin web objects for the specified platform."
  end
end