Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To accomplish the previously proffered answer using Webrat, you can do the following e.g. in your Cucumber env.rb:</p> <pre><code>require 'webrat' Webrat.configure do |config| config.mode = :mechanize end World do session = Webrat::Session.new session.extend(Webrat::Methods) session.extend(Webrat::Matchers) session.visit 'http://yoursite/yourbasepath/' session end </code></pre> <p>To make it more robust, such as for use in different environments, you could do:</p> <pre><code>ENV['CUCUMBER_HOST'] ||= 'yoursite' ENV['CUCUMBER_BASE_PATH'] ||= '/yourbasepath/' # Webrat require 'webrat' Webrat.configure do |config| config.mode = :mechanize end World do session = Webrat::Session.new session.extend(Webrat::Methods) session.extend(Webrat::Matchers) session.visit('http://' + ENV['CUCUMBER_HOST'] + ENV['CUCUMBER_BASE_PATH']) session end </code></pre> <p>Note that if you're using Mechanize, Webrat will also fail to follow your redirects because it won't interpret the current host correctly. To work around this, you can add <code>session.header('Host', ENV['CUCUMBER_HOST'])</code> to the above.</p> <p>To make sure the right paths are being used everywhere for visiting and matching, add <code>ENV['CUCUMBER_BASE_PATH'] +</code> to the beginning of your paths_to method in paths.rb, if you use it. It should look like this:</p> <pre><code> def path_to(page_name) ENV['CUCUMBER_BASE_PATH'] + case page_name </code></pre> <p>Apologies if anyone got a few e-mails from this -- I originally tried to post as a comment and Stack Overflow's irritating UI got the better of me.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload