kelp 0.1.9 → 0.2.0

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kelp (0.1.9)
4
+ kelp (0.2.0)
5
5
  capybara (>= 0.4.0)
6
6
 
7
7
  GEM
data/History.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Kelp History
2
2
  ============
3
3
 
4
+ 0.2.0
5
+ -----
6
+
7
+ - Fixed a 'within' clause quoted identifier glitch in cucumber output
8
+ - Fixed bug in "fill in the following" step definition
9
+ - Raise Kelp::Unexpected instead of RSpec exception
10
+ - Dropdown inclusion steps now accumulate unexpected values instead of failing on the first one
11
+ - More cucumber self-tests to prevent breakages
12
+
13
+
4
14
  0.1.9
5
15
  -----
6
16
 
@@ -0,0 +1,11 @@
1
+ Feature: Checkbox failures
2
+
3
+ Background:
4
+ Given I visit "/form"
5
+
6
+ Scenario: Checkbox should be checked (FAIL)
7
+ Then the "Like" checkbox next to "Banana" should be checked
8
+
9
+ Scenario: Checkbox should not be checked (FAIL)
10
+ Then the "Like" checkbox next to "Apple" should not be checked
11
+
@@ -10,12 +10,12 @@ Feature: Dropdowns
10
10
  Then the "Height" dropdown should include "Tall"
11
11
  And the "Quotes" dropdown should include "Single 'quotes'"
12
12
  And the "Height" dropdown should include:
13
- | Short |
13
+ | Short |
14
14
  | Average |
15
- | Tall |
15
+ | Tall |
16
16
  And the "Quotes" dropdown should include:
17
- | Single 'quotes' |
18
- | "Double" quotes |
17
+ | Single 'quotes' |
18
+ | "Double" quotes |
19
19
  | 'Single' and "Double" quotes |
20
20
  And the "Favorite Colors" dropdown should include:
