spreewald 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 782da77b76273a09876285f8cc37e9855cec78b891ae80fdff94413d0b0747d1
4
- data.tar.gz: 3c85f3a589f466b48d2fce57b99a8bdb468c5672628becba955c69ded5cb642d
3
+ metadata.gz: 02a43b32f16090f64a87cea6adc814baaceb590ef8388863224620f782565e25
4
+ data.tar.gz: d474b73278a9b3c309c0898e83e1238715012f38cce70e3d8d13d77f9bcd8680
5
5
  SHA512:
6
- metadata.gz: 07de3d07cc658fbbc41f8441d897cbae26f5e2a03de17e159fbad72739f237ac20c3c762e9ab1a56a12d0a61b503a38fc9c49eb16c00481aad63bd267414f3a9
7
- data.tar.gz: 22c6e544d8555dc5ef1978a8de23595e183ef3288c2fe90006229db5ded468e89f0308998428ee84d437b7810bdc9f79ba7c081dce3e4ed1677573554b7efa3f
6
+ metadata.gz: c8c2ca98760710ddbda7a2aca39ec3208a1a01ab57e842a448dd14d5b3ba969834d6dc08638440e6979140f2fa22ef2ee152276ae2ae19363ef7294cad213cf5
7
+ data.tar.gz: 9eea3e603ab1e9cb5d3346c948f09ee3b8c4bbfdd811b76eef3a0fc778c3015c48a85f97c31d6be8833f94e22d2d4ed159ab374b1aa345f51ffeba7d0f5fa23e
@@ -3,11 +3,13 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## 2.7.0
7
+ - Add a step modifier to control different Capybara sessions: `... in the browser session "..."`. (see issue [#66](https://github.com/makandra/spreewald/issues/66))
8
+
6
9
  ## 2.6.0
7
10
  - The time steps do now work with the time helpers in ActiveSupport 4.1+ if the timecop gem is not included in the bundle. Please note that the two approaches branch. While ActiveSupport will freeze the time, Timecop will keep it running.
8
11
  - The steps in the file `spreewald/timecop.rb` file were moved to `spreewald/time.rb` and importing `spreewald/timecop` directly is deprecated now.
9
12
 
10
-
11
13
  ## 2.5.0
12
14
  - Add a set of steps to control browser tabs (Selenium only):
13
15
  * `I open ... in a new browser tab`
data/README.md CHANGED
@@ -286,6 +286,18 @@ the step definitions.
286
286
  This step is deprecated and will be removed from spreewald. If you still want to use it, copy the code to your project's own steps.
287
287
 
288
288
 
289
+ ### session_steps.rb
290
+
291
+ * **When ... in the browser session "..."**
292
+
293
+ You can append `in the browser session "name"` to any other step to execute
294
+ the step in a different browser session.
295
+
296
+ You may need to update other steps to allow multiple sessions (e.g. your
297
+ authentication steps have to support multiple logged in users).
298
+ More details [here](https://makandracards.com/makandra/474480-how-to-make-a-cucumber-test-work-with-multiple-browser-sessions).
299
+
300
+
289
301
  ### table_steps.rb
290
302
 
291
303
  * **Then I should( not)? see a table with (exactly )?the following rows( in any order)?:?**
@@ -0,0 +1,18 @@
1
+ # You can append `in the browser session "name"` to any other step to execute
2
+ # the step in a different browser session.
3
+ #
4
+ # You may need to update other steps to allow multiple sessions (e.g. your
5
+ # authentication steps have to support multiple logged in users).
6
+ # More details [here](https://makandracards.com/makandra/474480-how-to-make-a-cucumber-test-work-with-multiple-browser-sessions).
7
+ When /^(.*) in the browser session "([^"]+)"$/ do |nested_step, session_name|
8
+ Capybara.using_session(session_name) do
9
+ step(nested_step)
10
+ end
11
+ end.overridable(priority: 5)
12
+
13
+ # nodoc
14
+ When /^(.*) in the browser session "([^"]+)":$/ do |nested_step, session_name, table_or_string|
15
+ Capybara.using_session(session_name) do
16
+ step("#{nested_step}:", table_or_string)
17
+ end
18
+ end.overridable(priority: 5)
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '2.6.0'
2
+ VERSION = '2.7.0'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.6.0)
4
+ spreewald (2.7.0)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.6.0)
4
+ spreewald (2.7.0)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.6.0)
4
+ spreewald (2.7.0)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -0,0 +1 @@
1
+ ../../shared/features/shared/browser_tab_steps.feature
@@ -0,0 +1 @@
1
+ ../../shared/features/shared/session_steps.feature
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.6.0)
4
+ spreewald (2.7.0)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -0,0 +1 @@
1
+ ../../shared/features/shared/browser_tab_steps.feature
@@ -0,0 +1 @@
1
+ ../../shared/features/shared/session_steps.feature
@@ -0,0 +1 @@
1
+ %h1 First capybara session
@@ -0,0 +1 @@
1
+ %h1 Second capybara session
@@ -0,0 +1 @@
1
+ %h1 Third capybara session
@@ -25,6 +25,9 @@ Rails.application.routes.draw do
25
25
  get '/static_pages/overridden', to: 'static_pages#overridden'
