acceptance_test 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.idea/.rakeTasks +1 -1
- data/.idea/acceptance_test.iml +104 -81
- data/CHANGES +5 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +14 -0
- data/features/wikipedia/step_definitions/steps.rb +72 -0
- data/features/wikipedia/support/data.csv +3 -0
- data/features/wikipedia/support/env.rb +1 -0
- data/features/wikipedia/wikipedia_from_csv.feature +16 -0
- data/features/wikipedia/wikipedia_search.feature +28 -0
- data/lib/acceptance_test/acceptance_test.rb +85 -80
- data/lib/acceptance_test/cucumber_helper.rb +13 -31
- data/lib/acceptance_test/version.rb +1 -1
- data/spec/{features/acceptance_config.yml → acceptance_config.yml} +3 -1
- data/spec/wikipedia_search_spec.rb +46 -0
- data/spec/wikipedia_search_with_config_spec.rb +27 -0
- data/spec/wikipedia_search_with_steps.rb +35 -0
- metadata +20 -11
- data/lib/acceptance_test/acceptance_test_helper.rb +0 -75
- data/spec/features/google_search_spec.rb +0 -54
- data/spec/features/spec_helper.rb +0 -9
- data/spec/features/with_selenium_conf_spec.rb +0 -15
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTcyYjgyZDZhM2QwMTA3YThlMjAzNzZkZjZlNjYyYWNkOTA2MGVmMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTk4NmIzNDk1MTdjMzExZTlkMDlhMTQyZjQ2YWU0YmIzNTllNGYzZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWFlNWEwN2Y0Mjk4MDdhNGM0MWUzNTdlNDYxY2I2ZDMzNGU1ZTMwZTlmZWQx
|
10
|
+
YThjMWNjZDMwYWE3YzE0MWUyNmQ3NWVmYzczYjRkY2UzNmI0MWFjZDY2ZjJj
|
11
|
+
YjE1MGU5MjBiMjg3OWZlZGI2ZTRlNWI3OGYyODQxMGNhNTEyY2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDg0YWE3NDQwNGZjYTU1OTEzNWI5NzlkODViOTk4OTk4MTY1ZjE1NzhkMDgz
|
14
|
+
NjhjNGQ1NTA1YzkwOTQ5MWU3NDY2YmMxNzZkNzMxN2IyOTcyZDc5ZDRiZjE3
|
15
|
+
NzZjNWM1Njg5NjI1MTAyNjVhNWFlOTI5Y2RmZDZjNGQ5Mjk0NTM=
|
data/.idea/.rakeTasks
CHANGED
@@ -4,4 +4,4 @@ You are allowed to:
|
|
4
4
|
1. Remove rake task
|
5
5
|
2. Add existing rake tasks
|
6
6
|
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
-
--><RakeGroup description="" fullCmd="" taksId="rake"
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
data/.idea/acceptance_test.iml
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
</facet>
|
14
14
|
</component>
|
15
15
|
<component name="ModuleRunConfigurationManager">
|
16
|
-
<configuration default="false" name="
|
16
|
+
<configuration default="false" name="Run spec 'wikipedia_search_with_config_spec': acceptance_test" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
17
17
|
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
18
18
|
<module name="acceptance_test" />
|
19
19
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
@@ -33,7 +33,7 @@
|
|
33
33
|
</EXTENSION>
|
34
34
|
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
35
35
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
36
|
-
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/
|
36
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/wikipedia_search_with_config_spec.rb" />
|
37
37
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
38
38
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
39
39
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
|
@@ -45,24 +45,22 @@
|
|
45
45
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
46
46
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
47
47
|
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
48
|
-
<RunnerSettings RunnerId="RubyDebugRunner" />
|
49
48
|
<RunnerSettings RunnerId="RubyRunner" />
|
50
|
-
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
51
49
|
<ConfigurationWrapper RunnerId="RubyRunner" />
|
52
50
|
<method />
|
53
51
|
</configuration>
|
54
|
-
<configuration default="false" name="
|
55
|
-
<predefined_log_file id="
|
52
|
+
<configuration default="false" name="google_search: acceptance_test" type="CucumberRunConfigurationType" factoryName="Cucumber" temporary="true">
|
53
|
+
<predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
|
56
54
|
<module name="acceptance_test" />
|
57
|
-
<
|
58
|
-
<
|
59
|
-
<
|
60
|
-
<
|
61
|
-
<
|
55
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
56
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
57
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
58
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
59
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
62
60
|
<envs>
|
63
61
|
<env name="JRUBY_OPTS" value="-X+O" />
|
64
62
|
</envs>
|
65
|
-
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="
|
63
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
66
64
|
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
67
65
|
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
68
66
|
<COVERAGE_PATTERN ENABLED="true">
|
@@ -70,27 +68,36 @@
|
|
70
68
|
</COVERAGE_PATTERN>
|
71
69
|
</EXTENSION>
|
72
70
|
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
73
|
-
<
|
74
|
-
<
|
75
|
-
<
|
76
|
-
<
|
77
|
-
<
|
78
|
-
<
|
79
|
-
<
|
80
|
-
<
|
81
|
-
<
|
71
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
|
72
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
73
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
74
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/features/wikipedia/wikipedia_search.feature" />
|
75
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
|
76
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
|
77
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
|
78
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
79
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
80
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
|
81
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
82
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
83
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
84
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
|
85
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
|
86
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
|
87
|
+
<RunnerSettings RunnerId="RubyDebugRunner" />
|
82
88
|
<RunnerSettings RunnerId="RubyRunner" />
|
89
|
+
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
83
90
|
<ConfigurationWrapper RunnerId="RubyRunner" />
|
84
91
|
<method />
|
85
92
|
</configuration>
|
86
|
-
<configuration default="false" name="
|
87
|
-
<predefined_log_file id="
|
93
|
+
<configuration default="false" name="wikipedia_from_csv: acceptance_test" type="CucumberRunConfigurationType" factoryName="Cucumber" temporary="true">
|
94
|
+
<predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
|
88
95
|
<module name="acceptance_test" />
|
89
|
-
<
|
90
|
-
<
|
91
|
-
<
|
92
|
-
<
|
93
|
-
<
|
96
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
97
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
98
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
99
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
100
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
94
101
|
<envs>
|
95
102
|
<env name="JRUBY_OPTS" value="-X+O" />
|
96
103
|
</envs>
|
@@ -102,33 +109,36 @@
|
|
102
109
|
</COVERAGE_PATTERN>
|
103
110
|
</EXTENSION>
|
104
111
|
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
105
|
-
<
|
106
|
-
<
|
107
|
-
<
|
108
|
-
<
|
109
|
-
<
|
110
|
-
<
|
111
|
-
<
|
112
|
-
<
|
113
|
-
<
|
114
|
-
<
|
115
|
-
<
|
116
|
-
<
|
117
|
-
<
|
112
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
|
113
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
114
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
115
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/features/wikipedia/wikipedia_from_csv.feature" />
|
116
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
|
117
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
|
118
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
|
119
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
120
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
121
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
|
122
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
123
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
124
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
125
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
|
126
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
|
127
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
|
118
128
|
<RunnerSettings RunnerId="RubyDebugRunner" />
|
119
129
|
<RunnerSettings RunnerId="RubyRunner" />
|
120
130
|
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
121
131
|
<ConfigurationWrapper RunnerId="RubyRunner" />
|
122
132
|
<method />
|
123
133
|
</configuration>
|
124
|
-
<configuration default="false" name="
|
125
|
-
<predefined_log_file id="
|
134
|
+
<configuration default="false" name="Searching with selenium for a term with submit: acceptance_test (1)" type="CucumberRunConfigurationType" factoryName="Cucumber" temporary="true">
|
135
|
+
<predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
|
126
136
|
<module name="acceptance_test" />
|
127
|
-
<
|
128
|
-
<
|
129
|
-
<
|
130
|
-
<
|
131
|
-
<
|
137
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
138
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
139
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
140
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
141
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
132
142
|
<envs>
|
133
143
|
<env name="JRUBY_OPTS" value="-X+O" />
|
134
144
|
</envs>
|
@@ -140,33 +150,36 @@
|
|
140
150
|
</COVERAGE_PATTERN>
|
141
151
|
</EXTENSION>
|
142
152
|
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
143
|
-
<
|
144
|
-
<
|
145
|
-
<
|
146
|
-
<
|
147
|
-
<
|
148
|
-
<
|
149
|
-
<
|
150
|
-
<
|
151
|
-
<
|
152
|
-
<
|
153
|
-
<
|
154
|
-
<
|
155
|
-
<
|
153
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
|
154
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
155
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
156
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/features/wikipedia/wikipedia_from_csv.feature" />
|
157
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
|
158
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="^Searching with selenium for a term with submit$" />
|
159
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
|
160
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
161
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
162
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
|
163
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
164
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
165
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
166
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
|
167
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
|
168
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
|
156
169
|
<RunnerSettings RunnerId="RubyDebugRunner" />
|
157
170
|
<RunnerSettings RunnerId="RubyRunner" />
|
158
171
|
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
159
172
|
<ConfigurationWrapper RunnerId="RubyRunner" />
|
160
173
|
<method />
|
161
174
|
</configuration>
|
162
|
-
<configuration default="false" name="
|
163
|
-
<predefined_log_file id="
|
175
|
+
<configuration default="false" name="Searching with selenium for a term with submit: acceptance_test" type="CucumberRunConfigurationType" factoryName="Cucumber" temporary="true">
|
176
|
+
<predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
|
164
177
|
<module name="acceptance_test" />
|
165
|
-
<
|
166
|
-
<
|
167
|
-
<
|
168
|
-
<
|
169
|
-
<
|
178
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
179
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
180
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
181
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
182
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
170
183
|
<envs>
|
171
184
|
<env name="JRUBY_OPTS" value="-X+O" />
|
172
185
|
</envs>
|
@@ -178,20 +191,25 @@
|
|
178
191
|
</COVERAGE_PATTERN>
|
179
192
|
</EXTENSION>
|
180
193
|
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
181
|
-
<
|
182
|
-
<
|
183
|
-
<
|
184
|
-
<
|
185
|
-
<
|
186
|
-
<
|
187
|
-
<
|
188
|
-
<
|
189
|
-
<
|
190
|
-
<
|
191
|
-
<
|
192
|
-
<
|
193
|
-
<
|
194
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
|
195
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
196
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
197
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/features/wikipedia/wikipedia_from_csv.feature" />
|
198
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
|
199
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="^Searching with selenium for a term with submit$" />
|
200
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
|
201
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
202
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
203
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
|
204
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
205
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
206
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
207
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
|
208
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
|
209
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
|
210
|
+
<RunnerSettings RunnerId="RubyDebugRunner" />
|
194
211
|
<RunnerSettings RunnerId="RubyRunner" />
|
212
|
+
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
195
213
|
<ConfigurationWrapper RunnerId="RubyRunner" />
|
196
214
|
<method />
|
197
215
|
</configuration>
|
@@ -201,18 +219,21 @@
|
|
201
219
|
<orderEntry type="jdk" jdkName="RVM: ruby-1.9.3-p547 [acceptance_test]" jdkType="RUBY_SDK" />
|
202
220
|
<orderEntry type="sourceFolder" forTests="false" />
|
203
221
|
<orderEntry type="library" scope="PROVIDED" name="activesupport (v4.1.6, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
222
|
+
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
204
223
|
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
205
224
|
<orderEntry type="library" scope="PROVIDED" name="capybara (v2.4.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
206
225
|
<orderEntry type="library" scope="PROVIDED" name="capybara-firebug (v2.1.0, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
207
226
|
<orderEntry type="library" scope="PROVIDED" name="capybara-webkit (v1.3.0, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
208
227
|
<orderEntry type="library" scope="PROVIDED" name="childprocess (v0.5.3, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
209
228
|
<orderEntry type="library" scope="PROVIDED" name="cliver (v0.3.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
229
|
+
<orderEntry type="library" scope="PROVIDED" name="cucumber (v1.3.17, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
210
230
|
<orderEntry type="library" scope="PROVIDED" name="debugger-ruby_core_source (v1.3.5, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
211
231
|
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
212
232
|
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.9.3, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
213
233
|
<orderEntry type="library" scope="PROVIDED" name="file_utils (v1.0.7, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
214
234
|
<orderEntry type="library" scope="PROVIDED" name="gemcutter (v0.7.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
215
235
|
<orderEntry type="library" scope="PROVIDED" name="gemspec_deps_gen (v1.1.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
236
|
+
<orderEntry type="library" scope="PROVIDED" name="gherkin (v2.12.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
216
237
|
<orderEntry type="library" scope="PROVIDED" name="i18n (v0.6.11, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
217
238
|
<orderEntry type="library" scope="PROVIDED" name="json (v1.8.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
218
239
|
<orderEntry type="library" scope="PROVIDED" name="metaclass (v0.0.4, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
@@ -221,6 +242,7 @@
|
|
221
242
|
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.4.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
222
243
|
<orderEntry type="library" scope="PROVIDED" name="mocha (v1.1.0, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
223
244
|
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.10.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
245
|
+
<orderEntry type="library" scope="PROVIDED" name="multi_test (v0.1.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
224
246
|
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.6.3.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
225
247
|
<orderEntry type="library" scope="PROVIDED" name="poltergeist (v1.5.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
226
248
|
<orderEntry type="library" scope="PROVIDED" name="rack (v1.5.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
@@ -228,6 +250,7 @@
|
|
228
250
|
<orderEntry type="library" scope="PROVIDED" name="rake (v10.3.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
229
251
|
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.1.0, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
230
252
|
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.1.3, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
253
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-example_steps (v3.0.2, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
231
254
|
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.1.1, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
232
255
|
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.1.0, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
233
256
|
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.1.0, RVM: ruby-1.9.3-p547 [acceptance_test]) [gem]" level="application" />
|
data/CHANGES
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -7,6 +7,7 @@ GEM
|
|
7
7
|
minitest (~> 5.1)
|
8
8
|
thread_safe (~> 0.1)
|
9
9
|
tzinfo (~> 1.1)
|
10
|
+
builder (3.2.2)
|
10
11
|
capybara (2.4.1)
|
11
12
|
mime-types (>= 1.16)
|
12
13
|
nokogiri (>= 1.3.3)
|
@@ -22,6 +23,12 @@ GEM
|
|
22
23
|
childprocess (0.5.3)
|
23
24
|
ffi (~> 1.0, >= 1.0.11)
|
24
25
|
cliver (0.3.2)
|
26
|
+
cucumber (1.3.17)
|
27
|
+
builder (>= 2.1.2)
|
28
|
+
diff-lcs (>= 1.1.3)
|
29
|
+
gherkin (~> 2.12)
|
30
|
+
multi_json (>= 1.7.5, < 2.0)
|
31
|
+
multi_test (>= 0.1.1)
|
25
32
|
debugger-ruby_core_source (1.3.5)
|
26
33
|
diff-lcs (1.2.5)
|
27
34
|
ffi (1.9.3)
|
@@ -30,6 +37,8 @@ GEM
|
|
30
37
|
gemspec_deps_gen (1.1.2)
|
31
38
|
bundler
|
32
39
|
file_utils
|
40
|
+
gherkin (2.12.2)
|
41
|
+
multi_json (~> 1.3)
|
33
42
|
i18n (0.6.11)
|
34
43
|
json (1.8.1)
|
35
44
|
metaclass (0.0.4)
|
@@ -39,6 +48,7 @@ GEM
|
|
39
48
|
mocha (1.1.0)
|
40
49
|
metaclass (~> 0.0.1)
|
41
50
|
multi_json (1.10.1)
|
51
|
+
multi_test (0.1.1)
|
42
52
|
nokogiri (1.6.3.1)
|
43
53
|
mini_portile (= 0.6.0)
|
44
54
|
poltergeist (1.5.1)
|
@@ -56,6 +66,8 @@ GEM
|
|
56
66
|
rspec-mocks (~> 3.1.0)
|
57
67
|
rspec-core (3.1.3)
|
58
68
|
rspec-support (~> 3.1.0)
|
69
|
+
rspec-example_steps (3.0.2)
|
70
|
+
rspec-core (>= 3.0.0)
|
59
71
|
rspec-expectations (3.1.1)
|
60
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
61
73
|
rspec-support (~> 3.1.0)
|
@@ -89,12 +101,14 @@ DEPENDENCIES
|
|
89
101
|
capybara (~> 2.4.1)
|
90
102
|
capybara-firebug (~> 2.1.0)
|
91
103
|
capybara-webkit (~> 1.3.0)
|
104
|
+
cucumber (~> 1.3.17)
|
92
105
|
debugger-ruby_core_source
|
93
106
|
gemcutter
|
94
107
|
gemspec_deps_gen
|
95
108
|
mocha
|
96
109
|
poltergeist (~> 1.5.1)
|
97
110
|
rspec
|
111
|
+
rspec-example_steps (~> 3.0.2)
|
98
112
|
ruby-debug-base19x (= 0.11.30.pre12)
|
99
113
|
ruby-debug-ide (= 0.4.17)
|
100
114
|
selenium-webdriver (~> 2.43.0)
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'acceptance_test'
|
2
|
+
require 'acceptance_test/cucumber_helper.rb'
|
3
|
+
|
4
|
+
require 'csv'
|
5
|
+
|
6
|
+
acceptance_test = nil
|
7
|
+
|
8
|
+
cucumber_helper = CucumberHelper.instance
|
9
|
+
|
10
|
+
def create_acceptance_test scenario, cucumber_helper
|
11
|
+
source_type = cucumber_helper.source_type(scenario)
|
12
|
+
|
13
|
+
if source_type == 'file'
|
14
|
+
source_path = cucumber_helper.source_path(scenario)
|
15
|
+
|
16
|
+
keys = [["keyword"]]
|
17
|
+
values = CSV.read(File.expand_path(source_path))
|
18
|
+
|
19
|
+
cucumber_helper.set_outline_table scenario, keys, values
|
20
|
+
end
|
21
|
+
|
22
|
+
config_name = File.expand_path("spec/acceptance_config.yml")
|
23
|
+
config = HashWithIndifferentAccess.new(YAML.load_file(config_name))
|
24
|
+
|
25
|
+
AcceptanceTest.new config
|
26
|
+
end
|
27
|
+
|
28
|
+
Before do |scenario|
|
29
|
+
acceptance_test = create_acceptance_test(scenario, cucumber_helper)
|
30
|
+
|
31
|
+
acceptance_test.before cucumber_helper.metadata_from_scenario(scenario)
|
32
|
+
end
|
33
|
+
|
34
|
+
After do |scenario|
|
35
|
+
acceptance_test.after cucumber_helper.metadata_from_scenario(scenario)
|
36
|
+
|
37
|
+
reset_session!
|
38
|
+
end
|
39
|
+
|
40
|
+
Given(/^I am within wikipedia\.com$/) do
|
41
|
+
Capybara.app_host = "http://wikipedia.com"
|
42
|
+
end
|
43
|
+
|
44
|
+
Given /^I am on wikipedia\.com$/ do
|
45
|
+
visit('/')
|
46
|
+
end
|
47
|
+
|
48
|
+
When /^I enter "([^"]*)"$/ do |_|
|
49
|
+
fill_in "searchInput", :with => "Capybara"
|
50
|
+
end
|
51
|
+
|
52
|
+
When(/^I enter word (.*)$/) do |keyword|
|
53
|
+
keyword = keyword.gsub("\"", '')
|
54
|
+
|
55
|
+
fill_in "searchInput", :with => keyword
|
56
|
+
end
|
57
|
+
|
58
|
+
Then /^I should see css "([^"]*)"$/ do |css|
|
59
|
+
expect(page).to have_css(css)
|
60
|
+
end
|
61
|
+
|
62
|
+
When(/^click submit button$/) do
|
63
|
+
find(".formBtn", match: :first).click
|
64
|
+
end
|
65
|
+
|
66
|
+
Then(/^I should see results: "([^"]*)"$/) do |results|
|
67
|
+
expect(page).to have_content "Hydrochoerus hydrochaeris"
|
68
|
+
end
|
69
|
+
|
70
|
+
Then(/^I should see keyword results: (.*)$/) do |keyword|
|
71
|
+
expect(page).to have_content keyword
|
72
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'capybara/cucumber'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Feature: Using Wikipedia
|
2
|
+
|
3
|
+
Background: within wikipedia.com context
|
4
|
+
Given I am within wikipedia.com
|
5
|
+
|
6
|
+
@selenium
|
7
|
+
Scenario Outline: Searching with selenium for a term with submit
|
8
|
+
|
9
|
+
Given I am on wikipedia.com
|
10
|
+
When I enter word <keyword>
|
11
|
+
And click submit button
|
12
|
+
Then I should see keyword results: <keyword>
|
13
|
+
|
14
|
+
Examples:
|
15
|
+
| file |
|
16
|
+
| features/wikipedia/support/data.csv |
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: Using Wikipedia
|
2
|
+
|
3
|
+
Background: within wikipedia.com context
|
4
|
+
Given I am within wikipedia.com
|
5
|
+
|
6
|
+
@selenium
|
7
|
+
Scenario: Searching with selenium for a term with submit
|
8
|
+
|
9
|
+
Given I am on wikipedia.com
|
10
|
+
When I enter "Capybara"
|
11
|
+
And click submit button
|
12
|
+
Then I should see results: "Capybara"
|
13
|
+
|
14
|
+
@webkit
|
15
|
+
Scenario: Searching with selenium for a term with submit
|
16
|
+
|
17
|
+
Given I am on wikipedia.com
|
18
|
+
When I enter "Capybara"
|
19
|
+
And click submit button
|
20
|
+
Then I should see results: "Capybara"
|
21
|
+
|
22
|
+
@poltergeist
|
23
|
+
Scenario: Searching with selenium for a term with submit
|
24
|
+
|
25
|
+
Given I am on wikipedia.com
|
26
|
+
When I enter "Capybara"
|
27
|
+
And click submit button
|
28
|
+
Then I should see results: "Capybara"
|
@@ -1,23 +1,48 @@
|
|
1
1
|
require 'uri'
|
2
|
-
require '
|
2
|
+
require 'fileutils'
|
3
3
|
|
4
|
+
require 'capybara'
|
5
|
+
require "capybara/dsl"
|
4
6
|
require 'active_support/core_ext/hash'
|
5
7
|
|
6
|
-
require 'acceptance_test/acceptance_test_helper'
|
7
|
-
|
8
8
|
class AcceptanceTest
|
9
|
-
attr_reader :
|
10
|
-
attr_accessor :app_host
|
9
|
+
attr_reader :config
|
11
10
|
|
12
|
-
def initialize
|
13
|
-
|
14
|
-
|
11
|
+
def initialize config={}
|
12
|
+
if config
|
13
|
+
@config = config.kind_of?(HashWithIndifferentAccess) ? config : HashWithIndifferentAccess.new(config)
|
14
|
+
else
|
15
|
+
@config = HashWithIndifferentAccess.new
|
16
|
+
|
17
|
+
config[:screenshot_dir] = File.expand_path('tmp')
|
18
|
+
end
|
15
19
|
|
16
|
-
|
20
|
+
Capybara.configure do |conf|
|
21
|
+
conf.default_wait_time = timeout_in_seconds
|
22
|
+
conf.match = :first
|
17
23
|
|
18
|
-
|
24
|
+
conf.ignore_hidden_elements = false
|
25
|
+
end
|
26
|
+
|
27
|
+
ENV['APP_HOST'] ||= config[:webapp_url]
|
28
|
+
ENV['WAIT_TIME'] ||= Capybara.default_wait_time.to_s
|
29
|
+
|
30
|
+
# try to load capybara-related rspec library
|
31
|
+
begin
|
32
|
+
require 'capybara/rspec'
|
33
|
+
|
34
|
+
RSpec.configure do |config|
|
35
|
+
config.filter_run_excluding :exclude => true
|
36
|
+
end
|
37
|
+
|
38
|
+
RSpec.configure do |config|
|
39
|
+
config.include Capybara::DSL
|
40
|
+
end
|
19
41
|
|
20
|
-
|
42
|
+
RSpec::Core::ExampleGroup.send :include, Capybara::DSL
|
43
|
+
rescue
|
44
|
+
;
|
45
|
+
end
|
21
46
|
end
|
22
47
|
|
23
48
|
def before metadata={}
|
@@ -29,15 +54,17 @@ class AcceptanceTest
|
|
29
54
|
select_driver driver
|
30
55
|
end
|
31
56
|
|
32
|
-
|
33
|
-
|
34
|
-
setup_app_host app_host
|
57
|
+
Capybara.app_host = config[:webapp_url]
|
35
58
|
end
|
36
59
|
|
37
60
|
def after metadata={}, exception=nil, page=nil
|
38
61
|
driver = driver(metadata)
|
39
62
|
|
40
63
|
if driver and exception and page and not [:webkit].include? driver
|
64
|
+
screenshot_dir = File.expand_path(config[:screenshot_dir])
|
65
|
+
|
66
|
+
FileUtils.mkdir_p screenshot_dir
|
67
|
+
|
41
68
|
screenshot_maker = ScreenshotMaker.new screenshot_dir
|
42
69
|
|
43
70
|
screenshot_maker.make page, metadata
|
@@ -49,6 +76,36 @@ class AcceptanceTest
|
|
49
76
|
Capybara.current_driver = Capybara.default_driver
|
50
77
|
end
|
51
78
|
|
79
|
+
def create_shared_context name
|
80
|
+
throw "rspec library is not available" unless defined? RSpec
|
81
|
+
|
82
|
+
acceptance_test = self
|
83
|
+
|
84
|
+
acceptance_test_lambda = lambda do
|
85
|
+
attr_reader :acceptance_test
|
86
|
+
|
87
|
+
before :all do
|
88
|
+
@acceptance_test = acceptance_test
|
89
|
+
end
|
90
|
+
|
91
|
+
before do |example|
|
92
|
+
acceptance_test.before example.metadata
|
93
|
+
end
|
94
|
+
|
95
|
+
after do |example|
|
96
|
+
acceptance_test.after example.metadata, example.exception, page
|
97
|
+
|
98
|
+
self.reset_session!
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
RSpec.shared_context name do
|
103
|
+
self.define_singleton_method(:include_context, acceptance_test_lambda)
|
104
|
+
|
105
|
+
include_context
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
52
109
|
def driver metadata
|
53
110
|
driver = ENV['DRIVER'].nil? ? nil : ENV['DRIVER'].to_sym
|
54
111
|
|
@@ -69,50 +126,6 @@ class AcceptanceTest
|
|
69
126
|
|
70
127
|
private
|
71
128
|
|
72
|
-
def default_app_host
|
73
|
-
"http://#{AcceptanceTestHelper.instance.get_localhost}:3000"
|
74
|
-
end
|
75
|
-
|
76
|
-
def configure
|
77
|
-
run_server = (ENV['RUN_SERVER'] == "true")
|
78
|
-
|
79
|
-
if run_server and defined? Rails
|
80
|
-
require 'rspec/rails'
|
81
|
-
require "capybara/rails"
|
82
|
-
end
|
83
|
-
|
84
|
-
require "capybara"
|
85
|
-
require "capybara/dsl"
|
86
|
-
|
87
|
-
# try to load capybara-related rspec library
|
88
|
-
begin
|
89
|
-
require 'capybara/rspec'
|
90
|
-
rescue
|
91
|
-
;
|
92
|
-
end
|
93
|
-
|
94
|
-
if defined? RSpec
|
95
|
-
RSpec.configure do |config|
|
96
|
-
config.filter_run_excluding :exclude => true
|
97
|
-
end
|
98
|
-
|
99
|
-
RSpec.configure do |config|
|
100
|
-
config.include Capybara::DSL
|
101
|
-
end
|
102
|
-
|
103
|
-
RSpec::Core::ExampleGroup.send :include, Capybara::DSL
|
104
|
-
end
|
105
|
-
|
106
|
-
Capybara.configure do |config|
|
107
|
-
config.default_wait_time = timeout_in_seconds
|
108
|
-
|
109
|
-
config.run_server = run_server
|
110
|
-
end
|
111
|
-
|
112
|
-
ENV['APP_HOST'] ||= app_host
|
113
|
-
ENV['WAIT_TIME'] ||= Capybara.default_wait_time.to_s
|
114
|
-
end
|
115
|
-
|
116
129
|
def timeout_in_seconds
|
117
130
|
if ENV['WAIT_TIME']
|
118
131
|
ENV['WAIT_TIME'].to_i
|
@@ -188,10 +201,12 @@ class AcceptanceTest
|
|
188
201
|
def select_driver driver
|
189
202
|
if selenium_driver?(driver)
|
190
203
|
if driver == :selenium_remote
|
191
|
-
|
204
|
+
Capybara.current_driver = driver
|
205
|
+
Capybara.javascript_driver = driver
|
192
206
|
else
|
193
207
|
if acceptance_config_exist?
|
194
|
-
|
208
|
+
Capybara.current_driver = driver
|
209
|
+
Capybara.javascript_driver = driver
|
195
210
|
else
|
196
211
|
if Capybara.drivers[driver]
|
197
212
|
Capybara.current_driver = driver
|
@@ -207,28 +222,18 @@ class AcceptanceTest
|
|
207
222
|
end
|
208
223
|
end
|
209
224
|
|
210
|
-
def setup_app_host app_host
|
211
|
-
Capybara.app_host = app_host
|
212
|
-
Capybara.server_port = URI.parse(app_host).port
|
213
|
-
end
|
214
|
-
|
215
|
-
def app_host_from_url url
|
216
|
-
uri = URI(url)
|
217
|
-
|
218
|
-
"#{uri.scheme}://#{uri.host}:#{uri.port}"
|
219
|
-
end
|
220
|
-
|
221
225
|
def acceptance_config_exist?
|
222
226
|
not config.nil?
|
223
227
|
end
|
224
228
|
|
225
|
-
def
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
229
|
+
# def self.get_localhost
|
230
|
+
# orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily
|
231
|
+
#
|
232
|
+
# UDPSocket.open do |s|
|
233
|
+
# s.connect '192.168.1.1', 1
|
234
|
+
# s.addr.last
|
235
|
+
# end
|
236
|
+
# ensure
|
237
|
+
# Socket.do_not_reverse_lookup = orig
|
238
|
+
# end
|
234
239
|
end
|
@@ -5,42 +5,23 @@ require 'cucumber/ast/outline_table'
|
|
5
5
|
class CucumberHelper
|
6
6
|
include Singleton
|
7
7
|
|
8
|
-
def
|
9
|
-
|
8
|
+
def source_type scenario
|
9
|
+
examples = scenario.instance_variable_get(:@example_sections)
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def self.data # access to class instance variable
|
15
|
-
@data
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize(raw, scenario_outline)
|
19
|
-
new_raw = raw
|
20
|
-
|
21
|
-
name = raw[0][0]
|
22
|
-
|
23
|
-
if name == 'external_source'
|
24
|
-
test_name, parameter_name = raw[1][0].split(":")
|
25
|
-
|
26
|
-
if Cucumber::Ast::OutlineTable.data[test_name]
|
27
|
-
size = Cucumber::Ast::OutlineTable.data[test_name][parameter_name].size
|
11
|
+
examples[0][0][5][0][0]
|
12
|
+
end
|
28
13
|
|
29
|
-
|
30
|
-
|
14
|
+
def source_path scenario
|
15
|
+
examples = scenario.instance_variable_get(:@example_sections)
|
31
16
|
|
32
|
-
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
17
|
+
examples[0][0][5][1][0]
|
18
|
+
end
|
37
19
|
|
38
|
-
|
20
|
+
def set_outline_table scenario, keys, values
|
21
|
+
examples = scenario.instance_variable_get(:@example_sections)
|
39
22
|
|
40
|
-
|
41
|
-
|
42
|
-
init
|
43
|
-
end
|
23
|
+
if source_type(scenario) == 'file'
|
24
|
+
examples[0][0][5] = keys + values
|
44
25
|
end
|
45
26
|
end
|
46
27
|
|
@@ -59,4 +40,5 @@ class CucumberHelper
|
|
59
40
|
|
60
41
|
metadata
|
61
42
|
end
|
43
|
+
|
62
44
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'acceptance_test'
|
2
|
+
|
3
|
+
acceptance_test = AcceptanceTest.new({webapp_url: "http://www.wikipedia.org", timeout_in_seconds: 10})
|
4
|
+
|
5
|
+
RSpec.describe 'Wikipedia Search' do
|
6
|
+
|
7
|
+
before do |example|
|
8
|
+
puts "Using driver: #{Capybara.current_driver}."
|
9
|
+
puts "Default wait time: #{Capybara.default_wait_time}."
|
10
|
+
acceptance_test.before example.metadata
|
11
|
+
end
|
12
|
+
|
13
|
+
after do |example|
|
14
|
+
acceptance_test.after example.metadata
|
15
|
+
end
|
16
|
+
|
17
|
+
it "uses selenium driver", driver: :selenium, exclude: false do
|
18
|
+
visit('/')
|
19
|
+
|
20
|
+
fill_in "searchInput", :with => "Capybara"
|
21
|
+
|
22
|
+
find(".formBtn", match: :first).click
|
23
|
+
|
24
|
+
expect(page).to have_content "Hydrochoerus hydrochaeris"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "uses webkit driver", driver: :webkit do
|
28
|
+
visit('/')
|
29
|
+
|
30
|
+
fill_in "searchInput", :with => "Capybara"
|
31
|
+
|
32
|
+
find(".formBtn", match: :first).click
|
33
|
+
|
34
|
+
expect(page).to have_content "Hydrochoerus hydrochaeris"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "uses poltergeist driver", driver: :poltergeist do
|
38
|
+
visit('/')
|
39
|
+
|
40
|
+
fill_in "searchInput", :with => "Capybara"
|
41
|
+
|
42
|
+
find(".formBtn", match: :first).click
|
43
|
+
|
44
|
+
expect(page).to have_content "Hydrochoerus hydrochaeris"
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'acceptance_test'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
config_name = File.expand_path("spec/acceptance_config.yml")
|
5
|
+
config = config_name ? HashWithIndifferentAccess.new(YAML.load_file(config_name)) : {}
|
6
|
+
|
7
|
+
acceptance_test = AcceptanceTest.new config
|
8
|
+
|
9
|
+
acceptance_test.create_shared_context "WikipediaAcceptanceTest"
|
10
|
+
|
11
|
+
puts "Application URL : #{config[:webapp_url]}" if config[:webapp_url]
|
12
|
+
puts "Selenium URL : #{config[:selenium_url]}" if config[:selenium_url]
|
13
|
+
puts "Default Wait Time : #{Capybara.default_wait_time}"
|
14
|
+
|
15
|
+
RSpec.describe 'Wikipedia Search' do
|
16
|
+
include_context "WikipediaAcceptanceTest"
|
17
|
+
|
18
|
+
it "uses selenium driver", driver: :selenium do
|
19
|
+
visit('/')
|
20
|
+
|
21
|
+
fill_in "searchInput", :with => "Capybara"
|
22
|
+
|
23
|
+
find(".formBtn", match: :first).click
|
24
|
+
|
25
|
+
expect(page).to have_content "Hydrochoerus hydrochaeris"
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# ENV["RAILS_ENV"] ||= 'test'
|
2
|
+
# puts "Environment: #{ENV["RAILS_ENV"]}"
|
3
|
+
#
|
4
|
+
require 'rspec'
|
5
|
+
require 'rspec/example_steps'
|
6
|
+
require "capybara-webkit"
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.include Capybara::DSL
|
10
|
+
end
|
11
|
+
|
12
|
+
Capybara.app_host = "http://www.wikipedia.org"
|
13
|
+
Capybara.default_driver = :selenium
|
14
|
+
|
15
|
+
RSpec.describe "Searching" do
|
16
|
+
Steps "Result found" do
|
17
|
+
Given "I am on wikipedia.com" do
|
18
|
+
visit('/')
|
19
|
+
end
|
20
|
+
|
21
|
+
When "I enter \"Capybara\"" do
|
22
|
+
fill_in "searchInput", :with => "Capybara"
|
23
|
+
end
|
24
|
+
|
25
|
+
When "click submit button" do
|
26
|
+
find(".formBtn", match: :first).click
|
27
|
+
end
|
28
|
+
|
29
|
+
Then "I should see results" do
|
30
|
+
expect(page).to have_content "Hydrochoerus hydrochaeris"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acceptance_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shvets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gemspec_deps_gen
|
@@ -63,18 +63,22 @@ files:
|
|
63
63
|
- Rakefile
|
64
64
|
- acceptance_test.gemspec
|
65
65
|
- acceptance_test.gemspec.erb
|
66
|
+
- features/wikipedia/step_definitions/steps.rb
|
67
|
+
- features/wikipedia/support/data.csv
|
68
|
+
- features/wikipedia/support/env.rb
|
69
|
+
- features/wikipedia/wikipedia_from_csv.feature
|
70
|
+
- features/wikipedia/wikipedia_search.feature
|
66
71
|
- lib/acceptance_test.rb
|
67
72
|
- lib/acceptance_test/acceptance_test.rb
|
68
|
-
- lib/acceptance_test/acceptance_test_helper.rb
|
69
73
|
- lib/acceptance_test/cucumber_helper.rb
|
70
74
|
- lib/acceptance_test/page.rb
|
71
75
|
- lib/acceptance_test/page_set.rb
|
72
76
|
- lib/acceptance_test/screenshot_maker.rb
|
73
77
|
- lib/acceptance_test/version.rb
|
74
|
-
- spec/
|
75
|
-
- spec/
|
76
|
-
- spec/
|
77
|
-
- spec/
|
78
|
+
- spec/acceptance_config.yml
|
79
|
+
- spec/wikipedia_search_spec.rb
|
80
|
+
- spec/wikipedia_search_with_config_spec.rb
|
81
|
+
- spec/wikipedia_search_with_steps.rb
|
78
82
|
homepage: http://github.com/shvets/acceptance_test
|
79
83
|
licenses:
|
80
84
|
- MIT
|
@@ -100,7 +104,12 @@ signing_key:
|
|
100
104
|
specification_version: 4
|
101
105
|
summary: Simplifies congiguration and run of acceptance tests.
|
102
106
|
test_files:
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
+
- features/wikipedia/step_definitions/steps.rb
|
108
|
+
- features/wikipedia/support/data.csv
|
109
|
+
- features/wikipedia/support/env.rb
|
110
|
+
- features/wikipedia/wikipedia_from_csv.feature
|
111
|
+
- features/wikipedia/wikipedia_search.feature
|
112
|
+
- spec/acceptance_config.yml
|
113
|
+
- spec/wikipedia_search_spec.rb
|
114
|
+
- spec/wikipedia_search_with_config_spec.rb
|
115
|
+
- spec/wikipedia_search_with_steps.rb
|
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require 'singleton'
|
3
|
-
require 'active_support/core_ext/hash'
|
4
|
-
|
5
|
-
class AcceptanceTestHelper
|
6
|
-
include Singleton
|
7
|
-
|
8
|
-
def create_acceptance_test project_root, config_name, screenshot_dir
|
9
|
-
Capybara.configure do |config|
|
10
|
-
config.match = :first
|
11
|
-
|
12
|
-
config.ignore_hidden_elements = false
|
13
|
-
end
|
14
|
-
|
15
|
-
project_root = File.expand_path(project_root.to_s)
|
16
|
-
|
17
|
-
config = HashWithIndifferentAccess.new(YAML.load_file(config_name))
|
18
|
-
|
19
|
-
system "mkdir -p #{screenshot_dir}"
|
20
|
-
|
21
|
-
acceptance_test = AcceptanceTest.new project_root, config, screenshot_dir
|
22
|
-
|
23
|
-
ENV['ASSET_HOST'] = acceptance_test.app_host
|
24
|
-
|
25
|
-
puts "Application URL : #{config[:webapp_url]}"
|
26
|
-
puts "Selenium URL : #{config[:selenium_url]}" if config[:selenium_url]
|
27
|
-
puts "Default Wait Time : #{Capybara.default_wait_time}"
|
28
|
-
|
29
|
-
acceptance_test
|
30
|
-
end
|
31
|
-
|
32
|
-
def create_shared_context acceptance_test, name
|
33
|
-
throw "rspec library is not available" unless defined? RSpec
|
34
|
-
|
35
|
-
acceptance_test_lambda = lambda do
|
36
|
-
attr_reader :acceptance_test
|
37
|
-
|
38
|
-
before :all do
|
39
|
-
@acceptance_test = acceptance_test
|
40
|
-
end
|
41
|
-
|
42
|
-
before do
|
43
|
-
metadata = RSpec.current_example.metadata
|
44
|
-
|
45
|
-
acceptance_test.before metadata
|
46
|
-
end
|
47
|
-
|
48
|
-
after do
|
49
|
-
metadata = RSpec.current_example.metadata
|
50
|
-
|
51
|
-
acceptance_test.after metadata, RSpec.current_example.exception, page
|
52
|
-
|
53
|
-
self.reset_session!
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
RSpec.shared_context name do
|
58
|
-
self.define_singleton_method(:include_context, acceptance_test_lambda)
|
59
|
-
|
60
|
-
include_context
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def get_localhost
|
65
|
-
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily
|
66
|
-
|
67
|
-
UDPSocket.open do |s|
|
68
|
-
s.connect '192.168.1.1', 1
|
69
|
-
s.addr.last
|
70
|
-
end
|
71
|
-
ensure
|
72
|
-
Socket.do_not_reverse_lookup = orig
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require File.expand_path("spec/features/spec_helper")
|
2
|
-
|
3
|
-
RSpec.describe 'Google Search' do
|
4
|
-
include_context "GoogleAcceptanceTest"
|
5
|
-
|
6
|
-
before :all do
|
7
|
-
acceptance_test.app_host = "http://www.google.com"
|
8
|
-
end
|
9
|
-
|
10
|
-
before do
|
11
|
-
puts "Using driver: #{Capybara.current_driver}."
|
12
|
-
puts "Default wait time: #{Capybara.default_wait_time}."
|
13
|
-
end
|
14
|
-
|
15
|
-
it "uses selenium driver", driver: :selenium, exclude: false do
|
16
|
-
visit('/')
|
17
|
-
|
18
|
-
fill_in "q", :with => "Capybara"
|
19
|
-
|
20
|
-
find("#gbqfbw button").click
|
21
|
-
|
22
|
-
# all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
|
23
|
-
end
|
24
|
-
|
25
|
-
it "uses webkit driver", driver: :webkit do
|
26
|
-
pending
|
27
|
-
visit('/')
|
28
|
-
|
29
|
-
fill_in "q", :with => "Capybara"
|
30
|
-
|
31
|
-
has_selector? ".gsfs .gssb_g span.ds input.lsb", :visible => true # wait for ajax to be finished
|
32
|
-
|
33
|
-
button = first(".gsfs .gssb_g span.ds input.lsb")
|
34
|
-
|
35
|
-
button.click
|
36
|
-
|
37
|
-
#all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
|
38
|
-
end
|
39
|
-
|
40
|
-
it "uses poltergeist driver", driver: :poltergeist do
|
41
|
-
pending
|
42
|
-
visit('/')
|
43
|
-
|
44
|
-
fill_in "q", :with => "Capybara"
|
45
|
-
|
46
|
-
has_selector? ".gsfs .gssb_g span.ds input.lsb", :visible => true # wait for ajax to be finished
|
47
|
-
|
48
|
-
button = first(".gsfs .gssb_g span.ds input.lsb")
|
49
|
-
|
50
|
-
button.click
|
51
|
-
|
52
|
-
all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
|
53
|
-
end
|
54
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
require 'acceptance_test'
|
2
|
-
|
3
|
-
config_name = File.expand_path("spec/features/acceptance_config.yml")
|
4
|
-
|
5
|
-
helper = AcceptanceTestHelper.instance
|
6
|
-
|
7
|
-
acceptance_test = helper.create_acceptance_test ".", config_name, "tmp"
|
8
|
-
|
9
|
-
helper.create_shared_context acceptance_test, "GoogleAcceptanceTest"
|
@@ -1,15 +0,0 @@
|
|
1
|
-
File.expand_path("spec/features/spec_helper")
|
2
|
-
|
3
|
-
RSpec.describe 'Google Search' do
|
4
|
-
include_context "GoogleAcceptanceTest"
|
5
|
-
|
6
|
-
it "uses selenium driver", driver: :selenium_remote do
|
7
|
-
visit('/')
|
8
|
-
|
9
|
-
fill_in "q", :with => "Capybara"
|
10
|
-
|
11
|
-
find("#gbqfbw button").click
|
12
|
-
|
13
|
-
all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
|
14
|
-
end
|
15
|
-
end
|