0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Unobtainium wraps Selenium and Appium in a simple driver abstraction so that test code can more easily cover desktop browsers, mobile browsers and mobile apps. Some additional useful functionality for the maintenance of test suites is also added.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 11.3
~> 3.7
~> 0.16
>= 0.9.12, ~> 0.9

Runtime

 Project Readme

unobtainium

Obtain the unobtainable: test code covering multiple platforms

Unobtainium wraps Selenium and Appium in a simple driver abstraction so that test code can more easily cover:

  • Desktop browsers
  • Mobile browsers
  • Mobile apps

The gem also wraps PhantomJS for headless testing.

Some additional useful functionality for the maintenance of test suites is also added.

Gem Version Build status

Usage

You can use unobtainium on its own, or use it as part of a cucumber test suite.

Unobtainium Demonstration

Unobtainium's functionality is in standalone classes, but it's all combined in the Unobtainium::World module.

  • The Runtime class is a singleton and a Hash-like container (but simpler), that destroys all of its contents at the end of a script, calling custom destructors if required. That allows for clean teardown and avoids everything having to implement the Singleton pattern itself.

  • The Driver class, of course, wraps either of Appium or Selenium drivers:

    drv = Driver.create(:firefox) # uses Selenium and Firefox
    drv = Driver.create(:android) # uses Appium (browser or device)
    drv = Driver.create(:phantomjs) # use Selenium and PhantomJS
    
    drv.navigate.to "..." # delegates to Selenium or Appium

See the documentation on configuration features for details on configuration.

World

The World module combines all of the above by providing a simple entry point for everything:

  • World.config_file can be set to the path of a config file to be loaded, defaulting to config/config.yml.
  • World#config is a Config instance containing the above file's contents.
  • World#driver returns a Driver, initialized to the settings contained in the configuration file.

For a simple usage example of the World module, see the cuke subdirectory (used with cucumber).

Configuration File

The configuration file knows two configuration variables:

  • driver is expected to be a string, specifying the driver to use as if it was passed to Driver.create (see above), e.g. "android", "chrome", etc.
  • drivers (note the trailing s) is a Hash. Under each key you can nest an options hash you might otherwise pass to Driver.create as the second parameter.

See the documentation on configuration features for details.

Development

Additional Drivers

Driver Modules

Integrations

  • unobtainium-cucumber integrates with cucumber, specifically providing some convenient functionality such as automatic screenshot taking on failures.

Credits

This gem is inspired by LapisLazuli, but vastly less complex, and aims to stay so.