26
26
  get '/static_pages/second_link_target', to: 'static_pages#second_link_target'
27
27
  get '/static_pages/see_element', to: 'static_pages#see_element'
28
+ get '/static_pages/session_1', to: 'static_pages#session_1'
29
+ get '/static_pages/session_2', to: 'static_pages#session_2'
30
+ get '/static_pages/session_3', to: 'static_pages#session_3'
28
31
  get '/static_pages/tab_1', to: 'static_pages#tab_1'
29
32
  get '/static_pages/tab_2', to: 'static_pages#tab_2'
30
33
  get '/static_pages/tab_3', to: 'static_pages#tab_3'
@@ -0,0 +1,29 @@
1
+ Feature: Browser session steps
2
+
3
+ Scenario: Browser sessions do not interfere with each other
4
+ Given I go to "/static_pages/session_1"
5
+ Then I should see "First capybara session"
6
+
7
+ When I go to "/static_pages/session_2" in the browser session "second"
8
+ And I go to "/static_pages/session_3" in the browser session "third"
9
+
10
+ # Different pages can be accessed on different browser sessions
11
+ Then I should see "Second capybara session" in the browser session "second"
12
+ And I should see "Third capybara session" in the browser session "third"
13
+
14
+ # The default session is not affected by actions in other sessions
15
+ But I should not see "Second capybara session"
16
+
17
+ # Other sessions are not affected by the main session
18
+ And I should not see "First capybara session" in the browser session "second"
19
+
20
+ # Other sessions are not affected by each other
21
+ And I should not see "Third capybara session" in the browser session "second"
22
+
23
+
24
+ Scenario: Steps with table arguments work in different browser sessions
25
+ When I go to "/tables/table1" in the browser session "tables"
26
+ Then I should see a table with the following rows in the browser session "tables":
27
+ | 1-1 | 1-2 | 1-3 |
28
+ | 2-1 | 2-2 | 2-3 |
29
+ | 3-1 | 3-2 | 3-3 |
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
@@ -158,6 +158,7 @@ files:
158
158
  - lib/spreewald/development_steps.rb
159
159
  - lib/spreewald/email_steps.rb
160
160
  - lib/spreewald/file_attachment_steps.rb
161
+ - lib/spreewald/session_steps.rb
161
162
  - lib/spreewald/table_steps.rb
162
163
  - lib/spreewald/time_steps.rb
163
164
  - lib/spreewald/timecop_steps.rb
@@ -250,9 +251,11 @@ files:
250
251
  - tests/rails-4_capybara-3/config/routes.rb
251
252
  - tests/rails-4_capybara-3/config/secrets.yml
252
253
  - tests/rails-4_capybara-3/db
254
+ - tests/rails-4_capybara-3/features/browser_tab_steps.feature
253
255
  - tests/rails-4_capybara-3/features/development_steps.feature
254
256
  - tests/rails-4_capybara-3/features/email_steps.feature
255
257
  - tests/rails-4_capybara-3/features/overriding.feature
258
+ - tests/rails-4_capybara-3/features/session_steps.feature
256
259
  - tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb
257
260
  - tests/rails-4_capybara-3/features/step_definitions/test_steps.rb
258
261
  - tests/rails-4_capybara-3/features/support/env.rb
@@ -303,9 +306,11 @@ files:
303
306
  - tests/rails-6_capybara-3/config/locales/en.yml
304
307
  - tests/rails-6_capybara-3/config/routes.rb
305
308
  - tests/rails-6_capybara-3/db
309
+ - tests/rails-6_capybara-3/features/browser_tab_steps.feature
306
310
  - tests/rails-6_capybara-3/features/development_steps.feature
307
311
  - tests/rails-6_capybara-3/features/email_steps.feature
308
312
  - tests/rails-6_capybara-3/features/overriding.feature
