cuke-island 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,13 +19,15 @@ I have also upgraded all the associated gems from the parent project so this ins
19
19
 
20
20
  == Changelog
21
21
 
22
- 0.0.4 First Version
22
+ 0.0.8 Added file features for static files not previously downloaded and a simple helper to path to those files. Also began CSS class matching of elements by id. Added web_steps for select option handling
23
23
 
24
- 0.0.5 Added more web_steps
24
+ 0.0.7 File download handling through file_steps - This provides a waiting mechanism inspired by http://collectiveidea.com/blog/archives/2012/01/27/testing-file-downloads-with-capybara-and-chromedriver/
25
25
 
26
26
  0.0.6 Configuration of Capybara.app_host from command line and existing deployed test instance upgrade strategy
27
27
 
28
- 0.0.7 File download handling through file_steps - This provides a waiting mechanism inspired by http://collectiveidea.com/blog/archives/2012/01/27/testing-file-downloads-with-capybara-and-chromedriver/
28
+ 0.0.5 Added more web_steps
29
+
30
+ 0.0.4 First Version
29
31
 
30
32
  == From the original author
31
33
  I've included a simple search.feature examples that uses Google. To switch to use your own development or staging server adjust the URL in features/support/env.rb. I have this example project setup to use Capybara with Webdriver (Selenium) but you can easily switch this to use Culerity or Webrat by editing features/support/env.rb.
@@ -0,0 +1,7 @@
1
+ #inspired by
2
+ #http://stackoverflow.com/questions/14464392/is-it-possible-to-access-a-style-type-css-selector-when-using-cheezys-page-ob
3
+ #http://cweiske.de/tagebuch/XPath%3A%20Select%20element%20by%20class.htm
4
+ When /^I should see class "([^\"]*)" on element with id "([^\"]*)"$/ do |css_class, id|
5
+ path = "//*[contains(@class, #{css_class}) and @id='#{id}']"
6
+ find(:xpath, path)
7
+ end
@@ -7,6 +7,14 @@ When /^I upload a downloaded file to "([^\"]*)"$/ do |field|
7
7
  attach_file(field, downloads.first)
8
8
  end
9
9
 
10
+ When /^I upload a file at location "([^\"]*)" to "([^\"]*)"$/ do |location, field|
11
+ attach_file(field, location)
12
+ end
13
+
14
+ When /^I upload a file relative to features at "([^\"]*)" to "([^\"]*)"$/ do |rel_location, field|
15
+ attach_file(field, features(rel_location).first)
16
+ end
17
+
10
18
  Then /^I should clear downloads$/ do
11
19
  clear_downloads
12
20
  end
@@ -60,6 +60,17 @@ When /^I click the "([^"]*)" link$/ do |link_text|
60
60
  click_link link_text
61
61
  end
62
62
 
63
+ #Got the Idea from http://jasonneylon.wordpress.com/2011/02/16/selecting-from-a-dropdown-generically-with-capybara/
64
+ When /^I select option "([^"]*)" from "([^"]*)"$/ do |index, field|
65
+ option_xpath = "//*[@id='#{field}']/option[#{index}]"
66
+ html_option = find(:xpath, option_xpath).text
67
+ select(html_option, :from => field)
68
+ end
69
+
70
+ When /^I select option value "([^"]*)" from "([^"]*)"$/ do |value, field|
71
+ page.find_by_id(field).find("option[value='#{value}']").select_option
72
+ end
73
+
63
74
  When /^I click the first "([^"]*)" link$/ do |link_text|
64
75
  first(:link, link_text).click
65
76
  end
@@ -8,9 +8,14 @@ module DownloadHelpers
8
8
  TIMEOUT = 120
9
9
  #Put downloads at the same
10
10
  PATH = File.expand_path (File.dirname(__FILE__)) + "/../../downloads"
11
-
11
+ FEATURES_PATH = File.expand_path (File.dirname(__FILE__)) + "/../.."
12
+
12
13
  extend self
13
14
 
15
+ def features rel_path
16
+ Dir[FEATURES_PATH + "/" + rel_path]
17
+ end
18
+
14
19
  def downloads
15
20
  Dir[PATH + "/**"]
16
21
  end
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
  class CukeIsland < Thor::Group
7
7
  include Thor::Actions
8
8
 
9
- VERSION = "0.0.7"
9
+ VERSION = "0.0.8"
10
10
 
11
11
  argument :dir_name
12
12
  argument :hostdomain, :optional => true
@@ -46,6 +46,7 @@ class CukeIsland < Thor::Group
46
46
  empty_directory 'step_definitions'
47
47
  template '../step_definitions/web_steps.rb', 'step_definitions/web_steps.rb'
48
48
  template '../step_definitions/file_steps.rb', 'step_definitions/file_steps.rb'
49
+ template '../step_definitions/css_steps.rb', 'step_definitions/css_steps.rb'
49
50
  end
50
51
  end
51
52
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke-island
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-03-22 00:00:00.000000000 Z
14
+ date: 2013-03-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -141,9 +141,9 @@ dependencies:
141
141
  - - '='
142
142
  - !ruby/object:Gem::Version
143
143
  version: 2.30.0
144
- description: ! 'Standalone generator for a lightly configured cucumber capybara chromedriver
145
- test enviroment: cuke-island <test folder>'
146
- email: paul.scarrone@gmail.com
144
+ description: ! 'Standalone generator for a lightly configured web_step rich cucumber
145
+ capybara chromedriver test enviroment: cuke-island <test folder>'
146
+ email: paul.scarrone@carney.co
147
147
  executables:
148
148
  - cuke-island
149
149
  extensions: []
@@ -155,11 +155,12 @@ files:
155
155
  - Gemfile
156
156
  - Rakefile
157
157
  - features/search.feature.off
158
+ - features/step_definitions/css_steps.rb
158
159
  - features/step_definitions/file_steps.rb
159
160
  - features/step_definitions/web_steps.rb
160
161
  - features/support/env.rb
161
162
  - README.rdoc
162
- homepage: https://github.com/ninjapanzer/cuke-capy-chrome
163
+ homepage: https://github.com/carneyplusco/cuke-capy-chrome
163
164
  licenses: []
164
165
  post_install_message:
165
166
  rdoc_options: []
@@ -182,5 +183,5 @@ rubyforge_project:
182
183
  rubygems_version: 1.8.25
183
184
  signing_key:
184
185
  specification_version: 3
185
- summary: Standalone webdriver generator
186
+ summary: Standalone webdriver generator packed with web_steps
186
187
  test_files: []