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

describe "Browser" do

  describe "#exists?" do
    it "returns true if we are at a page" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.should exist
    end

    it "returns false after IE#close" do
      b = WatirSpec.new_browser
      b.close
      b.should_not exist
    end
  end

  describe "#html" do
    it "returns the html of the page" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.html.should == File.read(File.dirname(__FILE__) + "/html/non_control_elements.html")
    end
  end

  describe "#title" do
    it "returns the current page title" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.title.should == "Non-control elements"
    end
  end

  describe "#status" do
    it "returns the current value of window.status" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.execute_script "window.status = 'All done!';"
      browser.status.should == "All done!"<commit_msg>Add comment about window.status in Firefox<commit_after># encoding: utf-8
require File.dirname(__FILE__) + '/spec_helper'

describe "Browser" do

  describe "#exists?" do
    it "returns true if we are at a page" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.should exist
    end

    it "returns false after IE#close" do
      b = WatirSpec.new_browser
      b.close
      b.should_not exist
    end
  end

  describe "#html" do
    it "returns the html of the page" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.html.should == File.read(File.dirname(__FILE__) + "/html/non_control_elements.html")
    end
  end

  describe "#title" do
    it "returns the current page title" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.title.should == "Non-control elements"
    end
  end

  describe "#status" do
    it "returns the current value of window.status" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")

      # for firefox, this needs to be enabled in 
      # Preferences -> Content -> Advanced -> Change status bar text
      browser.execute_script "window.status = 'All done!';"
      browser.status.should == "All done!"
{'fraction_non_alphanumeric': 0.10552975939214859, 'fraction_numerical': 0.0008442380751371887, 'mean_word_length': 3.044368600682594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '864440', 'n_tokens_mistral': 728, 'n_tokens_neox': 703, 'n_words': 209}