<commit_before>require_relative "helpers/paypal_helper"

HOSTNAME = `hostname`.chomp
PORT = 4567

describe "Drop-in" do
  include PayPal

  before :each do
    visit "http://#{HOSTNAME}:#{PORT}"
  end

  # it "tokenizes a card" do
  #   click_on('Card')
  #
  #   find('label[for="credit-card-number"]').click()
  #   find('iframe[name="braintree-hosted-field-number"]').send_keys('4111111111111111')
  #
  #   find('label[for="expiration"]').click()
  #   find('iframe[name="braintree-hosted-field-expirationDate"]').send_keys('12' + (Time.new.year + 2).to_s[-2..-1])
  #
  #   click_button('Pay')
  #
  #   # Drop-in Details
  #   expect(page).to have_content('Ending in ••11')
  #
  #   # Nonce Details<commit_msg>Explain why tokenizes a card is commented<commit_after>require_relative "helpers/paypal_helper"

HOSTNAME = `hostname`.chomp
PORT = 4567

describe "Drop-in" do
  include PayPal

  before :each do
    visit "http://#{HOSTNAME}:#{PORT}"
  end

  # TODO: Figure out how to focus to Hosted Fields in Drop-in.
  # it "tokenizes a card" do
  #   click_on('Card')
  #
  #   find('label[for="credit-card-number"]').click()
  #   find('iframe[name="braintree-hosted-field-number"]').send_keys('4111111111111111')
  #
  #   find('label[for="expiration"]').click()
  #   find('iframe[name="braintree-hosted-field-expirationDate"]').send_keys('12' + (Time.new.year + 2).to_s[-2..-1])
  #
  #   click_button('Pay')
  #
  #   # Drop-in Details
  #   expect(page).to have_content('Ending in ••11')
  #
  #   # Nonce Details
{'fraction_non_alphanumeric': 0.1822950819672131, 'fraction_numerical': 0.03540983606557377, 'mean_word_length': 3.8444444444444446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6325584', 'n_tokens_mistral': 613, 'n_tokens_neox': 569, 'n_words': 92}