Commit Graph

177 Commits

Author SHA1 Message Date
Dylan Lacey 480d8530f9 Made aliasing conditional on Capybara version.
Actually referred to the method alias rather then the method.
2013-03-08 11:45:18 -08:00
Dylan Lacey 0beb2773ac Run tests only for the appropriate version of Capybara 2013-03-05 19:10:30 -08:00
Dylan Lacey d6765b1d03 Changed config tests to use higher precedence ENV configuration names for USERNAME and ACCESS_KEY.
Included SAUCE_USER_NAME in Config::ENVIRONMENT_VARIABLES to ensure it
gets reset after tests.
2013-02-26 19:25:53 -08:00
Daniël van de Burgt 08972004de add support for environment variables set by Jenkins CI 2013-01-18 14:40:42 -08:00
R. Tyler Croy 3e72def10a Refactor the sauce-connect code out into a separate sauce-connect.gem
This bumps the minor version across all gems to 2.3, due to the change in the
dependency structure. Chances are this isn't going to affect many folks, or at
least not enough to where I feel comfortable with a jump to 3.x

Fixes #102
2013-01-08 22:56:39 -08:00
JS Boulanger 408c73cee9 Bug fix: blocks should be routed through #handle_retry in Capybara driver 2012-12-13 15:08:12 -08:00
R. Tyler Croy 013641892e Update the major version a little bit to encompass the new API 2012-11-23 11:44:56 -08:00
R. Tyler Croy 945f5ed636 Implement Sauce::Capybara::Driver#finish! for properly closing out Sauce jobs and clearing state
Updating the sauce-cucumber's hacks to do the same thing

Fixes #94
2012-11-23 11:41:45 -08:00
R. Tyler Croy 634d86a8b1 Pull the first browser out of the SAUCE_ONDEMAND_BROWSERS environment variable for the configuration
Fixes #90
2012-10-21 18:23:59 -07:00
R. Tyler Croy 8ac48b8de7 Move the cucumber code out into it's own gem 2012-08-14 21:28:33 -07:00
R. Tyler Croy aba6c8bdc6 Relocate the sauce-jasmine code under the appropriate peripheral gem 2012-08-11 16:23:32 -07:00
R. Tyler Croy d370152f38 Add a uniform major version number in lib/sauce/version.rb for all gems to share
This should keep major versions of all the gems the same, but allow for
incremental behind-the-scenes changes to occur in the peripheral gems
2012-08-11 16:23:32 -07:00
R. Tyler Croy ab1a301c71 Add a couple of Rake tasks to support running Jasmine tests against Sauce Labs
This requires the jasmine-gem <http://rubygems.org/gems/jasmine> which,
honestly, youl should be using anyways because it's really handy

Fixes #76
2012-06-20 16:35:37 -07:00
R. Tyler Croy 42cb6a8cce Prevent generating multiple global configuration objects
Fixes #68
2012-06-13 17:23:54 -07:00
R. Tyler Croy 000e00f6cd Remove the entire Selenium RC and Local testing code
This breaks some serious compatibility, but all those old users are best
sticking with an older version of the gem because their usecase is a little
baroque nowadays (I don't think too highly of the RSpec/Test::Unit support
here).

