Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

168 lines (114 sloc) 3.26 kB

Web Testing Howto

What is what

Either

or

Helpful links

Testing with Chrome

Spacewalk only serves through https but Chrome blocks since the certificate is unknown.

Chrome does not offer a certificate import but shares the vault with Firefox. So use Firefox to import the certificate.

Alternative: wiki.cacert.org/BrowserClients#Linux

Required packages

  • rubygem-cucumber

  • rubygem-rspec

  • rubygem-term-ansicolor

  • rubygem-treetop

  • rubygem-diff-lcs

  • rubygem-hpricot

  • rubygem-capybara

Either:

  • rubygem-selenium-webdriver

or

Directory layout

Rakefile
features/
  foo.feature
  bar.feature
  ...
  support/
    env.rb - setup environment
    other_helpers.rb
    ...
  step_definitions/
    domain_concept_a.rb
    domain_concept_b.rb
    ...

Rakefile

require 'rubygems'
require 'cucumber/rake/task'

Cucumber::Rake::Task.new

# Cucumber::Rake::Task.new do |t|
# t.cucumber_opts = %w{--format pretty}
# end

require "selenium-webdriver"
Selenium::WebDriver.for :chrome

Issues

Features

Feature: what is it about
  In order
  As
  I want

  Background:
    Given... (common init for all scenarios)

  @tag
  Scenario: this gets executed, see step_definitons/
    Given
    When
    (And)
    Then
    (And)
    (But)

Running

/usr/bin/cucumber [<features/foo.feature>[:<line_number_of_scenario>]]

run whats in progress
  cucumber --wip

run tests tagged with @proposed
  cucumber --tags @proposed

run tests not in progress
  cucumber --tags ~@wip --strict

rake features
rake -T cucumber
rake cucumber:wip
rake cucumber
rake cucumber:ok

Tags

 @wip - work in progress
 @javascript - use a JavaScript-supporting simulator
   defaults to Selenium (starts Browser)
 @culerity - use Culerity (no Browser)
 @selenium - explictly request Selenium
 @rack_test
 @proposed

* http://openmonkey.com/articles/2010/04/javascript-testing-with-cucumber-capybara

Step

use Rspec, Test::Unit, …

Other tools

Jump to Line
Something went wrong with that request. Please try again.