<commit_before>class AutomationElementDSL
  def initialize selector
    raise 'initialize not implemented'
  end
  def click
    raise 'click not implemented'
  end
  def exists?
    raise 'exists? not implemented'
  end
  def set text
    raise 'set not implemented'
  end
end

class AutomationPageDSL
  def initialize world
    raise 'initialize not implemented'
  end
  def displayed?
    raise 'displayed? not implemented'
  end
  def tap x, y
    raise 'tap not implemented'
  end
  def await(wait_opts={})
    raise 'await not implemented'
  end
end

require 'calabash-android/cucumber'
class CalabashElementMethods < AutomationElementDSL
  include Calabash::Android::Operations
  attr_reader :selector
  def initialize selector
    @selector = selector
  end
  def click
    touch @selector
  end
  def exists?
    !query(@selector).empty?
  end
  def set text
    enter_text @selector,text
  end
  def method_missing(method, *args, &block)
    raise "CalabashMethods - Caught missing method => #{method.to_s}"
  end
end

require 'calabash-android/abase'
class CalabashPageMethods < AutomationPageDSL
  include Calabash::Android::Operations
  attr_accessor :world, :transition_duration
  def initialize(world)
    self.world = world
    self.transition_duration = 0.5
  end
  def trait
    raise "You should define a trait method or a title method" unless respond_to?(:title)
    "* marked:'#{self.title}'"
  end
  def displayed?
    element_exists(trait)
  end
  def page(clz, *args)
    clz.new(world, *args)
  end
  def tap x, y
    perform_action('click_on_screen', x, y)
  end
  def await(wait_opts={})
    wait_for_elements_exist([trait], wait_opts)
    self
  end<commit_msg>pushing calabash specific requirements into classes<commit_after>class AutomationElementDSL
  def initialize selector
    raise 'initialize not implemented'
  end
  def click
    raise 'click not implemented'
  end
  def exists?
    raise 'exists? not implemented'
  end
  def set text
    raise 'set not implemented'
  end
end

class AutomationPageDSL
  def initialize world
    raise 'initialize not implemented'
  end
  def displayed?
    raise 'displayed? not implemented'
  end
  def tap x, y
    raise 'tap not implemented'
  end
  def await(wait_opts={})
    raise 'await not implemented'
  end
end


class CalabashElementMethods < AutomationElementDSL
  require 'calabash-android/cucumber'
  include Calabash::Android::Operations
  attr_reader :selector
  def initialize selector
    @selector = selector
  end
  def click
    touch @selector
  end
  def exists?
    !query(@selector).empty?
  end
  def set text
    enter_text @selector,text
  end
  def method_missing(method, *args, &block)
    raise "CalabashMethods - Caught missing method => #{method.to_s}"
  end
end

class CalabashPageMethods < AutomationPageDSL
  require 'calabash-android/cucumber'
  include Calabash::Android::Operations
  attr_accessor :world, :transition_duration
  def initialize(world)
    self.world = world
    self.transition_duration = 0.5
  end
  def trait
    raise "You should define a trait method or a title method" unless respond_to?(:title)
    "* marked:'#{self.title}'"
  end
  def displayed?
    element_exists(trait)
  end
  def page(clz, *args)
    clz.new(world, *args)
  end
  def tap x, y
    perform_action('click_on_screen', x, y)
  end
  def await(wait_opts={})
    wait_for_elements_exist([trait], wait_opts)
    self
  end
{'fraction_non_alphanumeric': 0.07593457943925233, 'fraction_numerical': 0.0011682242990654205, 'mean_word_length': 3.6725784447476126, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1203179', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1076, 'n_words': 338}