lopata 0.1.13 → 0.1.17
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/README.md +25 -25
- data/exe/lopata +11 -11
- data/lib/lopata/active_record.rb +135 -135
- data/lib/lopata/condition.rb +30 -30
- data/lib/lopata/configuration.rb +125 -125
- data/lib/lopata/environment.rb +35 -35
- data/lib/lopata/factory_bot.rb +72 -72
- data/lib/lopata/generators/app.rb +42 -42
- data/lib/lopata/generators/templates/Gemfile +7 -7
- data/lib/lopata/generators/templates/Lopatafile +20 -20
- data/lib/lopata/generators/templates/config/environments/qa.yml +7 -7
- data/lib/lopata/generators/templates/config/initializers/capybara.rb +1 -1
- data/lib/lopata/id.rb +22 -22
- data/lib/lopata/loader.rb +31 -31
- data/lib/lopata/observers/backtrace_formatter.rb +103 -103
- data/lib/lopata/observers/base_observer.rb +33 -33
- data/lib/lopata/observers/console_output_observer.rb +100 -100
- data/lib/lopata/observers/web_logger.rb +130 -130
- data/lib/lopata/observers.rb +4 -4
- data/lib/lopata/role.rb +109 -109
- data/lib/lopata/runner.rb +80 -67
- data/lib/lopata/scenario.rb +136 -136
- data/lib/lopata/scenario_builder.rb +497 -497
- data/lib/lopata/shared_step.rb +38 -38
- data/lib/lopata/step.rb +191 -191
- data/lib/lopata/version.rb +6 -6
- data/lib/lopata/world.rb +24 -24
- data/lib/lopata.rb +123 -74
- metadata +4 -4
data/lib/lopata.rb
CHANGED
@@ -1,74 +1,123 @@
|
|
1
|
-
require 'lopata/id'
|
2
|
-
require 'lopata/configuration'
|
3
|
-
require 'lopata/environment'
|
4
|
-
require 'lopata/scenario_builder'
|
5
|
-
require 'lopata/scenario'
|
6
|
-
require 'lopata/step'
|
7
|
-
require 'lopata/shared_step'
|
8
|
-
|
9
|
-
# Namespace for all Lopata code.
|
10
|
-
module Lopata
|
11
|
-
# Define the scenario.
|
12
|
-
# @see Lopata::ScenarioBuilder.define
|
13
|
-
def self.define(*args, &block)
|
14
|
-
Lopata::ScenarioBuilder.define(*args, &block)
|
15
|
-
end
|
16
|
-
|
17
|
-
# Skip scenario definition. Option to temporary ignore scenario
|
18
|
-
def self.xdefine(*args, &block)
|
19
|
-
end
|
20
|
-
|
21
|
-
# Register the shared step
|
22
|
-
#
|
23
|
-
# @example
|
24
|
-
# Lopata.shared_step 'test user' do
|
25
|
-
# setup { @user = create(:user) }
|
26
|
-
# end
|
27
|
-
#
|
28
|
-
# Shared step may be used in scenarios by name:
|
29
|
-
# @example
|
30
|
-
# Lopata.define 'user' do
|
31
|
-
# setup 'test user'
|
32
|
-
#
|
33
|
-
# it 'exists' do
|
34
|
-
# expect(@user).to_not be_nil
|
35
|
-
# end
|
36
|
-
# end
|
37
|
-
# @param name [String] shared step unique name
|
38
|
-
# @param block [Block] shared step action sequence definition
|
39
|
-
def self.shared_step(name, &block)
|
40
|
-
Lopata::SharedStep.register(name, &block)
|
41
|
-
end
|
42
|
-
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
# @
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
#
|
70
|
-
#
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
1
|
+
require 'lopata/id'
|
2
|
+
require 'lopata/configuration'
|
3
|
+
require 'lopata/environment'
|
4
|
+
require 'lopata/scenario_builder'
|
5
|
+
require 'lopata/scenario'
|
6
|
+
require 'lopata/step'
|
7
|
+
require 'lopata/shared_step'
|
8
|
+
|
9
|
+
# Namespace for all Lopata code.
|
10
|
+
module Lopata
|
11
|
+
# Define the scenario.
|
12
|
+
# @see Lopata::ScenarioBuilder.define
|
13
|
+
def self.define(*args, &block)
|
14
|
+
Lopata::ScenarioBuilder.define(*args, &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Skip scenario definition. Option to temporary ignore scenario
|
18
|
+
def self.xdefine(*args, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Register the shared step
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Lopata.shared_step 'test user' do
|
25
|
+
# setup { @user = create(:user) }
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# Shared step may be used in scenarios by name:
|
29
|
+
# @example
|
30
|
+
# Lopata.define 'user' do
|
31
|
+
# setup 'test user'
|
32
|
+
#
|
33
|
+
# it 'exists' do
|
34
|
+
# expect(@user).to_not be_nil
|
35
|
+
# end
|
36
|
+
# end
|
37
|
+
# @param name [String] shared step unique name
|
38
|
+
# @param block [Block] shared step action sequence definition
|
39
|
+
def self.shared_step(name, &block)
|
40
|
+
Lopata::SharedStep.register(name, &block)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Register the shared step for setup.
|
44
|
+
#
|
45
|
+
# shared_setup is a shortcat for shared_step 'name' { setup { .. } }. The block will be arrounded into the setup call.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# Lopata.shared_setup 'test user' do
|
49
|
+
# @user = create(:user)
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# Shared step may be used in scenarios by name:
|
53
|
+
# @example
|
54
|
+
# Lopata.define 'user' do
|
55
|
+
# setup 'test user'
|
56
|
+
#
|
57
|
+
# it 'exists' do
|
58
|
+
# expect(@user).to_not be_nil
|
59
|
+
# end
|
60
|
+
# end
|
61
|
+
# @param name [String] shared step unique name
|
62
|
+
# @param block [Block] shared setup definition
|
63
|
+
def self.shared_setup(name, &block)
|
64
|
+
Lopata::SharedStep.register(name) do
|
65
|
+
setup(&block)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Register the shared step for context.
|
70
|
+
#
|
71
|
+
# shared_context is a shortcat for shared_step('name') { context('name') { .. } }. The block will be arrounded into the context call.
|
72
|
+
#
|
73
|
+
# @example
|
74
|
+
# Lopata.shared_context 'calculation' do
|
75
|
+
# it('correct') { expect(1 + 1).to eq 2 }
|
76
|
+
# it('incorrect') { expect(1 + 2).to eq 4 }
|
77
|
+
# end
|
78
|
+
#
|
79
|
+
# Shared context may be used in scenarios by name:
|
80
|
+
# @example
|
81
|
+
# Lopata.define 'verify calcuation in context' do
|
82
|
+
# verify 'calculation'
|
83
|
+
# end
|
84
|
+
# @param name [String] shared step unique name, will be used as a context's name
|
85
|
+
# @param block [Block] shared context definition
|
86
|
+
def self.shared_context(name, &block)
|
87
|
+
Lopata::SharedStep.register(name) do
|
88
|
+
context(name, &block)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Yields the global configuration to a block.
|
93
|
+
# @yield [Lopata::Configuration] global configuration
|
94
|
+
#
|
95
|
+
# @example
|
96
|
+
# Lopata.configure do |config|
|
97
|
+
# config.before_scenario 'setup test user'
|
98
|
+
# end
|
99
|
+
# @see Lopata::Configuration
|
100
|
+
def self.configure(&block)
|
101
|
+
yield Lopata.configuration
|
102
|
+
end
|
103
|
+
|
104
|
+
# Returns global configuration object.
|
105
|
+
# @return [Lopata::Configuration]
|
106
|
+
# @see Lopata.configure
|
107
|
+
def self.configuration
|
108
|
+
@configuration ||= Lopata::Configuration.new
|
109
|
+
end
|
110
|
+
|
111
|
+
# @private
|
112
|
+
# Internal container for global non-configuration data.
|
113
|
+
def self.world
|
114
|
+
@world ||= Lopata::World.new
|
115
|
+
end
|
116
|
+
|
117
|
+
# Return global environment object
|
118
|
+
# @return [Lopata::Environment]
|
119
|
+
# @see Lopata::Environment
|
120
|
+
def self.environment
|
121
|
+
Lopata.configuration.environment
|
122
|
+
end
|
123
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lopata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Volochnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -135,8 +135,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
rubygems_version: 3.
|
138
|
+
rubygems_version: 3.2.15
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
|
-
summary: lopata-0.1.
|
141
|
+
summary: lopata-0.1.17
|
142
142
|
test_files: []
|