Skip to content

surzycki/turnip-steps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turnip::Steps

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/turnip/steps. To experiment with that code, run bin/console for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

Installation

Add this line to your application's Gemfile:

gem 'turnip-steps'

And then execute:

$ bundle

Or install it yourself as:

$ gem install turnip-steps

Usage

:field should contain ids only

I fill in 'form_firstname' with 'Bob'

Email Steps

I open an email sent to :recipient
I open an email sent to :recipient with subject :subject
I click :id in the email
the email should (not) contain :content
the email should (not) have an attachment :attachment
the email should (not) have an attachment :attachment with index :index
take a screenshot of the email

For capybara to be able to click links in the email you'll need to set:

Capybara.server_port  = 3001
Capybara.app_host     = "http://#{ENV['YOUR_HOST']}:3001"

config/environments/test.rb

config.action_mailer.default_url_options = { host: ENV['YOUR_HOST'], port: 3001 }

Form Steps

I fill in :field with :value
I select :value from :field
I attach the file :file to :field
:field field should (not) have the value :value
:field field should (not) contain value :value

file Should be located in spec/fixtures/

Job Steps

Model Steps

Page Steps

I goto the :path page
I goto the :path page with :parameter set to :value
I goto the path: :path
I should (not) be on the :path page
I click on :id
I click on the :element element
I click on the text :text
I should (not) see :content
the page should (not) have a(n) :page_element element
I reload the page

Helper Steps

I debug
take a screenshot
I clear cookies
I wait :value seconds

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/turnip-steps.

About

Some helpful turnip steps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published