21
21
  """
@@ -0,0 +1,28 @@
1
+ Feature: Dropdown failures
2
+
3
+ Background:
4
+ Given I visit "/form"
5
+
6
+ Scenario: Dropdown should equal (FAIL)
7
+ Then the "Height" dropdown should equal "Tall"
8
+
9
+ Scenario: Dropdown should include single value (FAIL)
10
+ Then the "Height" dropdown should include "Midget"
11
+
12
+ Scenario: Dropdown should include multiple values (FAIL)
13
+ And the "Height" dropdown should include:
14
+ | Tiny |
15
+ | Average |
16
+ | Tall |
17
+ | Enormous |
18
+
19
+ Scenario: Dropdown should not include single value (FAIL)
20
+ Then the "Height" dropdown should not include "Average"
21
+
22
+ Scenario: Dropdown should not include multiple values (FAIL)
23
+ And the "Height" dropdown should not include:
24
+ | Tiny |
25
+ | Average |
26
+ | Tall |
27
+ | Enormous |
28
+
@@ -3,12 +3,14 @@ Feature: Fields
3
3
  Background:
4
4
  Given I visit "/form"
5
5
 
6
+
6
7
  Scenario: Field should be empty
7
8
  Then the "First name" field should be empty
8
9
  And the "First name" field within "#person_form" should be empty
9
10
  And the "Last name" field should be empty
10
11
  And the "Last name" field within "#person_form" should be empty
11
12
 
13
+
12
14
  Scenario: Fields should contain
13
15
  Then the fields should contain:
14
16
  | First name | |
@@ -16,3 +18,58 @@ Feature: Fields
16
18
  | Weight | Light |
17
19
  | Height | Average |
18
20
  | Message | Your message goes here |
21
+
22
+
23
+ Scenario: Fill in single fields by label
24
+ When I fill in "First name" with "Adam"
25
+ And I fill in "Savage" for "Last name"
26
+ Then the "First name" field should contain "Adam"
27
+ And the "Last name" field should contain "Savage"
28
+
29
+
30
+ Scenario: Fill in single fields by id
31
+ When I fill in "first_name" with "Jamie"
32
+ And I fill in "Hyneman" for "last_name"
33
+ Then the "first_name" field should contain "Jamie"
34
+ And the "last_name" field should contain "Hyneman"
35
+
36
+
37
+ Scenario: Fill in single fields within a scope
38
+ When I fill in "First name" with "Homer" within "#person_form"
39
+ And I fill in "First name" with "Marge" within "#spouse_form"
40
+ Then the "First name" field within "#person_form" should contain "Homer"
41
+ And the "First name" field within "#spouse_form" should contain "Marge"
42
+
43
+
44
+ Scenario: Fill in multiple fields by label
45
+ When I fill in the following:
46
+ | First name | Andre |
47
+ | Last name | Roussimoff |
48
+ | Weight | Heavy |
49
+ | Height | Tall |
50
+ | Message | Anybody want a peanut? |
51
+
52
+ Then the fields should contain:
53
+ | First name | Andre |
54
+ | Last name | Roussimoff |
55
+ | Weight | Heavy |
56
+ | Height | Tall |
57
+ | Message | Anybody want a peanut? |
58
+
59
+
60
+ Scenario: Fill in multiple fields by label within a scope
61
+ When I fill in the following within "#person_form":
62
+ | First name | Peter |
63
+ | Last name | Griffin |
64
+ And I fill in the following within "#spouse_form":
65
+ | First name | Lois |
66
+ | Last name | Griffin |
67
+
68
+ Then the fields within "#person_form" should contain:
69
+ | First name | Peter |
70
+ | Last name | Griffin |
71
+ And the fields within "#spouse_form" should contain:
72
+ | First name | Lois |
73
+ | Last name | Griffin |
74
+
75
+
@@ -0,0 +1,31 @@
1
+ Feature: Field failure test
2
+
3
+ Background:
4
+ Given I visit "/form"
5
+
6
+
7
+ Scenario: Field should be empty (FAIL)
8
+ When I fill in "First name" with "Ivan"
9
+ Then the "First name" field should be empty
10
+
11
+
12
+ Scenario: Field should be empty within a scope (FAIL)
13
+ When I fill in "Last name" with "Karamazov"
14
+ Then the "Last name" field within "#person_form" should be empty
15
+
16
+
17
+ Scenario: Field should contain (FAIL)
18
+ When I fill in "First name" with "Dmitry"
19
+ Then the "First name" field should contain "Alexy"
20
+
21
+
22
+ Scenario: Fill in a single field (FAIL)
23
+ When I fill in "Middle name" with "Fyodorovitch"
24
+
25
+
26
+ Scenario: Fill in multiple fields (FAIL)
27
+ When I fill in the following:
28
+ | First name | Wallace |
29
+ | Last name | Shawn |
30
+ | Height | Diminutive |
31
+
@@ -3,10 +3,11 @@ Feature: Visibility
3
3
  Background:
4
4
  Given I visit "/home"
5
5
 
6
- Scenario: Should or shouldn't see
6
+
7
+ Scenario: Should or shouldn't see text
7
8
  Then I should see the following:
8
- | Homepage |
9
- | Hello world |
9
+ | Homepage |
10
+ | Hello world |
10
11
  | Goodbye world |
11
12
 
12
13
  And I should see the following:
@@ -17,11 +18,41 @@ Feature: Visibility
17
18
  About Us
18
19
  """
19
20
 
20
- And I should not see the following:
21
+ But I should not see the following:
21
22
  | Goodbye cruel world |
22
23
 
24
+ And I should not see the following:
25
+ """
26
+ Fourth
27
+ Firth of Fifth
28
+ About someone else
29
+ """
30
+
31
+
32
+ Scenario: Should or shouldn't see text within a scope
33
+ Then I should see "Hello world" within "#greeting"
34
+ And I should see the following within "#table_a":
35
+ | Eric |
36
+ | John |
37
+ | Terry |
38
+
39
+ But I should not see "Goodbye world" within "#greeting"
40
+ And I should not see the following within "#table_a":
41
+ | Graham |
42
+ | Michael |
43
+
23
44
 
