<commit_before>require 'splinter/capybara/form_completer'
require 'capybara/dsl'

module Splinter
  module Capybara
    # Additional actions for Capybara.
    module Actions
      # Take a screenshot of the current page
      #
      # name - The name of the screenshot. Uses the current time by default.
      def take_screenshot!(name = "#{Time.now.strftime('%Y%m%d%H%M%S%L')}")
        unless example.metadata[:js]
          warn "Screenshots can only be captured when an example is tagged with :js => true"
          return
        end

        if path = Splinter.screenshot_directory
          args = [File.join(path, "#{name}.png"), Splinter.screenshot_options].compact
          page.driver.render(*args)
          puts "Saved screenshot to #{file}"
        else<commit_msg>remove non existent file variable<commit_after>require 'splinter/capybara/form_completer'
require 'capybara/dsl'

module Splinter
  module Capybara
    # Additional actions for Capybara.
    module Actions
      # Take a screenshot of the current page
      #
      # name - The name of the screenshot. Uses the current time by default.
      def take_screenshot!(name = "#{Time.now.strftime('%Y%m%d%H%M%S%L')}")
        unless example.metadata[:js]
          warn "Screenshots can only be captured when an example is tagged with :js => true"
          return
        end

        if path = Splinter.screenshot_directory
          args = [File.join(path, "#{name}.png"), Splinter.screenshot_options].compact
          page.driver.render(*args)
          puts "Saved screenshot to #{args.first}"
        else
{'fraction_non_alphanumeric': 0.09760705289672544, 'fraction_numerical': 0.0, 'mean_word_length': 2.7126168224299065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2209047', 'n_tokens_mistral': 488, 'n_tokens_neox': 463, 'n_words': 139}