No commit activity in last 3 years
No release in over 3 years
Calabash-ios UIKit extension provides convenient metaclasses for Calabash usage.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.4
~> 10.3
~> 0.27

Runtime

>= 0.9.169, ~> 0.9
 Project Readme

Gem Version Build Status Coverage Status Code Climate Dependency Status

calios-uikit-extension

Calabash-ios UIKit extension provides convenient metaclasses for Calabash usage.

You can utilise these classes in calabash-ios console as well as in your test automation code.

See similar extension for Calabash-android: calandroid-widget-extension

Installation

In your Gemfile:

gem 'calios-uikit-extension'

Install gem manually:

$ gem install calios-uikit-extension

Supported UIKit elements

Currently small subset of UIKit elements are supported. Supported UIKit elements are:

UIButton UICollectionView UICollectionViewCell UIKeyboardAutomatic UILabel UINavigationBar UISearchBar UISegmentedControl UISwitch UITableView UITableViewCell UITextField UIView UIWebView

Example use cases

Launch calabash-ios console (irb)

$ calabash-ios console

Load calios-uikit-extension

irb> require 'calios-uikit-extension'

Launch your application

irb> start_test_server_in_background

Execute some example Calabash and equivalent calios-uikit-extension commands

query('view')

UIView.query

query("view marked:'myId'")

UIView.query('myId')

query('label index:0', :text).first

UILabel.text

query('label index:1', :text).first

UILabel.text(1)

touch('button')

UIButton.touch

touch('button index:1')

UIButton.touch(1)

touch("button marked:'buttonId'")

UIButton.touch('buttonId')

flash("button marked:'buttonId'")

UIButton.flash('buttonId')

query('label', :font)

UILabel.property(:font)

query("button marked:'buttonId'", :currentTitle).first

UIButton.text('buttonId')

query('switch', :isOn).first.to_boolean

UISwitch.on?

query('tableViewCell').count

UITableViewCell.count

query('collectionView', numberOfItemsInSection:0).first

UICollectionView.number_of_items_in_section

query('collectionView', numberOfItemsInSection:1).first

UICollectionView.number_of_items_in_section(1)

scroll('collectionView', :left)

UICollectionView.scroll(:left)

scroll('tableView', :down)

UITableView.scroll(:down)

scroll_to_collection_view_item(1, 0, {scroll_position: :left})

UICollectionView.scroll_to_item(1, 0, :left)

See available methods for a certain metaclass

UIButton.help

Did you notice alias methods?

UIButton.help --> UIButton.h

UIButton.query --> UIButton.q

UIButton.flash --> UIButton.f

UIButton.property --> UIButton.prop --> UIButton.p

UIButton.touch --> UIButton.tap

Okay, I think you got the point. Time to utilise calios-uikit-extension methods in your test automation code now!

Run the tests

$ bundle

$ bundle exec rake

License

MIT