24
- Scenario: Should or shouldn't see in same row
45
+ Scenario: Should or shouldn't see regexp
46
+ Then I should see /(Hello|Goodbye) world/
47
+ But I should not see /(Spam|Eggs) world/
48
+
49
+
50
+ Scenario: Should or shouldn't see regexp within a scope
51
+ Then I should see /\d+-\d+/ within "#table_a"
52
+ But I should not see /\d\d\d\d\d/ within "#table_a"
53
+
54
+
55
+ Scenario: Should or shouldn't see text in table rows
25
56
  Then I should see a table row containing:
26
57
  | Eric | Edit |
27
58
 
@@ -37,8 +68,67 @@ Feature: Visibility
37
68
  | Terry | Delete |
38
69
 
39
70
 
71
+ Scenario: Should or shouldn't see text in table rows within a scope
72
+ Then I should see table rows within "#table_a" containing:
73
+ | Eric | Edit |
74
+ | John | Edit |
75
+ | Terry | Edit |
76
+ But I should not see table rows within "#table_a" containing:
77
+ | Eric | Delete |
78
+ | John | Delete |
79
+ | Terry | Delete |
80
+
81
+
40
82
  Scenario: Should or shouldn't see next to
41
83
  Then I should see "Edit" next to "John"
42
- And I should not see "Delete" next to "John"
84
+ But I should not see "Delete" next to "John"
85
+
86
+ And I should see the following next to "Eric":
87
+ | 555-4444 | Edit |
88
+ And I should see the following next to "John":
89
+ """
90
+ 666-5555
91
+ Edit
92
+ """
93
+
94
+ But I should not see the following next to "Eric":
95
+ | 666-5555 | Delete |
96
+ And I should not see the following next to "John":
97
+ """
98
+ 555-4444
99
+ Copy
100
+ """
101
+
102
+
103
+ Scenario: Should or shouldn't see next to within a scope
104
+ Then I should see "Edit" next to "Eric" within "#table_a"
105
+ But I should not see "Edit" next to "Eric" within "#table_b"
106
+
107
+ And I should see the following next to "Terry" within "#table_a":
108
+ | 777-6666 | Edit |
109
+ And I should see the following next to "Terry" within "#table_b":
110
+ """
111
+ Big
112
+ thing
113
+ """
114
+
115
+ But I should not see the following next to "Terry" within "#table_a":
116
+ | Big | thing |
117
+ And I should not see the following next to "Terry" within "#table_b":
118
+ """
119
+ Crunchy
120
+ frog
121
+ """
122
+
123
+
124
+ Scenario: Should or shouldn't see button
125
+ When I visit "/form"
126
+ Then I should see a "Submit person form" button
127
+ But I should not see a "Submit animal form" button
128
+
43
129
 
130
+ Scenario: Should or shouldn't see button within a scope
131
+ When I visit "/form"
132
+ Then I should see a "Submit person form" button within "#person_form"
133
+ But I should not see a "Submit person form" button within "#preferences_form"
44
134
 
@@ -3,7 +3,8 @@ Feature: Visibility failures
3
3
  Background:
4
4
  Given I visit "/home"
5
5
 
6
- Scenario: Should see - failure
6
+
7
+ Scenario: Should see text (FAIL)
7
8
  Then I should see the following:
8
9
  """
9
10
  First
@@ -14,7 +15,8 @@ Feature: Visibility failures
14
15
  Not there
15
16
  """
16
17
 
17
- Scenario: Should not see - failure
18
+
19
+ Scenario: Should not see text (FAIL)
18
20
  Then I should not see the following:
19
21
  """
20
22
  First
@@ -25,3 +27,29 @@ Feature: Visibility failures
25
27
  Not there
26
28
  """
27
29
 
