spreewald 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b63ce4a7ddbfea13889da72f1eefe2c5a75a605
4
- data.tar.gz: e1c50a3738d0c9445124097126096cc2196c50ef
3
+ metadata.gz: 0d0f730a0329075536b6192fc96f82b4bc8d1e71
4
+ data.tar.gz: ef7d2eb664d117eafa5e0b57d12f94f2b487ee40
5
5
  SHA512:
6
- metadata.gz: 1604b9ed7790c7268a6c80930888eb9a0e7ff48118c27f1f4ec348aa34cee27c4db3a74e65f63ca598e6c84dc56fd68165fdd5f8451830ec9c3e7460fec886e6
7
- data.tar.gz: 9c20207d38e5490159f173aa4d43341a7dbe8c917ea45045ff4b969d907ded3b3252e8d0021536542ba8e0958c5f57c986ad27d946eec6c9744e9acbad8a111c
6
+ metadata.gz: 4e28eb4a813726c43bb2ef49402b107b31f68c4e5a47aa9864f8d79851f2219d7a5834c18ec1fb7f83bd34017f6b2e10a888459feb589fc11536600e87986759
7
+ data.tar.gz: 784350fa08f55de3c49ce894673f485077699fe9cbf38fa53b8900f0cf45d2f24fd501e757d8bb68a9b7c79e40768dbe27da6dda328fe7d44039db51ef570b47
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Spreewald is a collection of useful steps for cucumber. Feel free to fork.
4
4
 
5
+ You can find a list of all contained steps at the end of this README.
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -63,6 +65,20 @@ You can achieve this in your own steps by wrapping them inside a `patiently do`
63
65
 
64
66
  More info [here](https://makandracards.com/makandra/12139-waiting-for-page-load-with-spreewald).
65
67
 
68
+ ## Contributing
69
+
70
+ Test applications for various Rails versions live in `tests/`. There is a Rake task that will run all specs in those test Rails applications for all relevant Ruby versions. Invoke it with:
71
+
72
+ bundle exec rake all:rubies
73
+
74
+ If you would like to contribute:
75
+
76
+ - Fork the repository
77
+ - Push your changes with specs
78
+ - Make sure all specs pass
79
+ - Make a pull request
80
+
81
+
66
82
  ## This README
67
83
 
68
84
  The "Steps" section is autogenerated by `rake update_readme` from comments in the step definitions.
data/Rakefile CHANGED
@@ -94,7 +94,7 @@ def for_each_directory_of(path, &block)
94
94
  if directory.include?('rails-2.3') and RUBY_VERSION != '1.8.7'
95
95
  puts 'Rails 2.3 tests are only run for Ruby 1.8.7'
96
96
  elsif directory.include?('capybara-2') and RUBY_VERSION == '1.8.7'
97
- puts 'Capybara requires Ruby 1.9 or greater'
97
+ puts 'Capybara 2 requires Ruby 1.9 or greater'
98
98
  else
99
99
  block.call(directory)
100
100
  end
@@ -268,7 +268,7 @@ Then /^the "([^"]*)" checkbox(?: within (.*))? should be checked$/ do |label, pa
268
268
  patiently do
269
269
  with_scope(parent) do
270
270
  field_checked = find_field(label)['checked']
271
- field_checked.should be_true
271
+ field_checked.should == true
272
272
  end
273
273
  end
274
274
  end
@@ -278,7 +278,7 @@ Then /^the "([^"]*)" checkbox(?: within (.*))? should not be checked$/ do |label
278
278
  patiently do
279
279
  with_scope(parent) do
280
280
  field_checked = find_field(label)['checked']
281
- field_checked.should be_false
281
+ field_checked.should == false
282
282
  end
283
283
  end
284
284
  end
@@ -432,7 +432,7 @@ end
432
432
  # In a non-selenium test, we only check for `.hidden`, `.invisible` or `style: display:none`
433
433
  #
434
434
  # More details [here](https://makandracards.com/makandra/1049-capybara-check-that-a-page-element-is-hidden-via-css)
435
- Then /^(the tag )?"([^\"]+)" should( not)? be visible$/ do |tag, selector_or_text, negate|
435
+ Then /^(the tag )?"([^\"]+)" should( not)? be visible$/ do |tag, selector_or_text, hidden|
436
436
  case Capybara::current_driver
437
437
  when :selenium, :webkit, :poltergeist
438
438
  patiently do
@@ -478,8 +478,7 @@ Then /^(the tag )?"([^\"]+)" should( not)? be visible$/ do |tag, selector_or_tex
478
478
 
479
479
  })();
480
480
  ].gsub(/\n/, ' ')
