Sha256: f131aa7991efdb90cd886a1adec1534b0c8286b22904ed0cca1a7dc1dec15e42
Contents?: true
Size: 1.4 KB
Versions: 6
Compression:
Stored size: 1.4 KB
Contents
require 'spec_helper' require 'page-object/elements' describe PageObject::Elements::RadioButton do let(:radiobutton) { PageObject::Elements::RadioButton } describe "when mapping how to find an element" do it "should map watir types to same" do [:class, :id, :index, :name, :value, :xpath].each do |t| identifier = radiobutton.watir_identifier_for t => 'value' identifier.keys.first.should == t end end it "should map selenium types to same" do [:class, :id, :name, :xpath, :value, :index].each do |t| key, value = radiobutton.selenium_identifier_for t => 'value' key.should == t end end end describe "interface" do context "for selenium" do let(:selenium_rb) { double('radio_button') } let(:radio_button) { PageObject::Elements::RadioButton.new(selenium_rb, :platform => :selenium_webdriver) } it "should select" do selenium_rb.should_receive(:click) selenium_rb.should_receive(:selected?).and_return(false) radio_button.select end it "should clear" do selenium_rb.should_receive(:click) selenium_rb.should_receive(:selected?).and_return(true) radio_button.clear end it "should know if it is selected" do selenium_rb.should_receive(:selected?).and_return(true) radio_button.should be_selected end end end end
Version data entries
6 entries across 6 versions & 1 rubygems