<commit_before>require File.expand_path("../spec_helper", __FILE__)

describe "Timeouts", :focus => true do

  context "implicit waits" do
    before do
      driver.manage.timeouts.implicit_wait = 0
      driver.navigate.to url_for("dynamic.html")
    end

    after { driver.manage.timeouts.implicit_wait = 0 }

    it "should implicitly wait for a single element" do
      driver.manage.timeouts.implicit_wait = 3

      driver.find_element(:id => 'adder').click
      driver.find_element(:id => 'box0')
    end

    it "should still fail to find an element with implicit waits enabled" do
      driver.manage.timeouts.implicit_wait = 0.5
      lambda { driver.find_element(:id => "box0") }.should raise_error(WebDriver::Error::NoSuchElementError)
    end

    it "should return after first attempt to find one after disabling implicit waits" do
      driver.manage.timeouts.implicit_wait = 3
      driver.manage.timeouts.implicit_wait = 0<commit_msg>JariBakken: Remove accidental :focus<commit_after>require File.expand_path("../spec_helper", __FILE__)

describe "Timeouts" do

  context "implicit waits" do
    before do
      driver.manage.timeouts.implicit_wait = 0
      driver.navigate.to url_for("dynamic.html")
    end

    after { driver.manage.timeouts.implicit_wait = 0 }

    it "should implicitly wait for a single element" do
      driver.manage.timeouts.implicit_wait = 3

      driver.find_element(:id => 'adder').click
      driver.find_element(:id => 'box0')
    end

    it "should still fail to find an element with implicit waits enabled" do
      driver.manage.timeouts.implicit_wait = 0.5
      lambda { driver.find_element(:id => "box0") }.should raise_error(WebDriver::Error::NoSuchElementError)
    end

    it "should return after first attempt to find one after disabling implicit waits" do
      driver.manage.timeouts.implicit_wait = 3
      driver.manage.timeouts.implicit_wait = 0
{'fraction_non_alphanumeric': 0.09712793733681462, 'fraction_numerical': 0.009399477806788513, 'mean_word_length': 3.445475638051044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '3135070', 'n_tokens_mistral': 611, 'n_tokens_neox': 559, 'n_words': 154}