spreewald 1.3.3 → 1.4.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 +33 -9
- data/lib/spreewald/web_steps.rb +39 -9
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-2.3/Gemfile.lock +1 -1
- data/tests/rails-3.2/capybara-1/Gemfile.lock +1 -1
- data/tests/rails-3.2/capybara-2/Gemfile.lock +1 -1
- data/tests/shared/app/views/static_pages/click_on.html.haml +27 -6
- data/tests/shared/features/shared/web_steps.feature +22 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 550c0ee0c29e48a7a5150fd2455ae75e567a024b
|
4
|
+
data.tar.gz: ca07a1d6c5b953721b885d371451d177373791f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb34ba4c3ea0cf7003a371450d7288940c3daeb40b94d4d70c1424a393b385d5ec7d4a54f98c5d8d643e25459426d2a0358a8262ba01acf712767360ff295d83
|
7
|
+
data.tar.gz: 703bf4de4c830f759520c099b28d98a0cdd0def111139326e1ad9b231a180f14889ccb3ee5b26a5295bda09c64a40091b5207960f664bc41d7550e8bfd7bbda3
|
data/README.md
CHANGED
@@ -537,7 +537,31 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
537
537
|
|
538
538
|
* **When I click on "..."**
|
539
539
|
|
540
|
-
Click on some text that might not be a link
|
540
|
+
Click on some text that might not be a link.
|
541
|
+
|
542
|
+
Example:
|
543
|
+
|
544
|
+
When I click on "Collapse"
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
* **When I click on the element "(...)"**
|
549
|
+
|
550
|
+
Click on an element with the given selector.
|
551
|
+
|
552
|
+
Example:
|
553
|
+
|
554
|
+
When I click on the element ".sidebar"
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
* **When I click on the element for (.+?)**
|
559
|
+
|
560
|
+
Click on the element with the given [selector alias](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb).
|
561
|
+
|
562
|
+
Example:
|
563
|
+
|
564
|
+
When I click on the element for the sidebar
|
541
565
|
|
542
566
|
|
543
567
|
* **Then "..." should link to "..."**
|
@@ -546,7 +570,7 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
546
570
|
|
547
571
|
Example:
|
548
572
|
|
549
|
-
|
573
|
+
Then "Sponsor" should link to "http://makandra.com"
|
550
574
|
|
551
575
|
|
552
576
|
|
@@ -559,19 +583,19 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
559
583
|
Then I should see an element ".panel"
|
560
584
|
Then I should not see an element ".sidebar"
|
561
585
|
Then I should see the an element ".twitter-timeline"
|
562
|
-
|
563
|
-
We recommend to [define a `selector_for` method](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb) in `features/support/selectors.rb`
|
564
|
-
so you can refer to the selector in plain English:
|
565
|
-
|
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
|
569
586
|
|
570
587
|
|
571
588
|
|
572
589
|
* **Then I should (not )?see an element for ...**
|
573
590
|
|
591
|
+
Check that an element with the given [selector alias](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb) is present on the page.
|
592
|
+
|
593
|
+
Example:
|
574
594
|
|
595
|
+
Then I should see an element for the panel
|
596
|
+
Then I should not an element for the sidebar
|
597
|
+
Then I should see an element for the Twitter timeline
|
598
|
+
|
575
599
|
|
576
600
|
|
577
601
|
* **Then I should get a text response**
|
data/lib/spreewald/web_steps.rb
CHANGED
@@ -450,7 +450,12 @@ Then /^(the tag )?"([^\"]+)" should be hidden$/ do |tag, selector_or_text|
|
|
450
450
|
assert_hidden(options)
|
451
451
|
end
|
452
452
|
|
453
|
-
# Click on some text that might not be a link
|
453
|
+
# Click on some text that might not be a link.
|
454
|
+
#
|
455
|
+
# Example:
|
456
|
+
#
|
457
|
+
# When I click on "Collapse"
|
458
|
+
#
|
454
459
|
When /^I click on "([^\"]+)"$/ do |text|
|
455
460
|
patiently do
|
456
461
|
contains_text = %{contains(., \"#{text}\")}
|
@@ -460,11 +465,35 @@ When /^I click on "([^\"]+)"$/ do |text|
|
|
460
465
|
end
|
461
466
|
end
|
462
467
|
|
468
|
+
# Click on an element with the given selector.
|
469
|
+
#
|
470
|
+
# Example:
|
471
|
+
#
|
472
|
+
# When I click on the element ".sidebar"
|
473
|
+
#
|
474
|
+
When /^I click on the element "([^"]+)"$/ do |selector|
|
475
|
+
patiently do
|
476
|
+
page.find(selector).click
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
# Click on the element with the given [selector alias](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb).
|
481
|
+
#
|
482
|
+
# Example:
|
483
|
+
#
|
484
|
+
# When I click on the element for the sidebar
|
485
|
+
When /^I click on the element for (.+?)$/ do |locator|
|
486
|
+
patiently do
|
487
|
+
selector = _selector_for(locator)
|
488
|
+
page.find(selector).click
|
489
|
+
end
|
490
|
+
end
|
491
|
+
|
463
492
|
# Use this step to check external links.
|
464
493
|
#
|
465
494
|
# Example:
|
466
495
|
#
|
467
|
-
#
|
496
|
+
# Then "Sponsor" should link to "http://makandra.com"
|
468
497
|
#
|
469
498
|
Then /^"([^"]*)" should link to "([^"]*)"$/ do |link_label, target|
|
470
499
|
patiently do
|
@@ -481,13 +510,6 @@ end
|
|
481
510
|
# Then I should not see an element ".sidebar"
|
482
511
|
# Then I should see the an element ".twitter-timeline"
|
483
512
|
#
|
484
|
-
# We recommend to [define a `selector_for` method](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb) in `features/support/selectors.rb`
|
485
|
-
# so you can refer to the selector in plain English:
|
486
|
-
#
|
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
|
490
|
-
#
|
491
513
|
Then /^I should (not )?see an element "([^"]+)"$/ do |negate, selector|
|
492
514
|
expectation = negate ? :should_not : :should
|
493
515
|
patiently do
|
@@ -495,6 +517,14 @@ Then /^I should (not )?see an element "([^"]+)"$/ do |negate, selector|
|
|
495
517
|
end
|
496
518
|
end
|
497
519
|
|
520
|
+
# Check that an element with the given [selector alias](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb) is present on the page.
|
521
|
+
#
|
522
|
+
# Example:
|
523
|
+
#
|
524
|
+
# Then I should see an element for the panel
|
525
|
+
# Then I should not an element for the sidebar
|
526
|
+
# Then I should see an element for the Twitter timeline
|
527
|
+
#
|
498
528
|
Then /^I should (not )?see an element for (.*?)$/ do |negate, locator|
|
499
529
|
expectation = negate ? :should_not : :should
|
500
530
|
selector = _selector_for(locator)
|
@@ -1,7 +1,28 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
|
1
|
+
.clickables
|
2
|
+
|
3
|
+
.outer
|
4
|
+
.inner
|
5
|
+
Nested
|
6
|
+
|
7
|
+
.button
|
8
|
+
%span.icon +
|
9
|
+
Button
|
10
|
+
|
11
|
+
.panel
|
12
|
+
Panel
|
13
|
+
|
14
|
+
.timeline
|
15
|
+
Timeline
|
16
|
+
|
17
|
+
#message
|
18
|
+
|
19
|
+
:javascript
|
20
|
+
$(function() {
|
21
|
+
$('.clickables *').click(function(event) {
|
22
|
+
$('#message').text('You clicked on .' + this.className);
|
23
|
+
// Don't propagate since the whole point of the test
|
24
|
+
// is that the correct tree node is clicked
|
25
|
+
return false;
|
26
|
+
});
|
27
|
+
});
|
4
28
|
|
5
|
-
.button
|
6
|
-
%span.icon +
|
7
|
-
Button
|
@@ -53,12 +53,32 @@ Feature: Web steps
|
|
53
53
|
And the "Unchecked" checkbox should not be checked
|
54
54
|
|
55
55
|
|
56
|
-
|
56
|
+
@javascript
|
57
57
|
Scenario: /^I click on "([^\"]+)"$/
|
58
58
|
When I go to "/static_pages/click_on"
|
59
59
|
And I click on "Nested"
|
60
|
-
|
60
|
+
# See that it clicks the innermost element with that text
|
61
|
+
Then I should see "You clicked on .inner"
|
62
|
+
When I click on "Button"
|
63
|
+
Then I should see "You clicked on .button"
|
64
|
+
|
65
|
+
@javascript
|
66
|
+
Scenario: /^I click on the element "([^\"]+)"$/
|
67
|
+
When I go to "/static_pages/click_on"
|
68
|
+
And I click on the element ".inner"
|
69
|
+
Then I should see "You clicked on .inner"
|
70
|
+
When I click on the element ".outer"
|
71
|
+
Then I should see "You clicked on .outer"
|
72
|
+
When I click on the element ".button"
|
73
|
+
Then I should see "You clicked on .button"
|
61
74
|
|
75
|
+
@javascript
|
76
|
+
Scenario: /^I click on the element for .*?$/
|
77
|
+
When I go to "/static_pages/click_on"
|
78
|
+
And I click on the element for a panel
|
79
|
+
Then I should see "You clicked on .panel"
|
80
|
+
When I click on the element for the timeline
|
81
|
+
Then I should see "You clicked on .timeline"
|
62
82
|
|
63
83
|
Scenario: /^the "(.*?)" select should( not)? be sorted$/
|
64
84
|
When I go to "/forms/select_fields"
|