30
+
31
+ Scenario: Should see text within a scope (FAIL)
32
+ Then I should see "Goodbye world" within "#greeting"
33
+
34
+
35
+ Scenario: Should not see text within a scope (FAIL)
36
+ Then I should not see "Hello world" within "#greeting"
37
+
38
+
39
+ Scenario: Should see regexp (FAIL)
40
+ Then I should see /(Waffle|Pancake) world/
41
+
42
+
43
+ Scenario: Should not see regexp (FAIL)
44
+ Then I should not see /(Hello|Goodbye) world/
45
+
46
+
47
+ Scenario: Should see text in table rows (FAIL)
48
+ Then I should see a table row containing:
49
+ | Eric | Delete |
50
+
51
+
52
+ Scenario: Should not see text in table rows (FAIL)
53
+ Then I should not see a table row containing:
54
+ | Eric | Edit |
55
+
@@ -37,6 +37,20 @@
37
37
  </div>
38
38
  </form>
39
39
 
40
+ <div id="spouse_form">
41
+ <form action="/thanks" method="get">
42
+ <p>
43
+ <label for="spouse_first_name">First name</label>
44
+ <input id="spouse_first_name" type="text" />
45
+ </p>
46
+ <p>
47
+ <label for="spouse_last_name">Last name</label>
48
+ <input id="spouse_last_name" type="text" />
49
+ </p>
50
+ <p><button value="Submit spouse form" /></p>
51
+ </form>
52
+ </div>
53
+
40
54
  <div id="preferences_form">
41
55
  <form action="/thanks" method="get">
42
56
  <p>
@@ -14,6 +14,20 @@ Feature: Kelp Step Definitions
14
14
  6 steps (6 passed)
15
15
  """
16
16
 
17
+ Scenario: Checkbox failure test
18
+ When I run cucumber on "checkbox_fail.feature"
19
+ Then the results should include:
20
+ """
21
+ Scenario: Checkbox should be checked (FAIL)
22
+ Expected 'Like' to be checked, but it is unchecked. (Kelp::Unexpected)
23
+
24
+ Scenario: Checkbox should not be checked (FAIL)
25
+ Expected 'Like' to be unchecked, but it is checked. (Kelp::Unexpected)
26
+
27
+ 2 scenarios (2 failed)
28
+ 4 steps (2 failed, 2 passed)
29
+ """
30
+
17
31
  Scenario: Dropdown test
18
32
  When I run cucumber on "dropdown.feature"
19
33
  Then the results should include:
@@ -22,33 +36,108 @@ Feature: Kelp Step Definitions
22
36
  11 steps (11 passed)
23
37
  """
24
38
 
39
+ Scenario: Dropdown failure test
40
+ When I run cucumber on "dropdown_fail.feature"
41
+ Then the results should include:
42
+ """
43
+ Scenario: Dropdown should equal (FAIL)
44
+ Expected 'Height' dropdown to equal 'Tall'
45
+ Got 'Average' instead (Kelp::Unexpected)
46
+
47
+ Scenario: Dropdown should include single value (FAIL)
48
+ Expected 'Height' dropdown to include: ["Midget"]
49
+ Missing: ["Midget"] (Kelp::Unexpected)
50
+
51
+ Scenario: Dropdown should include multiple values (FAIL)
52
+ Expected 'Height' dropdown to include: ["Tiny", "Average", "Tall", "Enormous"]
53
+ Missing: ["Tiny", "Enormous"] (Kelp::Unexpected)
54
+
55
+ Scenario: Dropdown should not include single value (FAIL)
56
+ Expected 'Height' dropdown to not include: ["Average"]
57
+ Did include: ["Average"] (Kelp::Unexpected)
58
+
59
+ Scenario: Dropdown should not include multiple values (FAIL)
60
+ Expected 'Height' dropdown to not include: ["Tiny", "Average", "Tall", "Enormous"]
61
+ Did include: ["Average", "Tall"] (Kelp::Unexpected)
62
+ """
63
+
25
64
  Scenario: Field test
26
65
  When I run cucumber on "field.feature"
27
66
  Then the results should include:
