spreewald 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -5
- data/Rakefile +2 -5
- data/lib/spreewald/web_steps.rb +11 -1
- data/lib/spreewald_support/custom_matchers.rb +8 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-2.3/Gemfile.lock +1 -1
- data/tests/rails-2.3/Rakefile +6 -1
- data/tests/rails-3.2/capybara-1/Gemfile.lock +1 -1
- data/tests/rails-3.2/capybara-1/Rakefile +6 -1
- data/tests/rails-3.2/capybara-2/Gemfile.lock +1 -1
- data/tests/rails-3.2/capybara-2/Rakefile +6 -1
- data/tests/shared/app/views/forms/select_fields.html.haml +7 -0
- data/tests/shared/features/shared/web_steps.feature +6 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 829cfaaa86ce9386294cc90361766b1fc52f79b2
|
4
|
+
data.tar.gz: 618cc0ccc9b30934d1b5a8183bed98c8f5785c9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b745e5075c5ac1fbf97f752353eea7e3c2934e7668fa91ab950b47c9716de24d5737a7f39987848ed1196bed144c98653aacea7d623641634f2441d86083b6e4
|
7
|
+
data.tar.gz: 6c7e4f3411c6f1e4505ddcc146e70eb22dcdf9a3aaea523069d535324c976918cf2b7e4d12f9cee55bee50d3cd2f269086868c556b327dbd0cc8cb4189812806
|
data/README.md
CHANGED
@@ -67,15 +67,19 @@ More info [here](https://makandracards.com/makandra/12139-waiting-for-page-load-
|
|
67
67
|
|
68
68
|
## Contributing
|
69
69
|
|
70
|
-
Test applications for various Rails versions live in `tests/`.
|
70
|
+
Test applications for various Rails versions live in `tests/`.
|
71
71
|
|
72
|
-
|
72
|
+
- Bundle all test apps with `bundle exec rake all:bundle`.
|
73
|
+
- Run features in all test apps with `bundle exec rake all:features`.
|
74
|
+
- Run features in all test apps in all rubies with `bundle exec rake all:rubies`.
|
75
|
+
- Run a single feature by setting the `SINGLE_FEATURE` environment variable.
|
76
|
+
Example: `SINGLE_FEATURE=web_steps.feature:63 bundle exec rake all:features`
|
73
77
|
|
74
78
|
If you would like to contribute:
|
75
79
|
|
76
80
|
- Fork the repository
|
77
81
|
- Push your changes with specs
|
78
|
-
- Make sure
|
82
|
+
- Make sure `rake` passes
|
79
83
|
- Regenerate the "Steps" section of this Readme with `rake update_readme`, if needed
|
80
84
|
- Make a pull request
|
81
85
|
|
@@ -256,7 +260,7 @@ See [this article](https://makandracards.com/makandra/1222-useful-cucumber-steps
|
|
256
260
|
|
257
261
|
### web_steps.rb
|
258
262
|
|
259
|
-
Most of cucumber-rails' original web steps plus a few of our own.
|
263
|
+
Most of cucumber-rails' original web steps plus a few of our own.
|
260
264
|
|
261
265
|
Note that cucumber-rails deprecated all its steps quite a while ago with the following
|
262
266
|
deprecation notice. Decide for yourself whether you want to use them:
|
@@ -631,5 +635,11 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
631
635
|
|
632
636
|
* **When I go back**
|
633
637
|
|
634
|
-
|
638
|
+
Goes to the previously viewed page.
|
639
|
+
|
640
|
+
|
641
|
+
* **Then the "..." select should( not)? be sorted**
|
642
|
+
|
643
|
+
Tests whether a select field is sorted. Uses Array#natural_sort, if defined;
|
644
|
+
Array#sort else.
|
635
645
|
|
data/Rakefile
CHANGED
@@ -25,10 +25,7 @@ namespace :all do
|
|
25
25
|
task :features do
|
26
26
|
success = true
|
27
27
|
for_each_directory_of('tests/**/Rakefile') do |directory|
|
28
|
-
Bundler.
|
29
|
-
env = "FEATURE=../../#{ENV['FEATURE']}" if ENV['FEATURE']
|
30
|
-
success &= system("cd #{directory} && bundle exec rake features #{env}")
|
31
|
-
end
|
28
|
+
success &= Bundler.clean_system("cd #{directory} && bundle exec rake features")
|
32
29
|
end
|
33
30
|
fail "Tests failed" unless success
|
34
31
|
end
|
@@ -64,7 +61,7 @@ def run_for_all_rubies(version_manager)
|
|
64
61
|
%w[
|
65
62
|
1.8.7
|
66
63
|
1.9.3
|
67
|
-
2.
|
64
|
+
2.1.2
|
68
65
|
].all? do |ruby_version|
|
69
66
|
announce "Running features for Ruby #{ruby_version}", 2
|
70
67
|
|
data/lib/spreewald/web_steps.rb
CHANGED
@@ -666,7 +666,7 @@ When /^I perform basic authentication as "([^\"]*)\/([^\"]*)" and go to (.*)$/ d
|
|
666
666
|
end
|
667
667
|
end
|
668
668
|
|
669
|
-
#
|
669
|
+
# Goes to the previously viewed page.
|
670
670
|
When /^I go back$/ do
|
671
671
|
case Capybara::current_driver
|
672
672
|
when :selenium, :webkit
|
@@ -679,3 +679,13 @@ When /^I go back$/ do
|
|
679
679
|
end
|
680
680
|
end
|
681
681
|
end
|
682
|
+
|
683
|
+
# Tests whether a select field is sorted. Uses Array#natural_sort, if defined;
|
684
|
+
# Array#sort else.
|
685
|
+
Then /^the "(.*?)" select should( not)? be sorted$/ do |label, negate|
|
686
|
+
select = find_field(label)
|
687
|
+
options = select.all('option').reject { |o| o.value.blank? }
|
688
|
+
option_texts = options.collect(&:text)
|
689
|
+
|
690
|
+
option_texts.send((negate ? :should_not : :should), be_sorted)
|
691
|
+
end
|
data/tests/rails-2.3/Rakefile
CHANGED
@@ -6,7 +6,12 @@ task :default => :features
|
|
6
6
|
|
7
7
|
desc 'Run all specs for rails 2.3'
|
8
8
|
Cucumber::Rake::Task.new(:features) do |t|
|
9
|
+
feature = if ENV['SINGLE_FEATURE']
|
10
|
+
"../shared/features/shared/#{ ENV['SINGLE_FEATURE'] }"
|
11
|
+
else
|
12
|
+
'features/shared'
|
13
|
+
end
|
14
|
+
|
9
15
|
# tell cucumber where it finds it files (subdirectories and symlinks are confusing it)
|
10
|
-
feature = ENV['FEATURE'] || "features/shared"
|
11
16
|
t.cucumber_opts = "--require features --require features/shared #{feature}"
|
12
17
|
end
|
@@ -6,8 +6,13 @@ task :default => :features
|
|
6
6
|
|
7
7
|
desc 'Run all specs for rails 3.2'
|
8
8
|
Cucumber::Rake::Task.new(:features) do |t|
|
9
|
+
feature = if ENV['SINGLE_FEATURE']
|
10
|
+
"../../shared/features/shared/#{ ENV['SINGLE_FEATURE'] }"
|
11
|
+
else
|
12
|
+
'features/shared'
|
13
|
+
end
|
14
|
+
|
9
15
|
# tell cucumber where it finds it files (subdirectories and symlinks are confusing it)
|
10
|
-
feature = ENV['FEATURE'] || "features/shared"
|
11
16
|
t.cucumber_opts = "--require features --require features/shared #{feature}"
|
12
17
|
end
|
13
18
|
|
@@ -6,8 +6,13 @@ task :default => :features
|
|
6
6
|
|
7
7
|
desc 'Run all specs for rails 3.2'
|
8
8
|
Cucumber::Rake::Task.new(:features) do |t|
|
9
|
+
feature = if ENV['SINGLE_FEATURE']
|
10
|
+
"../../shared/features/shared/#{ ENV['SINGLE_FEATURE'] }"
|
11
|
+
else
|
12
|
+
'features/shared'
|
13
|
+
end
|
14
|
+
|
9
15
|
# tell cucumber where it finds it files (subdirectories and symlinks are confusing it)
|
10
|
-
feature = ENV['FEATURE'] || "features/shared"
|
11
16
|
t.cucumber_opts = "--require features --require features/shared #{feature}"
|
12
17
|
end
|
13
18
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
= form_tag do
|
2
|
+
|
3
|
+
= label_tag 'sorted', 'Sorted select'
|
4
|
+
= select_tag 'sorted', options_for_select([['prompt', nil], ['Anton', 'value'], ['Berta', 'value'], ['Clara', 'value'], ['Dario', 'value']])
|
5
|
+
|
6
|
+
= label_tag 'unsorted', 'Unsorted select'
|
7
|
+
= select_tag 'unsorted', options_for_select([['prompt', nil], ['Xaver', 'value'], ['Berta', 'value'], ['Konstantin', 'value'], ['Maria', 'value']])
|
@@ -58,3 +58,9 @@ Feature: Web steps
|
|
58
58
|
When I go to "/static_pages/click_on"
|
59
59
|
And I click on "Nested"
|
60
60
|
And I click on "Button"
|
61
|
+
|
62
|
+
|
63
|
+
Scenario: /^the "(.*?)" select should( not)? be sorted$/
|
64
|
+
When I go to "/forms/select_fields"
|
65
|
+
Then the "sorted" select should be sorted
|
66
|
+
But the "unsorted" select should not be sorted
|
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.
|
4
|
+
version: 1.2.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: 2015-01-
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber-rails
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- tests/shared/app/views/forms/checkbox_form.html.haml
|
133
133
|
- tests/shared/app/views/forms/form1.html.haml
|
134
134
|
- tests/shared/app/views/forms/form2.html.haml
|
135
|
+
- tests/shared/app/views/forms/select_fields.html.haml
|
135
136
|
- tests/shared/app/views/layouts/application.html.haml
|
136
137
|
- tests/shared/app/views/static_pages/click_on.html.haml
|
137
138
|
- tests/shared/app/views/static_pages/home.html.haml
|
@@ -216,6 +217,7 @@ test_files:
|
|
216
217
|
- tests/shared/app/views/forms/checkbox_form.html.haml
|
217
218
|
- tests/shared/app/views/forms/form1.html.haml
|
218
219
|
- tests/shared/app/views/forms/form2.html.haml
|
220
|
+
- tests/shared/app/views/forms/select_fields.html.haml
|
219
221
|
- tests/shared/app/views/layouts/application.html.haml
|
220
222
|
- tests/shared/app/views/static_pages/click_on.html.haml
|
221
223
|
- tests/shared/app/views/static_pages/home.html.haml
|