TestStack

Build your app Anywhere, just Break them Here

This is Testing Framework based on BDD principles in Ruby,used for manual test design, automated functional testing of products across Web, Mobile and API's and maintaining their live documentation open for everyone.

Build Status Code Climate Test Coverage Issue Count

How to Run Tests

From the project root directory
To run with for specific application

$cucumber DRIVER=<driver_name> APP=<app_type> SERVER=<server_name>

(Eg :to run only central tests on chrome browser over release server)

$cucumber DRIVER=chrome APP=web SERVER=https://example.com -p central

DRIVER can be firefox, chrome, poltergeist(headless) ,appium [we are working on IE ]
APP can be web or native for Android and iOS native apps, default is web SERVER can be any backend api server

profile can be any of the below

  1. api :run all api tests
  2. web :run all central tests
  3. android :run all consumer android app tests
  4. ios :run all consumer ios app tests
  5. production :run production tests on production
  6. deploy :run post deployment tests
  7. pending :run tests with pending implementation

OR if you want to run a single feature only

$cucumber DRIVER=poltergeist SERVER=https://api.example.com features/<feature_name>.feature

OR if you want to run all features with report

$cucumber DRIVER=<driver_name> SERVER=<server_name> --format html --out report.html

if you want to run all features with console output of test results

$cucumber DRIVER=<driver_name> SERVER=<server_name> --format pretty

OR For Lazy Forks we have rake tasks
1.to run all features for for production ci

$rake prodci

2.to run central tests

$rake web

3.to run pos android app tests

$rake android

Generate documentation using YARD

$bundle exec yard

Test cases documentation

$cucumber -d --format html --out report.html --format pretty

Generate Test Documents online with viewer

To deploy viewer locally

1.make sure mongo db is installed and running brew install mongodb

start mongodb by running ,

$mongod

2.start the sinatra server

$rake serve_viewer

3.push features into database

$rake push_viewer

viewer will run at as localhost:4567/projects.tinyowl

4.push features into database

$rake drop_viewer

To deploy viewer sinatra app on server

1.start unicorn server as a deamon ,it will start on port 8080

$unicorn -c unicorn.rb -D

2.push features into database

$rake push_viewer 8080

3.push features into database

$rake drop_viewer 8080

viewer will run at as http:///projects/test

Pre-requisite and How to Setup

1.Install Ruby on mac /ubuntu

Install the latest stable release of Ruby.

$\curl -sSL https://get.rvm.io | bash -s stable
$rvm install ruby

Make sure rvm is using the correct ruby by default

$rvm list
$rvm --default use 2.2.0

If you have an old ruby/rvm, you can upgrade with

$rvm get head
$rvm autolibs homebrew
$rvm install ruby

Check that it’s installed properly by printing the ruby version.

$ruby --version

Update RubyGems and Bundler.

$gem update --system
$gem install --no-rdoc --no-ri bundler
$gem update
$gem cleanup
$gem install bundler

clone the repo and run bundle install ,all dependencies will be added

$git clone
$cd
$bundle install

2.For Poltergeist, On Mac : Use HomeBrew ,MacPort installation is not recommended

$brew install phantomjs

On Ubuntu,you use below command

$sudo apt-get install phantomjs

3.For Chromedriver

$gem install chromedriver

4.For Appium

Install appium_console gem.

$gem uninstall -aIx appium_lib
$gem uninstall -aIx appium_console
$gem install --no-rdoc --no-ri appium_console

Install flaky gem.

$gem uninstall -aIx flaky
$gem install --no-rdoc --no-ri flaky

Install nodejs using brew.

$brew update
$brew upgrade node
$brew install node

Node should be v0.10.26 or better

Install grunt.

$npm install -g grunt grunt-cli

Install ant . Install maven 3.1.1. Old maven will not work.

Clone appium

$git clone git://github.com/appium/appium.git
$cd appium; ./reset.sh

to reset for a specific version and verbose logging

$cd appium ;./reset.sh --android --verbose

now start appium.

$node .

Library documentation

1.Appium
http://www.rubydoc.info/github/appium/ruby_lib/Appium/
2.Capybara
http://www.rubydoc.info/github/jnicklas/capybara/master
3.SitePrism
http://www.rubydoc.info/gems/site_prism/frames
4.Poltergeist
https://github.com/teampoltergeist/poltergeist
5.Cucumber
http://www.rubydoc.info/github/cucumber/cucumber-ruby/
https://github.com/cucumber/cucumber/wiki

Troubleshooting

1.Appium installation issues

When using Appium.app make sure to set Appium -> Preferences… -> Check “Use External Appium Package” and set it to the path of Appium cloned from GitHub.

Fix permission errors. npm shouldn’t require sudo.

$brew uninstall node
$brew install node
$rm -rf ./node_modules
$rm -rf "/Users/`whoami`/.npm"
$rm -rf /usr/local/lib/node_modules/
$./reset.sh --ios
$./reset.sh --android

If you see config errors, try cleaning git.

$git clean -dfx; git reset --hard

How to add Tests

Wiki

Repo Owner

irfan ahmad, irfan@critisizer.com

Contributing