Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 141 lines (130 sloc) 3.918 kB
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
1 @javascript
2 Feature: AJAX submissions
3 As a survey administrator
4 I want participants' responses to be saved as soon as possible
5
6 Scenario: With a simple pick-one question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
7 Given the question
8 """
9 q_1 "Was this saved?", :pick => :one
10 a_y "Yes"
11 a_n "No"
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
12 """
13 When I start the survey
14 And I choose "Yes"
15 Then there should be a response for answer "y"
16
17 Scenario: With a simple pick-any question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
18 Given the question
19 """
20 q_1 "What is the state of the cat?", :pick => :any
21 a_d "Dead"
22 a_a "Alive"
23 a_s "Sleeping"
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
24 """
25 When I start the survey
26 And I check "Alive"
27 And I check "Sleeping"
28 Then there should be a response for answer "a"
29 And there should be a response for answer "s"
30 And there should not be a response for answer "d"
31
32 Scenario: With a free text question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
33 Given the question
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
34 """
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
35 q_1 "What is your favorite movie?"
36 answer "Title", :string
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
37 """
38 When I start the survey
39 And I fill in "Title" with "The Shawshank Redemption"
40 And I click elsewhere
41 Then there should be a string response with value "The Shawshank Redemption"
42
43 Scenario: With a date question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
44 Given the question
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
45 """
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
46 q_1 "When do you want to depart?"
47 answer "Departure date", :date
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
48 """
49 When I start the survey
50 And I click "Departure date"
51 And I select "Mar" as the datepicker's month
52 And I select "2013" as the datepicker's year
53 And I follow "9"
54 Then there should be a date response with value "2013-03-09"
55
80bdb58 @rsutphin Add a datetime test, too. #328.
rsutphin authored
56 Scenario: With a datetime question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
57 Given the question
80bdb58 @rsutphin Add a datetime test, too. #328.
rsutphin authored
58 """
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
59 q_1 "When do you want to depart?"
60 answer "Departure date and time", :datetime
80bdb58 @rsutphin Add a datetime test, too. #328.
rsutphin authored
61 """
62 When I start the survey
63 And I click "Departure date and time"
64 And I select "Apr" as the datepicker's month
65 And I select "2013" as the datepicker's year
66 And I follow "8"
67 Then there should be a date response with value "2013-04-08 00:00:00"
68
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
69 # How to move the sliders progammatically?
70 @wip
71 Scenario: With a time question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
72 Given the question
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
73 """
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
74 q_1 "When do you want lunch?"
75 answer "Meal time", :time
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
76 """
77 When I start the survey
78 And I click "Meal time"
79 And ?
80 Then there should be a time response with value "11:45:00"
81
82 Scenario: With a pick-one plus free text question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
83 Given the question
84 """
85 q_1 "Where is Panama City?", :pick => :one
86 a_florida "Florida"
87 a_panama "Panama"
88 a_other :other, :string
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
89 """
90 When I start the survey
91 And I fill in the string for "other" with "Chicago"
92 Then I click elsewhere
93 And there should be a string response for answer "other" with value "Chicago"
94
95 # How to move the slider programmatically?
96 @wip
97 Scenario: With a slider
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
98 Given the question
99 """
100 q_1 "How many?", :pick => :one, :display_type => :slider
101 a_0 "None"
102 a_10 "Some"
103 a_100 "Lots"
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
104 """
105 When I start the survey
106 And ?
107 Then there should be a response for answer "100"
108
109 # Issue #339
110 Scenario: With a grid question
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
111 Given the question
112 """
113 grid "Tell us how often do you cover these each day" do
114 a_1 "1"
115 a_2 "2"
116 a_3 "3"
117 q_h "Head", :pick => :one
118 q_k "Knees", :pick => :one
119 q_t "Toes", :pick => :one
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
120 end
121 """
122 When I start the survey
123 And I choose "3"
124 Then there should be a response for answer "3"
125
126 Scenario: With a repeater
37aa37f @rsutphin Clean up the common case of a single question survey. Done with #328.
rsutphin authored
127 Given the question
128 """
129 repeater "List your former addresses" do
130 q "Address"
131 a_address_line "Line", :string
3de23ca @rsutphin Features for ajax response submissions. Done with #328.
rsutphin authored
132 end
133 """
134 When I start the survey
135 And I fill in the 1st string for "address_line" with "10 Downing St."
136 And I press "+ add row"
137 And I fill in the 2nd string for "address_line" with "1600 Penn Ave."
138 And I click elsewhere
139 Then there should be a string response for answer "address_line" with value "10 Downing St."
140 And there should be a string response for answer "address_line" with value "1600 Penn Ave."
Something went wrong with that request. Please try again.