Logo: Relish

  1. Sign in

Project: Riverglide-website 2011-07-20_09-50-34_UTC

behind the scenes

These cucumber features use cukesalad, a cucumber extension, that helps us focus on expressions of our intent rather than regular expressions.

All of these examples can be executed headlessly or via a web browser (which you can see in this video)

CukeSalad replaces the concept of step-definitions with tasks. Tasks are also written in ruby.

For a given task there are one or more actions (or interactions) required to complete it.

Below you will find some examples of the tasks that are behind the scenarios you can see in this project.

visit us

in_order_to 'visit us' do
  raise "The RiverGlide visitor should start at the home page" unless current_location == :home_page
end

see you are at a place called 'some name'

in_order_to 'see you are at a place called' do
  read_the :title, :text
end

see the company logo

in_order_to 'see the company logo' do
  look_for_a :company_logo, :image
end

see a testimonial from a RiverGlide customer'

in_order_to 'see a testimonial from a RiverGlide customer' do
  we_are_going_to Check::Content

  testimonial_displayed = {
    quotation: ( ignoring_the_quotes read_the :quotation, :text ),
    quotee:    ( read_the :quotee, :text )
  }

  you_should_see_a_valid testimonial_displayed, (see_choices_in 'views/testimonials.yml')
end

find that you can email us on 'some email'

in_order_to 'find that you can email us at' do
  we_are_going_to Check::EmailLinks

  our_email = {
    address: ( read_the :email_contact, :text ),
    link:    ( value_of_the :email_contact, :href )
  }

  our_email[ :link ].should be_an_email_link_to our_email[ :address ] 

  you_see our_email[ :address ]
end

find that you can call us on 'some phone number'

in_order_to 'find that you can call us on' do
  read_the :contact_number, :text
end

Last published over 6 years ago by RiverGlide.