<commit_before>require File.expand_path('../../watirspec_helper', __FILE__)

describe 'Element' do

  describe '#visual_hash' do

    before :each do
      browser.url = fixture('boxes.html')
      @one = window.find_by_id('one');
      @two = window.find_by_id('two');
      @three = window.find_by_id('three');
      @four = window.find_by_id('four');
    end

    it 'returns a hash' do
      @one.visual_hash.length.should == 34
    end

    it 'returns identical hashes for visually identical elements' do
      @one.visual_hash.should == @three.visual_hash
    end

    it 'returns different hashes for visually different elements' do
      @one.visual_hash.should_not == @two.visual_hash
    end

    it 'returns correct hashes when querying several elements in sequence' do
      @one.visual_hash.should == @three.visual_hash
      @two.visual_hash.should == @four.visual_hash
      @one.visual_hash.should_not == @two.visual_hash
      @two.visual_hash.should_not == @three.visual_hash
    end
  end
end
<commit_msg>Added a few quadruple click tests<commit_after>require File.expand_path('../../watirspec_helper', __FILE__)

describe 'Element' do

  describe '#quadruple_click' do
    
    it 'clicks four times' do
      browser.url = fixture('onclick.html')
      window.find_by_tag('button').quadruple_click
      window.find_by_id('clicks').text.should == '4'
    end
    
    it 'selects a full paragraph' do
      browser.url = fixture('paragraphs.html')
      p = window.find_by_id('first')
      p.quadruple_click
      window.eval_js('var first = document.getElementById("first"); first.value.substr(first.selectionStart, first.selectionEnd - first.selectionStart)').to_s.should == p.text
    end
  end

  describe '#visual_hash' do

    before :each do
      browser.url = fixture('boxes.html')
      @one   = window.find_by_id('one');
      @two   = window.find_by_id('two');
      @three = window.find_by_id('three');
      @four  = window.find_by_id('four');
    end

    it 'returns a hash' do
      @one.visual_hash.length.should == 34
    end

    it 'returns identical hashes for visually identical elements' do
      @one.visual_hash.should == @three.visual_hash
    end

    it 'returns different hashes for visually different elements' do
      @one.visual_hash.should_not == @two.visual_hash
    end

    it 'returns correct hashes when querying several elements in sequence' do
      @one.visual_hash.should     == @three.visual_hash
      @two.visual_hash.should     == @four.visual_hash
      @one.visual_hash.should_not == @two.visual_hash
      @two.visual_hash.should_not == @three.visual_hash
    end
    
  end
  
end
{'fraction_non_alphanumeric': 0.11412429378531073, 'fraction_numerical': 0.0018832391713747645, 'mean_word_length': 3.0611620795107033, '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': '4211718', 'n_tokens_mistral': 880, 'n_tokens_neox': 825, 'n_words': 193}