<commit_before># encoding: utf-8
require File.dirname(__FILE__) + '/spec_helper'

describe "IE" do

  # Class methods
  it "responds to .speed" do
    Browser.should respond_to("speed")
  end

  it "responds to .speed=" do
    Browser.should respond_to("speed=")
  end

  it "responds to .set_fast_speed" do
    Browser.should respond_to("set_fast_speed")
  end

  it "responds to .set_slow_speed" do
    Browser.should respond_to("set_slow_speed")
  end

  it "responds to .attach_timeout" do
    Browser.should respond_to("attach_timeout")
  end

  it "responds to .attach_timeout=" do
    Browser.should respond_to("attach_timeout=")
  end

  it "responds to .reset_attach_timeout" do
    Browser.should respond_to("reset_attach_timeout")
  end

  it "responds to .visible" do
    Browser.should respond_to("visible")
  end

  it "responds to .each" do
    Browser.should respond_to("each")
  end

  it "responds to .quit" do
    Browser.should respond_to("quit")
  end

  it "responds to .start" do
    Browser.should respond_to("start")
  end

  # Instance methods
  it "responds to #visible" do
    browser.should respond_to("visible")
  end

  it "responds to #visible=" do
    browser.should respond_to("visible=")
  end

  it "responds to #wait" do
    browser.should respond_to("wait")
  end

  describe "#bring_to_front" do
    it "returns true" do
      browser.bring_to_front.should be_true
    end
  end

  describe "#checkBox" do
    it "behaves like #checkbox" do
      browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
      browser.checkbox(:id, "new_user_interests_books").should exist
      browser.checkbox(:id, "new_user_interests_cars").should_not be_set
      browser.checkbox(:id, "new_user_interests_cars").set
      browser.checkbox(:id, "new_user_interests_cars").should be_set
    end
  end

end

describe "Button" do

  before :each do
    browser.goto(WatirSpec.host + "/forms_with_input_elements.html")
  end

  describe "#click_no_wait" do
    it "behaves like #click" do
      browser.button(:id, 'new_user_submit').click_no_wait
      browser.text.should include("You posted the following content:")
    end
  end

end

describe "Link" do

  before :each do
    browser.goto(WatirSpec.host + "/non_control_elements.html")
  end

  describe "#click_no_wait" do
    it "behaves like #click" do
      browser.link(:text, "Link 3").click_no_wait
      browser.text.include?("User administration").should be_true
    end
  end

end

describe "Image" do

  before :each do
    browser.goto(WatirSpec.files + "/images.html")
  end

  describe "#hasLoaded?" do
    it "behaves like #loaded?" do
      browser.image(:name, 'circle').hasLoaded?.should be_true
    end
  end

  describe "#has_loaded?" do
    it "behaves like #loaded" do
      browser.image(:name, 'circle').has_loaded?.should be_true
    end
  end

  describe "#fileSize" do
    it "behaves like #file_size" do
      browser.image(:id, 'square').fileSize.should == 788
    end
  end

  describe "#fileCreatedDate" do
    it "behaves like #file_created_date" do
      browser.goto(WatirSpec.host + "/images.html")
      image = browser.image(:index, 2)
      path = File.dirname(__FILE__) + "/html/#{image.src}"
      image.file_created_date.to_i.should == File.mtime(path).to_i
    end
  end

end

describe "RadioCheckCommon" do

  before :each do
    browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
  end

  describe "#is_set?" do
    it "behaves like #set?" do
      browser.radio(:id, "new_user_newsletter_yes").is_set?.should be_true
    end
  end

  describe "#isSet?" do
    it "behaves like #set?" do
      browser.radio(:id, "new_user_newsletter_yes").isSet?.should be_true
    end
  end

  describe "#get_state" do
    it "behaves like #set?" do
      browser.checkbox(:id, "new_user_interests_books").get_state.should be_true
    end
  end

  describe "#getState" do
    it "behaves like #set?" do
      browser.checkbox(:id, "new_user_interests_books").getState.should be_true
    end
  end

end

