tune_spec 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -1
- data/doctest_helper.rb +1 -0
- data/lib/tune_spec/configuration.rb +4 -1
- data/lib/tune_spec/instances/steps.rb +6 -2
- data/lib/tune_spec/version.rb +1 -1
- data/tune_spec.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ec581153a60aed89bdd7c2eb4e464f14bea33a4
|
4
|
+
data.tar.gz: acda8460fdccfda7b8ff09ee392315f26060ad12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98904e6624bd0e93f6be77b01173414565d195c6c581e74af148b87cc95d3e9171e9fe96a88e969b1bbc3cc5162ad47e620354088c4fabe9ebbd4fc00d173552
|
7
|
+
data.tar.gz: e7ef8d74dd3e0fdd931d059bd409a2c2bd31b88b67c90d5db1ba6f0eca38b3863a02699ef1f6ea9ef8b067d393d5bfe036dd6dfe6daa0a1b195e8a8298029526
|
data/Gemfile.lock
CHANGED
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/
|
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
@@ -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
|
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?(
|
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?(
|
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
|
data/lib/tune_spec/version.rb
CHANGED
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 = '
|
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.
|
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-
|
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:
|
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.
|
122
|
+
summary: tune_spec_0.3.1
|
123
123
|
test_files: []
|