Sha256: 57e106f826b293799b0ba5e40c23e277361d5be75b62359a115fc3cf1623c39a
Contents?: true
Size: 1.18 KB
Versions: 44
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' require 'page-object/elements' describe PageObject::Elements::FileField do describe "when mapping how to find an element" do let(:filefield) { PageObject::Elements::FileField } it "should map watir types to same" do [:class, :id, :index, :name, :xpath, :title].each do |t| identifier = filefield.watir_identifier_for t => 'value' identifier.keys.first.should == t end end it "should map selenium types to same" do [:class, :id, :index, :name, :xpath, :title].each do |t| key, value = filefield.selenium_identifier_for t => 'value' key.should == t end end end describe "interface" do let(:filefield) { double('file_field') } it "should register as type :file" do ::PageObject::Elements.element_class_for(:input, :file).should == ::PageObject::Elements::FileField end context "for selenium" do it "should set its' value" do selenium_file_field = PageObject::Elements::FileField.new(filefield, :platform => :selenium_webdriver) filefield.should_receive(:send_keys).with('a file') selenium_file_field.value = 'a file' end end end end
Version data entries
44 entries across 44 versions & 2 rubygems