Module: Appom

Defined in:
lib/appom.rb,
lib/appom/page.rb,
lib/appom/wait.rb,
lib/appom/section.rb,
lib/appom/version.rb,
lib/appom/element_finder.rb,
lib/appom/element_container.rb

Defined Under Namespace

Modules: ElementContainer, ElementFinder Classes: InvalidElementError, NoSuchElementError, Page, Section, TimeoutError, UnsupportedBlockError, Wait

Constant Summary collapse

VERSION =
'0.7.2'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.driverObject

Returns the value of attribute driver.



25
26
27
# File 'lib/appom.rb', line 25

def driver
  @driver
end

.max_wait_timeObject

Returns the value of attribute max_wait_time.



26
27
28
# File 'lib/appom.rb', line 26

def max_wait_time
  @max_wait_time
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Configure appom

Yields:

  • (_self)

Yield Parameters:

  • _self (Appom)

    the object that the method was called on



29
30
31
# File 'lib/appom.rb', line 29

def configure
  yield self
end

.register_driver(&block) ⇒ Appium::Driver

Register a new appium driver for Appom.

Returns:

  • (Appium::Driver)

    A appium driver instance



35
36
37
38
# File 'lib/appom.rb', line 35

def register_driver(&block)
  @driver = block.call()
  setup_exit_handler
end

.reset_driverObject

Reset the device, relaunching the application.



46
47
48
# File 'lib/appom.rb', line 46

def reset_driver
  @driver.reset
end

.setup_exit_handlerObject

After run all scenario and exit we will quit driver to close appliction under test



51
52
53
54
55
56
# File 'lib/appom.rb', line 51

def setup_exit_handler
  main = Process.pid
  at_exit do
    @driver.driver_quit if Process.pid == main
  end
end

.start_driverObject

Creates a new global driver and quits the old one if it exists.



41
42
43
# File 'lib/appom.rb', line 41

def start_driver
  @driver.start_driver
end