acceptance_test2 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ class AcceptanceTest
2
+ VERSION = "0.9.0"
3
+ end
@@ -0,0 +1,19 @@
1
+ Feature: Using Wikipedia
2
+
3
+ @selenium
4
+ @search_with_drivers
5
+ Scenario: Searching with selenium for a term with submit
6
+
7
+ Given I am on wikipedia.com
8
+ When I enter word "Capybara"
9
+ And I submit request
10
+ Then I should see "Hydrochoerus hydrochaeris"
11
+
12
+ @webkit
13
+ @search_with_drivers
14
+ Scenario: Searching with selenium for a term with submit
15
+
16
+ Given I am on wikipedia.com
17
+ When I enter word "Capybara"
18
+ And I submit request
19
+ Then I should see "Hydrochoerus hydrochaeris"
@@ -0,0 +1,9 @@
1
+ Feature: Using Wikipedia
2
+
3
+ @search_with_pages
4
+ Scenario: Searching with selenium for a term with submit
5
+
6
+ Given I am on wikipedia.com
7
+ When I enter word "Capybara"
8
+ And I submit request
9
+ Then I should see "Capybara"
@@ -0,0 +1,15 @@
1
+ Feature: Using Wikipedia
2
+
3
+ @search_with_scenario_outline
4
+ Scenario Outline: Searching with selenium for a term with submit (embedded data)
5
+
6
+ Given I am on wikipedia.com
7
+ When I enter word <keyword>
8
+ And I submit request
9
+ Then I should see "<result>"
10
+
11
+ Examples:
12
+ | keyword | result |
13
+ | Capybara | Hydrochoerus hydrochaeris |
14
+ | Wombat | quadrupedal marsupials |
15
+ | Echidna | Tachyglossidae |
@@ -0,0 +1,16 @@
1
+ Feature: Using Wikipedia
2
+
3
+ @search_with_table
4
+ Scenario: Searching with selenium for a term with submit (embedded data)
5
+
6
+ Given I am on wikipedia.com
7
+ And I have the following data:
8
+ | key | value |
9
+ | keyword | Capybara |
10
+ | result | Hydrochoerus hydrochaeris |
11
+ Then "keyword" should be "Capybara"
12
+ And "result" should be "Hydrochoerus hydrochaeris"
13
+
14
+ When I enter word <keyword>
15
+ And I submit request
16
+ Then I should see <result>
@@ -0,0 +1,11 @@
1
+ require 'bundler/setup'
2
+
3
+ require 'minitest/autorun'
4
+ require 'minitest/capybara'
5
+ require 'minitest-metadata'
6
+ require 'minitest/reporters'
7
+
8
+ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new # spec-like progress
9
+
10
+ require 'acceptance_test/minitest/acceptance_spec'
11
+ require 'acceptance_test/capybara/capybara_helper'
@@ -0,0 +1,4 @@
1
+ require 'bundler/setup'
2
+
3
+ require 'acceptance_test/rspec/rspec_helper'
4
+
@@ -0,0 +1,5 @@
1
+ module CommonSteps
2
+ step "I should see :text" do |text|
3
+ expect(page).to have_content text
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ module MainPageSteps
2
+ step :visit_home_page, "I am on wikipedia.com"
3
+ def visit_home_page
4
+ visit('/')
5
+ end
6
+
7
+ step :enter_word, "I enter word :word"
8
+ def enter_word word
9
+ fill_in "searchInput", :with => word
10
+ end
11
+
12
+ step :submit_request, "I submit request"
13
+ def submit_request
14
+ find(".formBtn", match: :first).click
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ require 'steps/common_steps'
2
+
3
+ steps_for :search_with_drivers do
4
+ include CommonSteps
5
+
6
+ step "I am on wikipedia.com" do
7
+ visit('/')
8
+ end
9
+
10
+ step "I enter word :word" do |word|
11
+ fill_in "searchInput", :with => word
12
+ end
13
+
14
+ step "I submit request" do
15
+ find(".formBtn", match: :first).click
16
+ end
17
+
18
+ end
@@ -0,0 +1,8 @@
1
+ require 'steps/common_steps'
2
+ require 'steps/main_page_steps'
3
+
4
+ steps_for :search_with_pages do
5
+ include CommonSteps
6
+ include MainPageSteps
7
+
8
+ end
@@ -0,0 +1,18 @@
1
+ steps_for :search_with_scenario_outline do
2
+
3
+ step "I am on wikipedia.com" do
4
+ visit('/')
5
+ end
6
+
7
+ step "I enter word :word" do |word|
8
+ fill_in "searchInput", :with => word
9
+ end
10
+
11
+ step "I submit request" do
12
+ find(".formBtn", match: :first).click
13
+ end
14
+
15
+ step "I should see :text" do |text|
16
+ expect(page).to have_content text
17
+ end
18
+ end
@@ -0,0 +1,34 @@
1
+ steps_for :search_with_table do
2
+ step "I am on wikipedia.com" do
3
+ visit('/')
4
+ end
5
+
6
+ step "I have the following data:" do |table|
7
+ @test_data = {}
8
+
9
+ table.hashes.each do |hash|
10
+ @test_data[hash['key']] = hash['value']
11
+ end
12
+ end
13
+
14
+ step ":key should be :value" do |key, value|
15
+ expect(@test_data[key]).to eq value
16
+ end
17
+
18
+ step "I should see <:key>" do |key|
19
+ expect(page).to have_content @test_data[key]
20
+ end
21
+
22
+ step "I enter word <:key>" do |key|
23
+ fill_in "searchInput", :with => @test_data[key]
24
+ end
25
+
26
+ step "I submit request" do
27
+ find(".formBtn", match: :first).click
28
+ end
29
+
30
+ step "I should see :text" do |text|
31
+ expect(page).to have_content text
32
+ end
33
+
34
+ end
@@ -0,0 +1,16 @@
1
+ require 'bundler/setup'
2
+
3
+ require 'acceptance_test/rspec/rspec_helper'
4
+ require 'acceptance_test/turnip/turnip_helper'
5
+
6
+ $LOAD_PATH.unshift File.expand_path("../spec/support/features", File.dirname(__FILE__))
7
+
8
+ RspecHelper.instance.configure app_host: "http://wikipedia.org"
9
+
10
+ TurnipHelper.instance.configure report_file: 'output/wikipedia-turnip-report.html', steps_dir: "spec/support/features"
11
+
12
+ cmd = 'open -a "/Applications/Google Chrome.app" output/wikipedia-turnip-report.html'
13
+
14
+ RspecHelper.instance.run_on_specs_finished(cmd)
15
+
16
+
@@ -0,0 +1,34 @@
1
+ require_relative '../minitest_helper'
2
+
3
+ class GoogleSearchTest < AcceptanceSpec
4
+
5
+ Minitest::Spec.spec_type "Google Search", %q{
6
+ As a visitor
7
+ I want to be able to see results related to the search term I submit
8
+ So that I can find what I'm looking for
9
+ }
10
+
11
+ before do
12
+ config = {app_host: "http://www.google.com", wait_time: 15}
13
+
14
+ CapybaraHelper.instance.before_test config
15
+ end
16
+
17
+ after do
18
+ CapybaraHelper.instance.after_test
19
+ end
20
+
21
+ it "finding the answer to the question of life", js: true do
22
+ visit "/"
23
+
24
+ #CapybaraHelper.instance.take_screenshot
25
+
26
+ fill_in "q", :with => "the answer to the question of life"
27
+
28
+ find(:xpath, "//button[@name='btnG']").click # submit
29
+
30
+ page.must_have_content('42')
31
+ #assert page.has_content?("42")
32
+ #expect(page).to have_text("42")
33
+ end
34
+ end
@@ -0,0 +1,19 @@
1
+ require_relative '../rspec_helper'
2
+
3
+ config = {app_host: "http://wikipedia.org", wait_time: 15}
4
+
5
+ RspecHelper.instance.create_shared_context "WikipediaSearch"
6
+
7
+ RSpec.describe 'Wikipedia Search' do
8
+ include_context "WikipediaSearch", config
9
+
10
+ it "searches on wikipedia web site" do
11
+ visit('/')
12
+
13
+ fill_in "searchInput", :with => "Capybara"
14
+
15
+ find(".formBtn", match: :first).click
16
+
17
+ expect(page).to have_content "Hydrochoerus hydrochaeris"
18
+ end
19
+ end
@@ -0,0 +1,32 @@
1
+ require_relative '../minitest_helper'
2
+
3
+ class WikipediaSearchTest < AcceptanceSpec
4
+
5
+ Minitest::Spec.spec_type "Wikipedia Search", %q{
6
+ As a visitor
7
+ I want to be able to see results related to the search term I submit
8
+ So that I can find what I'm looking for
9
+ }
10
+
11
+ before do
12
+ config = {app_host: "http://wikipedia.org", wait_time: 15}
13
+
14
+ CapybaraHelper.instance.before_test config
15
+ end
16
+
17
+ after do
18
+ CapybaraHelper.instance.after_test
19
+ end
20
+
21
+ it "finding the information about capybara", js: true do
22
+ skip
23
+
24
+ visit "/"
25
+
26
+ fill_in "searchInput", :with => "capybara"
27
+
28
+ find(".formBtn", match: :first).click # submit
29
+
30
+ page.must_have_content('capybara')
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,285 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: acceptance_test2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Shvets
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 5.8.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 5.8.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest-capybara
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest-metadata
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.6.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-reporters
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.1.2
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.1.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: capybara
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.5.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.5.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: capybara-extensions
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.4.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.4.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: selenium-webdriver
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 2.47.1
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 2.47.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: capybara-webkit
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.7.1
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 1.7.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 3.3.0
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 3.3.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: turnip
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 1.3.1
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.3.1
153
+ - !ruby/object:Gem::Dependency
154
+ name: turnip_formatter
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.3.4
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.3.4
167
+ - !ruby/object:Gem::Dependency
168
+ name: gnawrnip
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.3.2
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.3.2
181
+ - !ruby/object:Gem::Dependency
182
+ name: gemspec_deps_gen
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: gemcutter
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ description: 'Description: simplifies congiguration and run of acceptance tests.'
210
+ email: alexander.shvets@gmail.com
211
+ executables: []
212
+ extensions: []
213
+ extra_rdoc_files: []
214
+ files:
215
+ - ".gitignore"
216
+ - ".ruby-gemset"
217
+ - ".ruby-version"
218
+ - CHANGES
219
+ - Gemfile
220
+ - LICENSE
221
+ - README.md
222
+ - Rakefile
223
+ - acceptance_test2.gemspec.erb
224
+ - lib/acceptance_test/capybara/capybara_helper.rb
225
+ - lib/acceptance_test/minitest/acceptance_spec.rb
226
+ - lib/acceptance_test/rspec/rspec_helper.rb
227
+ - lib/acceptance_test/turnip/turnip_helper.rb
228
+ - lib/acceptance_test/version.rb
229
+ - spec/features/search_with_drivers.feature
230
+ - spec/features/search_with_pages.feature
231
+ - spec/features/search_with_scenario_outline1.feature
232
+ - spec/features/search_with_table.feature
233
+ - spec/minitest_helper.rb
234
+ - spec/rspec_helper.rb
235
+ - spec/support/features/steps/common_steps.rb
236
+ - spec/support/features/steps/main_page_steps.rb
237
+ - spec/support/features/steps/search_with_drivers_steps.rb
238
+ - spec/support/features/steps/search_with_pages_steps.rb
239
+ - spec/support/features/steps/search_with_scenario_outline_steps.rb
240
+ - spec/support/features/steps/search_with_table_steps.rb
241
+ - spec/turnip_helper.rb
242
+ - spec/unit/google_search_test.rb
243
+ - spec/unit/wikipedia_search_spec.rb
244
+ - spec/unit/wikipedia_search_test.rb
245
+ homepage: http://github.com/shvets/acceptance_test2
246
+ licenses:
247
+ - MIT
248
+ metadata: {}
249
+ post_install_message:
250
+ rdoc_options: []
251
+ require_paths:
252
+ - lib
253
+ required_ruby_version: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ required_rubygems_version: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
263
+ requirements: []
264
+ rubyforge_project:
265
+ rubygems_version: 2.4.8
266
+ signing_key:
267
+ specification_version: 4
268
+ summary: Simplifies congiguration and run of acceptance tests.
269
+ test_files:
270
+ - spec/features/search_with_drivers.feature
271
+ - spec/features/search_with_pages.feature
272
+ - spec/features/search_with_scenario_outline1.feature
273
+ - spec/features/search_with_table.feature
274
+ - spec/minitest_helper.rb
275
+ - spec/rspec_helper.rb
276
+ - spec/support/features/steps/common_steps.rb
277
+ - spec/support/features/steps/main_page_steps.rb
278
+ - spec/support/features/steps/search_with_drivers_steps.rb
279
+ - spec/support/features/steps/search_with_pages_steps.rb
280
+ - spec/support/features/steps/search_with_scenario_outline_steps.rb
281
+ - spec/support/features/steps/search_with_table_steps.rb
282
+ - spec/turnip_helper.rb
283
+ - spec/unit/google_search_test.rb
284
+ - spec/unit/wikipedia_search_spec.rb
285
+ - spec/unit/wikipedia_search_test.rb