Code Monkey home page Code Monkey logo

mainline's Introduction

mainline

DESCRIPTION:

Mainline is a rails plugin which exposes your rails app via webrick to allow testing with browser automators such as Selenium or Watir. Mainline allows your rails actions to run in the same transaction as your unit tests so you can use fixtures, factories, or whatever.

SYNOPSIS:

Currently mainline only supports one integration session at a time.

To install it as a plugin:

script/plugins install git://github.com/gaffo/mainline.git

And to enable it you need to do a:

Mainline.enable, or the block form (if you need to configure things).

For example, to enable Mainline and specify a port:

Webrat.configure do |config|
  config.mode = :rails
  config.open_error_files = false # Set to true if you want error pages to pop up in the browser
  Mainline.enable { |config| config.port = 3030 }
end

When using webrat, it’s best to do somthing like this if you are just running selenium.

Webrat.configure do |config|
  config.application_framework = :external
  Mainline.enable
end

However if you need to run in selenium and non selenium and need to configure ports (for build boxes), you should use somthing like this (pulled from my own config):

Webrat.configure do |config|
  if ENV['WEBRAT_INTEGRATION_MODE'] == 'selenium'
  	config.mode = :selenium
    config.application_framework = :external
    config.application_port = ENV['WEBRAT_APPLICATION_PORT'] || 3001
    config.selenium_server_port = ENV['WEBRAT_SELENIUM_PORT'] || 4444
    Mainline.enable do |mainline_config|
      mainline_config.port = ENV['WEBRAT_APPLICATION_PORT'] || 3001
    end
  else
  	config.mode = :rails
  end
end

INSTALL:

via gem:

gem install mainline
script/generate mainline

via plugin

script/plugin install git://github.com/gaffo/mainline.git
script/generate mainline

mainline's People

Contributors

drnic avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.