Fixes #74
2012-06-06 23:05:15 -07:00
R. Tyler Croy f88f23546f Properly connect Sauce::Connect when using Sauce::Connect#ensure_connected
This handy bug was caught by the handy rails3-demo test
2012-05-24 20:14:28 -07:00
R. Tyler Croy 749859cda2 Prune this unnecessary random ID 2012-05-24 20:14:27 -07:00
R. Tyler Croy 31ad6e6803 Make sure we set an actual browser_url, else the driver won't know where to go (defaulting to saucelabs.com) 2012-05-24 20:14:27 -07:00
R. Tyler Croy 41642f9815 Remove the unnecessary fake domain nonsense from the Rails2 generator
Fixes #56
2012-05-24 20:14:27 -07:00
Jeffrey ODell 443f33c340 better heroku support 2012-05-16 11:29:36 -05:00
R. Tyler Croy 5832b80ff6 Allow SAUCE_DISABLE_RETRY env variable to disable Capybara retrying
This should help @santiycr and I debug errors in the Sauce service itself
2012-05-15 18:26:31 -07:00
R. Tyler Croy 2534c0bb1b Properly handle formatting Scenario Outlines when executing tests with Jenkins
We need to format the name slightly differently for Jenkins integration
purposes, there's no good tests here because I'm lazy and had a reproduction
case in the Lookout code base. I will regret this.
2012-05-15 13:33:20 -07:00
R. Tyler Croy ba7c3f5c06 Add useful job meta-data in the Cucumber Around hook for the All Tests page
This required some minor changes in Sauce::Job which should not impact anything
else, as far as I can tell.

This also lacks decent tests, partially because I'm lazy, and partially because I used
the Lookout code-base as a guinea pig (since we already have this functionality there)

Fixes #69

2012-05-12 16:52:01 -07:00
R. Tyler Croy be15d7417a Push some Jenkins and Scenario related information to Sauce Labs after a Scenario completes
Fixes #69
2012-05-12 16:31:12 -07:00
R. Tyler Croy 8bc50c2c68 Move a comment into a more relevant location inside of the Around hook 2012-05-12 16:15:14 -07:00
R. Tyler Croy f1b6c35929 Stub out the remainder of the Capybara::Driver::Base API that will likely access Selenium
This might not be the comprehensive list, but it covers the APIs that are
covered by the Capybara::Driver::Selenium class

Fixes #67
2012-05-12 15:27:58 -07:00
R. Tyler Croy d01c158556 Refactor the RetryableDriver code up into Sauce::Capybara::Driver
This way the retryable functionality will be enabled by default, and hopefully
the "standard" driver used will be very reliable!
2012-05-12 15:20:38 -07:00
R. Tyler Croy 42d72a3cf3 Remove the broken Cucumber scenario retry code
Fixes #67
2012-05-12 15:16:36 -07:00
R. Tyler Croy 28011735c4 Add actual retry logic to #handle_retry
This will make #67 actually work, presuming the #base_find actually works
2012-05-08 22:02:17 -07:00
R. Tyler Croy f1c0909abb Add the beginnings of a fully wrapped and retryable Capybara driver
In theory this should help with #67, but it's terribly painful to unit test
and I'm not sure I'll really know if this is working until I put it into production :-/
2012-05-08 21:52:51 -07:00
R. Tyler Croy 27a43c3b3b Handle running the Around hook with Scenario Outlines
Fixes #66
2012-05-02 17:15:00 -07:00
R. Tyler Croy 2ada3d1743 Add a best-effort retry to the Cucumber Around('@selenium') hook to mitigate Selenium UnknownError exceptions
This took a while, is ugly as sin, and will cause your nose to bleed if you
look at it too long.

The basic gist of how/why we have to do these things is:

    * Cucumber::AST::Scenario, Step and StepCollection don't like to be run
      multiple times. In order to acheive a "sane" retry we need to
      re-initialize the Scenario on each retry in order to instantiate new
      underlying Step/StepCollection/StepInvocation objects
    * Exceptions are actually swallowed up by the Cucumber::AST::Scenario in
      order to be reported properly later, so we must fish the exception out of
      the Scenario in order to tell if we need to retry
    * Selenium::WebDriver aliases UnhandledError to UnknownError, which fubars
      any ability to run `e.is_a? Selenium::WebDriver::Errors::UnhandledError`.
      That said, I think we might find other retryable errors in the future so
      this forced the approach used to be extendable.

I know more than I ever wanted to know about Cucumber::Ast thanks to this bug

Fixes #62
2012-04-27 00:40:42 -07:00
R. Tyler Croy 05763397e9 Refactor the Cucumber hooks into module functions to be a bit easier to test.
In order to test these things effectively, we need to pull in some magic code
straight from the cucumber code-base itself.

