tune_spec 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 94acadc6b27a86f11ef371aac9e2a90f180ea57b
4
- data.tar.gz: 28eee0395583b8732170a452bec26176ecb2f1d0
3
+ metadata.gz: 4ec581153a60aed89bdd7c2eb4e464f14bea33a4
4
+ data.tar.gz: acda8460fdccfda7b8ff09ee392315f26060ad12
5
5
  SHA512:
6
- metadata.gz: d4377597a557a0ddc9208e1fb88be8204debdced3dd17f2325f1580e0c9efa1a7a827d35dd3cd4500a15f20f35ac08a0253c6e799f528b97f673212e745becbf
7
- data.tar.gz: 916bf7c6f7c77d25ffd7d4b0467b8991bbd6ffbc62ddcb63aa2ab8bb514a0afaadc18c1fffab1f5639ac59f86430072da8c7f89e3752777d466aad767a38972d
6
+ metadata.gz: 98904e6624bd0e93f6be77b01173414565d195c6c581e74af148b87cc95d3e9171e9fe96a88e969b1bbc3cc5162ad47e620354088c4fabe9ebbd4fc00d173552
7
+ data.tar.gz: e7ef8d74dd3e0fdd931d059bd409a2c2bd31b88b67c90d5db1ba6f0eca38b3863a02699ef1f6ea9ef8b067d393d5bfe036dd6dfe6daa0a1b195e8a8298029526
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tune_spec (0.3.0)
4
+ tune_spec (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -54,6 +54,16 @@ steps(:login).login_with_valid_credentials
54
54
  steps(:login).verify_login
55
55
  ```
56
56
 
57
+ If you have steps class not associated with a particular page you may want to use dependency injection:
58
+ ```ruby
59
+ steps(:header, page: :home).verify_menu
60
+ ```
61
+ In this case it creates a `#header_steps` method that stores an instance of `HeaderSteps` and a `#home_page` method with an instance of `HomePage` as a page object of `HeaderSteps`. Next time you call this step it will return the same instance unless you change the page object associated with it.
62
+ Page initialization argument is set to `:page` by default. Can be changed with:
63
+ ```ruby
64
+ TuneSpec.steps_page_arg = :page
65
+ ```
66
+
57
67
  You can go further and organize your steps within a group when details don't matter
58
68
  ```ruby
59
69
  groups(:login).complete
@@ -76,7 +86,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
76
86
 
77
87
  ## Contributing
78
88
 
79
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tune_spec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
89
+ Bug reports and pull requests are welcome on GitHub at https://github.com/igor-starostenko/tune_spec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
80
90
 
81
91
  ## License
82
92
 
data/doctest_helper.rb CHANGED
@@ -8,6 +8,7 @@ TEST_ENV = 'STG'
8
8
 
9
9
  TuneSpec.configure do |conf|
10
10
  conf.directory = 'test'
11
+ conf.steps_page_arg = :page_object
11
12
  conf.groups_opts = { env: TEST_ENV }
12
13
  conf.steps_opts = { env: TEST_ENV }
13
14
  conf.page_opts = { env: TEST_ENV }
@@ -3,10 +3,13 @@
3
3
  module TuneSpec
4
4
  # Defines all configurable attributes of TuneSpec
5
5
  module Configuration
6
- VALID_CONFIG_KEYS = %i[directory page_opts steps_opts groups_opts].freeze
6
+ VALID_CONFIG_KEYS = %i[directory steps_page_arg
7
+ page_opts steps_opts groups_opts].freeze
7
8
 
8
9
  DEFAULT_DIRECTORY = 'lib'
9
10
 
11
+ DEFAULT_STEPS_PAGE_ARG = :page
12
+
10
13
  DEFAULT_PAGE_OPTS = {}.freeze
11
14
 
12
15
  DEFAULT_STEPS_OPTS = {}.freeze
@@ -17,18 +17,22 @@ module TuneSpec
17
17
  # Verifies if the step requires a page_object
18
18
  def same_page?(instance, page)
19
19
  return false unless instance
20
- return true unless instance.respond_to?(:page_object)
20
+ return true unless instance.respond_to?(page_arg)
21
21
  return true unless general_steps?(instance)
22
22
  page.instance_of?(instance.page_object.class)
23
23
  end
24
24
 
25
25
  def general_steps?(instance)
26
- argument_required?(:page_object, instance.class)
26
+ argument_required?(page_arg, instance.class)
27
27
  end
28
28
 
29
29
  def file_directory
30
30
  "#{TuneSpec.directory}/#{type}"
31
31
  end
32
+
33
+ def page_arg
34
+ TuneSpec.steps_page_arg
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TuneSpec
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
data/tune_spec.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.email = ['contactigorstar@gmail.com']
12
12
 
13
13
  spec.summary = "tune_spec_#{TuneSpec::VERSION}"
14
- spec.description = 'In Development. e2e Ruby tests in Page Objects'
14
+ spec.description = 'e2e Ruby tests in Page Objects'
15
15
  spec.homepage = 'https://github.com/igor-starostenko/tune_spec'
16
16
  spec.license = 'MIT'
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tune_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Starostenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-14 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.1.10
69
- description: In Development. e2e Ruby tests in Page Objects
69
+ description: e2e Ruby tests in Page Objects
70
70
  email:
71
71
  - contactigorstar@gmail.com
72
72
  executables:
@@ -119,5 +119,5 @@ rubyforge_project:
119
119
  rubygems_version: 2.6.12
120
120
  signing_key:
121
121
  specification_version: 4
122
- summary: tune_spec_0.3.0
122
+ summary: tune_spec_0.3.1
123
123
  test_files: []