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

describe "Frame" do

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

  it "handles crossframe javascript" do
    browser.frame(:id, "frame_1").text_field(:name, 'senderElement').value.should == 'send_this_value'
    browser.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'old_value'
    browser.frame(:id, "frame_1").button(:id, 'send').click
    browser.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'send_this_value'
  end

  not_compliant_on :watir do
    describe "#exist?" do
      it "returns true if the frame exists" do
        browser.frame(:id, "frame_1").should exist
        browser.frame(:id, /frame/).should exist
        browser.frame(:name, "frame1").should exist
        browser.frame(:name, /frame/).should exist
        browser.frame(:src, "frame_1.html").should exist
        browser.frame(:src, /frame_1/).should exist
        browser.frame(:class, "half").should exist
        browser.frame(:class, /half/).should exist
        browser.frame(:index, 1).should exist
        browser.frame(:xpath, "//frame[@id='frame_1']").should exist
      end

      it "returns true if the iframe exists" do
        browser.goto(WatirSpec.files + "/iframes.html")
        browser.frame(:id, "frame_1").should exist
        browser.frame(:id, /frame/).should exist
        browser.frame(:name, "frame1").should exist
        browser.frame(:name, /frame/).should exist
        browser.frame(:src, "frame_1.html").should exist
        browser.frame(:src, /frame_1/).should exist
        browser.frame(:class, "iframe").should exist
        browser.frame(:class, /iframe/).should exist
        browser.frame(:index, 1).should exist
        browser.frame(:xpath, "//iframe[@id='frame_1']").should exist
      end

      it "returns true if the element exists (default how = :name)" do
        browser.frame("frame1").should exist
        browser.goto(WatirSpec.files + "/iframes.html")
        browser.frame("frame1").should exist
      end

      it "returns the first frame if given no args" do
        browser.form.should exist
      end

      it "returns false if the frame doesn't exist" do
        browser.frame(:id, "no_such_id").should_not exist
        browser.frame(:id, /no_such_id/).should_not exist
        browser.frame(:name, "no_such_text").should_not exist<commit_msg>Fix typo<commit_after># encoding: utf-8
require File.expand_path('spec_helper', File.dirname(__FILE__))

describe "Frame" do

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

  it "handles crossframe javascript" do
    browser.frame(:id, "frame_1").text_field(:name, 'senderElement').value.should == 'send_this_value'
    browser.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'old_value'
    browser.frame(:id, "frame_1").button(:id, 'send').click
    browser.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'send_this_value'
  end

  not_compliant_on :watir do
    describe "#exist?" do
      it "returns true if the frame exists" do
        browser.frame(:id, "frame_1").should exist
        browser.frame(:id, /frame/).should exist
        browser.frame(:name, "frame1").should exist
        browser.frame(:name, /frame/).should exist
        browser.frame(:src, "frame_1.html").should exist
        browser.frame(:src, /frame_1/).should exist
        browser.frame(:class, "half").should exist
        browser.frame(:class, /half/).should exist
        browser.frame(:index, 1).should exist
        browser.frame(:xpath, "//frame[@id='frame_1']").should exist
      end

      it "returns true if the iframe exists" do
        browser.goto(WatirSpec.files + "/iframes.html")
        browser.frame(:id, "frame_1").should exist
        browser.frame(:id, /frame/).should exist
        browser.frame(:name, "frame1").should exist
        browser.frame(:name, /frame/).should exist
        browser.frame(:src, "frame_1.html").should exist
        browser.frame(:src, /frame_1/).should exist
        browser.frame(:class, "iframe").should exist
        browser.frame(:class, /iframe/).should exist
        browser.frame(:index, 1).should exist
        browser.frame(:xpath, "//iframe[@id='frame_1']").should exist
      end

      it "returns true if the element exists (default how = :name)" do
        browser.frame("frame1").should exist
        browser.goto(WatirSpec.files + "/iframes.html")
        browser.frame("frame1").should exist
      end

      it "returns the first frame if given no args" do
        browser.frame.should exist
      end

      it "returns false if the frame doesn't exist" do
        browser.frame(:id, "no_such_id").should_not exist
        browser.frame(:id, /no_such_id/).should_not exist
        browser.frame(:name, "no_such_text").should_not exist
{'fraction_non_alphanumeric': 0.1433778857837181, 'fraction_numerical': 0.007695423248278655, 'mean_word_length': 3.0953565505804312, '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': '5910705', 'n_tokens_mistral': 1513, 'n_tokens_neox': 1472, 'n_words': 342}