As far as I can tell, this is the only "reasonable" way to test hooks or things
of that ilk because of the tendency for "cucumber magic" to happen inside of a
weird global 'World' scope

I could just be misunderstanding all of this though.
2012-04-26 23:27:10 -07:00
R. Tyler Croy 24b733c009 Reference a properly-cased RSpec module.
Tired of seeing these errors in these test cases.

    DEPRECATION WARNING: you are using a deprecated constant that will
    be removed from a future version of RSpec.

    /home/tyler/.rvm/gems/ree-1.8.7-2011.12@sauce_ruby/gems/rspec-core-2.9.0/lib/rspec/core/hooks.rb:24:in `call'

    * Rspec is deprecated.
    * RSpec is the new top-level module in RSpec-2
2012-04-26 18:10:16 -07:00
R. Tyler Croy 5ba2376125 Refactor the capybara+cucumber support into a separate file and properly set the job name.
Fixes #60
2012-04-05 00:33:07 -07:00
R. Tyler Croy d2531c13f0 Merge pull request #52 from rtyler/bug/48-cucumber-jenkins-integration
Add an Around hook for Cucumber users to integrate with the Jenkins Sauce OnDemand plugin
2012-04-04 23:27:42 -07:00
R. Tyler Croy 737b2df5b7 Allow Sauce#get_config to be invoked without requiring a "seed" with Sauce#config
Fixes #59
2012-04-04 22:39:50 -07:00
R. Tyler Croy dffaeebe6a Add an Around hook for Cucumber users to integrate with the Jenkins Sauce OnDemand plugin
Unfortunately this doesn't come with any tests, I will have to ponder on a good
mechanism for testing cucumber hooks at a later date, when I'm smarter.
2012-04-01 22:49:40 -07:00
R. Tyler Croy 9fe441a177 Require 'sauce/utilities' since it's references further down 2012-04-01 17:41:30 -07:00
R. Tyler Croy 86b68ed9e4 Move test_selenium.rb into an rspec-driven Selenium test (that works) 2012-03-30 20:27:29 -07:00
R. Tyler Croy b7162c0910 Minor whitespace clean-up 2012-03-30 20:22:15 -07:00
R. Tyler Croy ae32db0418 Add test coverage for some basics of Sauce::Selenium2 2012-03-30 20:10:15 -07:00
R. Tyler Croy 054fa1bc13 Clean up some of the deprecation warnings in the tests 2012-03-30 18:27:07 -07:00
R. Tyler Croy 7fc48ce7e6 Merge pull request #44 from rtyler/bug/43-prune-selenium-server
Prune the Selenium 1 server code and support for running selenium-server.jar locally
2012-03-23 10:36:30 -07:00
R. Tyler Croy e887abb74c Remove over-ridden #url from the Capybara driver, better to use the super-class' 2012-03-20 13:44:35 -07:00
R. Tyler Croy 8ecef8f3f6 Switch over to use the net-http-persistent gem for keep-alives with the WebDriver
Fixes #36
2012-03-20 11:44:07 -07:00
R. Tyler Croy f70e5db6e5 Prune the Selenium 1 server code and support for running selenium-server.jar locally
If users still find themselves *really* wanting the Sauce gem to start up
locally selenium servers for them, they can/should remain on older versions of
the gem. As that workflow is no longer supported.

Fixes #43
2012-03-20 02:47:00 -07:00
R. Tyler Croy 4b5e8b8604 Remove old unnecessary capybara support code
Fixes #41
2012-03-19 15:42:49 -07:00
R. Tyler Croy 59ffe787d7 Missed an at_exit exception, if we've disabled the starting of the tunnel, then we don't need to disconnect 2012-03-19 11:29:23 -07:00
R. Tyler Croy 363f492233 Add a configuration option to disable auto-starting of the Sauce Connect tunnel
Fixes #42
2012-03-19 11:23:01 -07:00