481
- matcher = negate ? be_false : be_true
482
- page.evaluate_script(visibility_detecting_javascript).should matcher
481
+ page.evaluate_script(visibility_detecting_javascript).should == !hidden
483
482
  end
484
483
  else
485
484
  invisibility_detecting_matcher = if tag
@@ -487,7 +486,7 @@ Then /^(the tag )?"([^\"]+)" should( not)? be visible$/ do |tag, selector_or_tex
487
486
  else
488
487
  have_css('.hidden, .invisible, [style~="display: none"]', :text => selector_or_text)
489
488
  end
490
- expectation = negate ? :should : :should_not # sic
489
+ expectation = hidden ? :should : :should_not # sic
491
490
  page.send(expectation, invisibility_detecting_matcher)
492
491
  end
493
492
  end
@@ -613,9 +612,9 @@ Then /^the "([^\"]*)" (field|button) should( not)? be disabled$/ do |label, kind
613
612
  end
614
613
 
615
614
  # Tests that a field with the given label is visible.
616
- Then /^the "([^\"]*)" field should( not)? be visible$/ do |label, negate|
615
+ Then /^the "([^\"]*)" field should( not)? be visible$/ do |label, hidden|
617
616
  field = find_field(label)
618
- expectation = negate ? :should_not : :should
617
+
619
618
  case Capybara::current_driver
620
619
  when :selenium, :webkit
621
620
  patiently do
@@ -625,9 +624,10 @@ Then /^the "([^\"]*)" field should( not)? be visible$/ do |label, negate|
625
624
  return(field.is(':visible'));
626
625
  })();
627
626
  ].gsub(/\n/, ' ')
628
- page.evaluate_script(visibility_detecting_javascript).send(expectation, be_true)
627
+ page.evaluate_script(visibility_detecting_javascript).should == !hidden
629
628
  end
630
629
  else
630
+ expectation = hidden ? :should_not : :should
631
631
  field.send(expectation, be_visible)
632
632
  end
633
633
  end
@@ -639,7 +639,7 @@ When /^I wait for the page to load$/ do
639
639
  if [:selenium, :webkit, :poltergeist].include?(Capybara.current_driver)
640
640
  patiently do
641
641
  # when no jQuery is loaded, we assume there are no pending AJAX requests
642
- page.evaluate_script("typeof jQuery === 'undefined' || $.active == 0").should be_true
642
+ page.evaluate_script("typeof jQuery === 'undefined' || $.active == 0").should == true
643
643
  end
644
644
  end
645
645
  page.has_content? ''
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (0.9.7)
4
+ spreewald (1.0.0)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber-rails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../..
3
3
  specs:
4
- spreewald (0.9.7)
4
+ spreewald (1.0.0)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber-rails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../..
3
3
  specs:
4
- spreewald (0.9.7)
4
+ spreewald (1.0.0)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber-rails
@@ -0,0 +1,9 @@
1
+ = form_tag do
2
+
3
+ - checked = true
4
+ = label_tag 'checked_name', 'Checked'
5
+ = check_box_tag 'checked_name', 'value', checked
6
+
7
+ - checked = false
8
+ = label_tag 'unchecked_name', 'Unchecked'
9
+ = check_box_tag 'unchecked_name', 'value', checked
@@ -45,3 +45,9 @@ Feature: Web steps
45
45
 
46
46
  When I go back
47
47
  Then I should be on "/static_pages/link_to_home"
48
+
49
+
50
+ Scenario: /^the "([^"]*)" checkbox(?: within (.*))? should be checked$/
51
+ When I go to "/forms/checkbox_form"
52
+ Then the "Checked" checkbox should be checked
53
+ And the "Unchecked" checkbox should not be checked
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-09 00:00:00.000000000 Z
11
+ date: 2014-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-rails
@@ -129,6 +129,7 @@ files:
129
129
  - tests/shared/app/controllers/static_pages_controller.rb
130
130
  - tests/shared/app/controllers/tables_controller.rb
131
131
  - tests/shared/app/models/mailer.rb
132
+ - tests/shared/app/views/forms/checkbox_form.html.haml
132
133
  - tests/shared/app/views/forms/form1.html.haml
133
134
  - tests/shared/app/views/forms/form2.html.haml
134
135
  - tests/shared/app/views/layouts/application.html.haml
@@ -211,6 +212,7 @@ test_files:
211
212
  - tests/shared/app/controllers/static_pages_controller.rb
212
213
  - tests/shared/app/controllers/tables_controller.rb
213
214
  - tests/shared/app/models/mailer.rb
215
+ - tests/shared/app/views/forms/checkbox_form.html.haml
214
216
  - tests/shared/app/views/forms/form1.html.haml
215
217
  - tests/shared/app/views/forms/form2.html.haml
216
218
  - tests/shared/app/views/layouts/application.html.haml