28
67
  """
29
- 2 scenarios (2 passed)
30
- 7 steps (7 passed)
68
+ 7 scenarios (7 passed)
69
+ 30 steps (30 passed)
70
+ """
71
+
72
+ Scenario: Field failure test
73
+ When I run cucumber on "field_fail.feature"
74
+ Then the results should include:
75
+ """
76
+ Scenario: Field should be empty (FAIL)
77
+ Expected field 'First name' to be empty, but value is 'Ivan' (Kelp::Unexpected)
78
+
79
+ Scenario: Field should be empty within a scope (FAIL)
80
+ Expected field 'Last name' to be empty, but value is 'Karamazov' (Kelp::Unexpected)
81
+
82
+ Scenario: Field should contain (FAIL)
83
+ Expected 'First name' to contain 'Alexy'
84
+ Got 'Dmitry' (Kelp::Unexpected)
85
+
86
+ Scenario: Fill in a single field (FAIL)
87
+ No field with id, name, or label 'Middle name' found (Kelp::FieldNotFound)
88
+
89
+ Scenario: Fill in multiple fields (FAIL)
90
+ Field 'Height' has no option 'Diminutive' (Kelp::OptionNotFound)
91
+
92
+ 5 scenarios (5 failed)
93
+ 13 steps (5 failed, 8 passed)
31
94
  """
32
95
 
33
96
  Scenario: Visibility test
34
97
  When I run cucumber on "visibility.feature"
35
98
  Then the results should include:
36
99
  """
37
- 3 scenarios (3 passed)
38
- 12 steps (12 passed)
100
+ 10 scenarios (10 passed)
101
+ 46 steps (46 passed)
39
102
  """
40
103
 
41
104
  Scenario: Visibility failure test
42
105
  When I run cucumber on "visibility_fail.feature"
43
106
  Then the results should include:
44
107
  """
45
- Expected to see: ["First", "Missing", "Second", "Uh-oh", "Third", "Not there"]
46
- Did not see: ["Missing", "Uh-oh", "Not there"] (Kelp::Unexpected)
47
- """
48
- And the results should include:
49
- """
50
- Expected not to see: ["First", "Missing", "Second", "Uh-oh", "Third", "Not there"]
51
- Did see: ["First", "Second", "Third"] (Kelp::Unexpected)
52
- """
108
+ Scenario: Should see text (FAIL)
109
+ Expected to see: ["First", "Missing", "Second", "Uh-oh", "Third", "Not there"]
110
+ Did not see: ["Missing", "Uh-oh", "Not there"] (Kelp::Unexpected)
111
+
112
+ Scenario: Should not see text (FAIL)
113
+ Expected not to see: ["First", "Missing", "Second", "Uh-oh", "Third", "Not there"]
114
+ Did see: ["First", "Second", "Third"] (Kelp::Unexpected)
115
+
116
+ Scenario: Should see text within a scope (FAIL)
117
+ Expected to see: ["Goodbye world"]
118
+ Did not see: ["Goodbye world"] (Kelp::Unexpected)
119
+
120
+ Scenario: Should not see text within a scope (FAIL)
121
+ Expected not to see: ["Hello world"]
122
+ Did see: ["Hello world"] (Kelp::Unexpected)
123
+
124
+ Scenario: Should see regexp (FAIL)
125
+ Expected to see: [/(Waffle|Pancake) world/]
126
+ Did not see: [/(Waffle|Pancake) world/] (Kelp::Unexpected)
53
127
 
128
+ Scenario: Should not see regexp (FAIL)
129
+ Expected not to see: [/(Hello|Goodbye) world/]
130
+ Did see: [/(Hello|Goodbye) world/] (Kelp::Unexpected)
131
+
132
+ Scenario: Should see text in table rows (FAIL)
133
+ | Eric | Delete |
134
+ Expected, but did not see: ["Eric", "Delete"] in the same row (Kelp::Unexpected)
135
+
136
+ Scenario: Should not see text in table rows (FAIL)
137
+ | Eric | Edit |
138
+ Did not expect, but did see: ["Eric", "Edit"] in the same row (Kelp::Unexpected)
139
+
140
+ 8 scenarios (8 failed)
141
+ 16 steps (8 failed, 8 passed)
142
+ """
54
143