<commit_before>require 'smoke_spec_helper.rb'
require 'uri'

include Rails.application.routes.url_helpers

describe 'Petition page' do
  it 'should allow users to sign' do
    petition = create_a_petition
    go_to petition_path(petition)

    if (element :id => 'yes_i_want_to_sign')
      click :id => 'yes_i_want_to_sign'
      wait.until { element :id => 'signature_name' }
    end

    type('bob').into(:id => 'signature_name')
    type('<EMAIL>').into(:id => 'signature_email')
    click :id => 'sign_petition'
  
    wait.until { element :class => "thanks" }<commit_msg>add check for element.display? in failing test<commit_after>require 'smoke_spec_helper.rb'
require 'uri'

include Rails.application.routes.url_helpers

describe 'Petition page' do
  it 'should allow users to sign' do
    petition = create_a_petition
    go_to petition_path(petition)

    yes_please = element :id => 'yes_i_want_to_sign'
    if (yes_please && yes_please.displayed?)
      click :id => 'yes_i_want_to_sign'
      wait.until { element :id => 'signature_name' }
    end

    type('bob').into(:id => 'signature_name')
    type('<EMAIL>').into(:id => 'signature_email')
    click :id => 'sign_petition'
  
    wait.until { element :class => "thanks" }
{'fraction_non_alphanumeric': 0.12983870967741937, 'fraction_numerical': 0.0, 'mean_word_length': 3.964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '5807030', 'n_tokens_mistral': 428, 'n_tokens_neox': 408, 'n_words': 97}