Module: Appom
- Defined in:
- lib/appom.rb,
lib/appom/page.rb,
lib/appom/version.rb,
lib/appom/element_container.rb
Defined Under Namespace
Modules: ElementContainer Classes: InvalidElementError, Page, UnsupportedBlockError
Constant Summary collapse
- VERSION =
'0.3.0'.freeze
Class Attribute Summary collapse
-
.driver ⇒ Object
Returns the value of attribute driver.
Class Method Summary collapse
-
.register_driver(&block) ⇒ Appium::Driver
Register a new appium driver for Appom.
-
.reset_driver ⇒ Object
Reset the device, relaunching the application.
-
.setup_exit_handler ⇒ Object
After run all scenario and exit we will quit driver to close appliction under test.
-
.start_driver ⇒ Object
Creates a new global driver and quits the old one if it exists.
Class Attribute Details
.driver ⇒ Object
Returns the value of attribute driver.
17 18 19 |
# File 'lib/appom.rb', line 17 def driver @driver end |
Class Method Details
.register_driver(&block) ⇒ Appium::Driver
Register a new appium driver for Appom.
21 22 23 24 |
# File 'lib/appom.rb', line 21 def register_driver(&block) @driver = block.call() setup_exit_handler end |
.reset_driver ⇒ Object
Reset the device, relaunching the application.
32 33 34 |
# File 'lib/appom.rb', line 32 def reset_driver @driver.reset end |
.setup_exit_handler ⇒ Object
After run all scenario and exit we will quit driver to close appliction under test
37 38 39 40 41 42 |
# File 'lib/appom.rb', line 37 def setup_exit_handler main = Process.pid at_exit do @driver.driver_quit if Process.pid == main end end |
.start_driver ⇒ Object
Creates a new global driver and quits the old one if it exists.
27 28 29 |
# File 'lib/appom.rb', line 27 def start_driver @driver.start_driver end |