spreewald 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -12
- data/lib/spreewald/web_steps.rb +21 -18
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/shared/app/views/static_pages/within.html.haml +4 -0
- data/tests/shared/features/shared/web_steps.feature +10 -6
- 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: a96ad90241f95da1aad6a504ca9a4b632b6aa140
|
4
|
+
data.tar.gz: 98203ad1472926314f97f49115de31f135b021d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 622f1028d8f4077591eeccc1f4afbfe46e574022ece90da191796c6d1c6634ceec82256649922156a76574594e302aa639bfde5b5db4ccebd0892844606dfd2d
|
7
|
+
data.tar.gz: 5838a95f80ed9d08e09844a4e8d243d72cebd75cd358c31bc9a9406f657770edfde61dca032ac6d0e703371e3e1207f5015a1d85182adc0c621f5a85f766ba15
|
data/README.md
CHANGED
@@ -550,30 +550,30 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
550
550
|
|
551
551
|
|
552
552
|
|
553
|
-
* **Then I should (not )?see an element "..."**
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
* **Then I should (not )?see ((a |an |the )?("...")|...) element**
|
553
|
+
* **Then I should (not )?see an element "(...)"**
|
559
554
|
|
560
555
|
Check that an element with the given selector is present on the page.
|
561
556
|
|
562
557
|
Example:
|
563
558
|
|
564
|
-
Then I should see
|
565
|
-
Then I should not see ".sidebar"
|
566
|
-
Then I should see the ".twitter-timeline"
|
559
|
+
Then I should see an element ".panel"
|
560
|
+
Then I should not see an element ".sidebar"
|
561
|
+
Then I should see the an element ".twitter-timeline"
|
567
562
|
|
568
563
|
We recommend to [define a `selector_for` method](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb) in `features/support/selectors.rb`
|
569
564
|
so you can refer to the selector in plain English:
|
570
565
|
|
571
|
-
Then I should see
|
572
|
-
Then I should not
|
573
|
-
Then I should see the Twitter timeline
|
566
|
+
Then I should see an element for the panel
|
567
|
+
Then I should not an element for the sidebar
|
568
|
+
Then I should see an element for the Twitter timeline
|
574
569
|
|
575
570
|
|
576
571
|
|
572
|
+
* **Then I should (not )?see an element for ...**
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
|
577
577
|
* **Then I should get a text response**
|
578
578
|
|
579
579
|
Checks that the result has content type `text/plain`
|
data/lib/spreewald/web_steps.rb
CHANGED
@@ -39,12 +39,16 @@ require 'cgi'
|
|
39
39
|
#
|
40
40
|
# Then I should see "some text" within ".page_body"
|
41
41
|
When /^(.*) within (.*[^:])$/ do |nested_step, parent|
|
42
|
-
|
42
|
+
patiently do
|
43
|
+
with_scope(parent) { step(nested_step) }
|
44
|
+
end
|
43
45
|
end
|
44
46
|
|
45
47
|
# nodoc
|
46
48
|
When /^(.*) within (.*[^:]):$/ do |nested_step, parent, table_or_string|
|
47
|
-
|
49
|
+
patiently do
|
50
|
+
with_scope(parent) { step("#{nested_step}:", table_or_string) }
|
51
|
+
end
|
48
52
|
end
|
49
53
|
|
50
54
|
Given /^(?:|I )am on (.+)$/ do |page_name|
|
@@ -469,32 +473,31 @@ Then /^"([^"]*)" should link to "([^"]*)"$/ do |link_label, target|
|
|
469
473
|
end
|
470
474
|
end
|
471
475
|
|
472
|
-
Then /^I should (not )?see an element "([^"]*)"$/ do |negate, selector|
|
473
|
-
warn %(The step 'I should see an element "..."' is deprecated. Please use 'I should see a "..." element instead')
|
474
|
-
expectation = negate ? :should_not : :should
|
475
|
-
patiently do
|
476
|
-
page.send(expectation, have_css(selector))
|
477
|
-
end
|
478
|
-
end
|
479
|
-
|
480
476
|
# Check that an element with the given selector is present on the page.
|
481
477
|
#
|
482
478
|
# Example:
|
483
479
|
#
|
484
|
-
# Then I should see
|
485
|
-
# Then I should not see ".sidebar"
|
486
|
-
# Then I should see the ".twitter-timeline"
|
480
|
+
# Then I should see an element ".panel"
|
481
|
+
# Then I should not see an element ".sidebar"
|
482
|
+
# Then I should see the an element ".twitter-timeline"
|
487
483
|
#
|
488
484
|
# We recommend to [define a `selector_for` method](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb) in `features/support/selectors.rb`
|
489
485
|
# so you can refer to the selector in plain English:
|
490
486
|
#
|
491
|
-
# Then I should see
|
492
|
-
# Then I should not
|
493
|
-
# Then I should see the Twitter timeline
|
487
|
+
# Then I should see an element for the panel
|
488
|
+
# Then I should not an element for the sidebar
|
489
|
+
# Then I should see an element for the Twitter timeline
|
494
490
|
#
|
495
|
-
Then /^I should (not )?see
|
491
|
+
Then /^I should (not )?see an element "([^"]+)"$/ do |negate, selector|
|
492
|
+
expectation = negate ? :should_not : :should
|
493
|
+
patiently do
|
494
|
+
page.send(expectation, have_css(selector))
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
498
|
+
Then /^I should (not )?see an element for (.*?)$/ do |negate, locator|
|
496
499
|
expectation = negate ? :should_not : :should
|
497
|
-
selector = _selector_for(
|
500
|
+
selector = _selector_for(locator)
|
498
501
|
patiently do
|
499
502
|
page.send(expectation, have_css(selector))
|
500
503
|
end
|
@@ -86,9 +86,13 @@ Feature: Web steps
|
|
86
86
|
|
87
87
|
Scenario: /^I should (not )?see (?:|a|an |the )(.*?) element$/
|
88
88
|
When I go to "/static_pages/see_element"
|
89
|
-
Then I should see
|
90
|
-
And I should see
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
89
|
+
Then I should see an element ".panel"
|
90
|
+
And I should see an element for a panel
|
91
|
+
But I should not see an element ".timeline"
|
92
|
+
And I should not see an element for the timeline
|
93
|
+
|
94
|
+
Scenario: /^(.*) within (.*[^:])$/
|
95
|
+
When I go to "/static_pages/within"
|
96
|
+
Then I should see an element ".child1" within ".container1"
|
97
|
+
But I should not see an element ".child1" within ".container2"
|
98
|
+
|
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.3.
|
4
|
+
version: 1.3.3
|
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-11-
|
11
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber-rails
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- tests/shared/app/views/static_pages/link_to_home.html.haml
|
150
150
|
- tests/shared/app/views/static_pages/see_element.html.haml
|
151
151
|
- tests/shared/app/views/static_pages/visibility.html.haml
|
152
|
+
- tests/shared/app/views/static_pages/within.html.haml
|
152
153
|
- tests/shared/app/views/tables/table1.html.haml
|
153
154
|
- tests/shared/config/cucumber.yml
|
154
155
|
- tests/shared/config/database.yml
|
@@ -249,6 +250,7 @@ test_files:
|
|
249
250
|
- tests/shared/app/views/static_pages/link_to_home.html.haml
|
250
251
|
- tests/shared/app/views/static_pages/see_element.html.haml
|
251
252
|
- tests/shared/app/views/static_pages/visibility.html.haml
|
253
|
+
- tests/shared/app/views/static_pages/within.html.haml
|
252
254
|
- tests/shared/app/views/tables/table1.html.haml
|
253
255
|
- tests/shared/config/cucumber.yml
|
254
256
|
- tests/shared/config/database.yml
|