313
+ - tests/rails-6_capybara-3/features/session_steps.feature
309
314
  - tests/rails-6_capybara-3/features/step_definitions/.gitkeep
310
315
  - tests/rails-6_capybara-3/features/step_definitions/overriding_steps.rb
311
316
  - tests/rails-6_capybara-3/features/step_definitions/test_steps.rb
@@ -353,6 +358,9 @@ files:
353
358
  - tests/shared/app/views/static_pages/numbers.html.haml
354
359
  - tests/shared/app/views/static_pages/overridden.html.haml
355
360
  - tests/shared/app/views/static_pages/see_element.html.haml
361
+ - tests/shared/app/views/static_pages/session_1.haml
362
+ - tests/shared/app/views/static_pages/session_2.haml
363
+ - tests/shared/app/views/static_pages/session_3.haml
356
364
  - tests/shared/app/views/static_pages/tab_1.haml
357
365
  - tests/shared/app/views/static_pages/tab_2.haml
358
366
  - tests/shared/app/views/static_pages/tab_3.haml
@@ -371,6 +379,7 @@ files:
371
379
  - tests/shared/features/shared/development_steps.feature
372
380
  - tests/shared/features/shared/email_steps.feature
373
381
  - tests/shared/features/shared/overriding.feature
382
+ - tests/shared/features/shared/session_steps.feature
374
383
  - tests/shared/features/shared/step_definitions/overriding_steps.rb
375
384
  - tests/shared/features/shared/step_definitions/test_steps.rb
376
385
  - tests/shared/features/shared/table_steps.feature
@@ -473,9 +482,11 @@ test_files:
473
482
  - tests/rails-4_capybara-3/config/routes.rb
474
483
  - tests/rails-4_capybara-3/config/secrets.yml
475
484
  - tests/rails-4_capybara-3/db
485
+ - tests/rails-4_capybara-3/features/browser_tab_steps.feature
476
486
  - tests/rails-4_capybara-3/features/development_steps.feature
477
487
  - tests/rails-4_capybara-3/features/email_steps.feature
478
488
  - tests/rails-4_capybara-3/features/overriding.feature
489
+ - tests/rails-4_capybara-3/features/session_steps.feature
479
490
  - tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb
480
491
  - tests/rails-4_capybara-3/features/step_definitions/test_steps.rb
481
492
  - tests/rails-4_capybara-3/features/support/env.rb
@@ -526,9 +537,11 @@ test_files:
526
537
  - tests/rails-6_capybara-3/config/locales/en.yml
527
538
  - tests/rails-6_capybara-3/config/routes.rb
528
539
  - tests/rails-6_capybara-3/db
540
+ - tests/rails-6_capybara-3/features/browser_tab_steps.feature
529
541
  - tests/rails-6_capybara-3/features/development_steps.feature
530
542
  - tests/rails-6_capybara-3/features/email_steps.feature
531
543
  - tests/rails-6_capybara-3/features/overriding.feature
544
+ - tests/rails-6_capybara-3/features/session_steps.feature
532
545
  - tests/rails-6_capybara-3/features/step_definitions/.gitkeep
533
546
  - tests/rails-6_capybara-3/features/step_definitions/overriding_steps.rb
534
547
  - tests/rails-6_capybara-3/features/step_definitions/test_steps.rb
@@ -576,6 +589,9 @@ test_files:
576
589
  - tests/shared/app/views/static_pages/numbers.html.haml
577
590
  - tests/shared/app/views/static_pages/overridden.html.haml
578
591
  - tests/shared/app/views/static_pages/see_element.html.haml
592
+ - tests/shared/app/views/static_pages/session_1.haml
593
+ - tests/shared/app/views/static_pages/session_2.haml
594
+ - tests/shared/app/views/static_pages/session_3.haml
579
595
  - tests/shared/app/views/static_pages/tab_1.haml
580
596
  - tests/shared/app/views/static_pages/tab_2.haml
581
597
  - tests/shared/app/views/static_pages/tab_3.haml
@@ -594,6 +610,7 @@ test_files:
594
610
  - tests/shared/features/shared/development_steps.feature
595
611
  - tests/shared/features/shared/email_steps.feature
596
612
  - tests/shared/features/shared/overriding.feature
613
+ - tests/shared/features/shared/session_steps.feature
597
614
  - tests/shared/features/shared/step_definitions/overriding_steps.rb
598
615
  - tests/shared/features/shared/step_definitions/test_steps.rb
599
616
  - tests/shared/features/shared/table_steps.feature