describe "SelectList" do

  before :each do
    browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
  end

  describe "#getSelectedItems" do
    it "behaves like #selected_options" do
      browser.select_list(:name, "new_user_country").getSelectedItems.should == ["Norway"]
      browser.select_list(:name, "new_user_languages").getSelectedItems.should == ["English", "Norwegian"]
    end
  end<commit_msg>Remove non-existent methods from watir_compatibility_spec<commit_after># encoding: utf-8
require File.dirname(__FILE__) + '/spec_helper'

describe "IE" do

  # Class methods
  it "responds to .speed" do
    Browser.should respond_to("speed")
  end

  it "responds to .speed=" do
    Browser.should respond_to("speed=")
  end

  it "responds to .attach_timeout" do
    Browser.should respond_to("attach_timeout")
  end

  it "responds to .attach_timeout=" do
    Browser.should respond_to("attach_timeout=")
  end

  it "responds to .visible" do
    Browser.should respond_to("visible")
  end

  it "responds to .each" do
    Browser.should respond_to("each")
  end

  it "responds to .start" do
    Browser.should respond_to("start")
  end

  # Instance methods
  it "responds to #visible" do
    browser.should respond_to("visible")
  end

  it "responds to #visible=" do
    browser.should respond_to("visible=")
  end

  it "responds to #wait" do
    browser.should respond_to("wait")
  end

  describe "#bring_to_front" do
    it "returns true" do
      browser.bring_to_front.should be_true
    end
  end

  describe "#checkBox" do
    it "behaves like #checkbox" do
      browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
      browser.checkbox(:id, "new_user_interests_books").should exist
      browser.checkbox(:id, "new_user_interests_cars").should_not be_set
      browser.checkbox(:id, "new_user_interests_cars").set
      browser.checkbox(:id, "new_user_interests_cars").should be_set
    end
  end

end

describe "Button" do

  before :each do
    browser.goto(WatirSpec.host + "/forms_with_input_elements.html")
  end

  describe "#click_no_wait" do
    it "behaves like #click" do
      browser.button(:id, 'new_user_submit').click_no_wait
      browser.text.should include("You posted the following content:")
    end
  end

end

describe "Link" do

  before :each do
    browser.goto(WatirSpec.host + "/non_control_elements.html")
  end

  describe "#click_no_wait" do
    it "behaves like #click" do
      browser.link(:text, "Link 3").click_no_wait
      browser.text.include?("User administration").should be_true
    end
  end

end

describe "Image" do

  before :each do
    browser.goto(WatirSpec.files + "/images.html")
  end

  describe "#hasLoaded?" do
    it "behaves like #loaded?" do
      browser.image(:name, 'circle').hasLoaded?.should be_true
    end
  end

  describe "#fileSize" do
    it "behaves like #file_size" do
      browser.image(:id, 'square').fileSize.should == 788
    end
  end

  describe "#fileCreatedDate" do
    it "behaves like #file_created_date" do
      browser.goto(WatirSpec.host + "/images.html")
      image = browser.image(:index, 2)
      path = File.dirname(__FILE__) + "/html/#{image.src}"
      image.file_created_date.to_i.should == File.mtime(path).to_i
    end
  end

end

describe "RadioCheckCommon" do

  before :each do
    browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
  end

  describe "#isSet?" do
    it "behaves like #set?" do
      browser.radio(:id, "new_user_newsletter_yes").isSet?.should be_true
    end
  end

  describe "#getState" do
    it "behaves like #set?" do
      browser.checkbox(:id, "new_user_interests_books").getState.should be_true
    end
  end

end

describe "SelectList" do

  before :each do
    browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
  end

  describe "#getSelectedItems" do
    it "behaves like #selected_options" do
      browser.select_list(:name, "new_user_country").getSelectedItems.should == ["Norway"]
      browser.select_list(:name, "new_user_languages").getSelectedItems.should == ["English", "Norwegian"]
    end
  end
{'fraction_non_alphanumeric': 0.11117928580193889, 'fraction_numerical': 0.0014725733218799854, 'mean_word_length': 3.5052515201768935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2482508', 'n_tokens_mistral': 2809, 'n_tokens_neox': 2657, 'n_words': 674}