Giter Site home page Giter Site logo

furter's Introduction

Furter

Build Status Coverage Status

A gem to assist in building page-object like structures for testing iOS applications. furter uses frank-cucumber to automate iOS applications using page-objects.

Installation

Add this line to your application's Gemfile:

source 'https://rubygems.org'
gem 'furter'

And then execute:

$ bundle

Setting Up Cucumber

After your Gemfile has been updated, add these lines to your features/support/env.rb file in cucumber:

require 'furter'
require 'rspec-expectations'

World(Furter::Navigation)

APP_BUNDLE_PATH = File.expand_path( '../../../Frank/frankified_build/YourApp.app', __FILE__ )

Frank::Cucumber::FrankHelper.use_shelley_from_now_on

Before do
  version = '6.1'
  idiom = 'iPhone'
  
  launch_app APP_BUNDLE_PATH, version, idiom
end

Defining Screens

Simply create a new class that describes the screen that you are working with and include Furter.

class LoginScreen
  include Furter
  
  text(:username, :label => 'usernameField')
  text(:password, :label => 'passwordField')
  button(:login, :text => 'Login')
end

In your step definition, use the Furter::Navigation#on method when using your page-object. This method will create your screen and then wait until all animations have stopped before letting you interact with your page-object.

When ^I login to my application$ do
  on(LoginScreen) do |screen|
    screen.username = '[email protected]'
    screen.password = '$3cr3t`
    screen.login
  end
end

Waiting for Screens

If you would like for furter to wait until your screen becomes "active" (perhaps after some asynchronous call has come back), simply define an active? method and furter will wait until this returns true before interacting with it.

class LandingScreen
  include Furter
  
  def active?
    has_text? 'You have successfully logged in!'
  end
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.