allure-ruby-commons 2.13.5.rc.1 → 2.13.5.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/allure-ruby-commons.rb +9 -9
- data/lib/allure_ruby_commons/allure_lifecycle.rb +1 -1
- data/lib/allure_ruby_commons/config.rb +10 -9
- data/lib/allure_ruby_commons/file_writer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 581048b28120c18ec370a5f7ece97995f5f9bd0078cb3f17c00ff739eb9d3b2b
|
4
|
+
data.tar.gz: 03f1f125e6f50bd29a46084da967bde18f77d7e1c00c5ef1617b7a68f393bc07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25a402179621527683817fa38945a83b25300cef9794cc7b04c84b694e85deed38681a131c429cc6f0740291b98726cd70a2f2cabdc25e33eecd3168bcc95c1b
|
7
|
+
data.tar.gz: b40a85e6cf5d0867f39dcad5e94fe60e904a65961dd5e2058103f44b4b0b6f72b7d015088f421edd44ec5bb2ce0773f577cac3adff7439d94f245a10076dbb9e
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ you can just create the report of any other kind using the basic Allure terms.
|
|
11
11
|
Add the dependency to your Gemfile
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem
|
14
|
+
gem "allure-ruby-commons"
|
15
15
|
```
|
16
16
|
|
17
17
|
## Configuration
|
@@ -19,13 +19,13 @@ Add the dependency to your Gemfile
|
|
19
19
|
Following configuration options are supported:
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
Allure.configure do |
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
Allure.configure do |config|
|
23
|
+
config.results_directory = "/whatever/you/like"
|
24
|
+
config.clean_results_directory = true
|
25
|
+
config.logging_level = Logger::INFO
|
26
26
|
# these are used for creating links to bugs or test cases where {} is replaced with keys of relevant items
|
27
|
-
|
28
|
-
|
27
|
+
config.link_tms_pattern = "http://www.jira.com/browse/{}"
|
28
|
+
config.link_issue_pattern = "http://www.jira.com/browse/{}"
|
29
29
|
end
|
30
30
|
```
|
31
31
|
|
data/lib/allure-ruby-commons.rb
CHANGED
@@ -9,30 +9,30 @@ require_rel "allure_ruby_commons/**/*rb"
|
|
9
9
|
module Allure
|
10
10
|
class << self
|
11
11
|
# Get thread specific allure lifecycle object
|
12
|
-
# @return [
|
12
|
+
# @return [AllureLifecycle]
|
13
13
|
def lifecycle
|
14
14
|
Thread.current[:lifecycle] ||= AllureLifecycle.new
|
15
15
|
end
|
16
16
|
|
17
17
|
# Set lifecycle object
|
18
|
-
# @param [
|
18
|
+
# @param [AllureLifecycle] lifecycle
|
19
19
|
# @return [void]
|
20
20
|
def lifecycle=(lifecycle)
|
21
21
|
Thread.current[:lifecycle] = lifecycle
|
22
22
|
end
|
23
23
|
|
24
24
|
# Get allure configuration
|
25
|
-
# @return [
|
25
|
+
# @return [Config]
|
26
26
|
def configuration
|
27
|
-
Config
|
27
|
+
Config.instance
|
28
28
|
end
|
29
29
|
|
30
30
|
# Set allure configuration
|
31
|
-
# @yieldparam [
|
31
|
+
# @yieldparam [Config]
|
32
32
|
# @yieldreturn [void]
|
33
33
|
# @return [void]
|
34
34
|
def configure
|
35
|
-
yield(
|
35
|
+
yield(configuration)
|
36
36
|
end
|
37
37
|
|
38
38
|
# Add epic to current test case
|
@@ -131,7 +131,7 @@ module Allure
|
|
131
131
|
# Add attachment to current test case or step
|
132
132
|
# @param [String] name Attachment name
|
133
133
|
# @param [File, String] source File or string to save as attachment
|
134
|
-
# @param [String] type attachment type defined in {
|
134
|
+
# @param [String] type attachment type defined in {ContentType} or any other valid mime type
|
135
135
|
# @param [Boolean] test_case add attachment to current test case instead of test step
|
136
136
|
# @return [void]
|
137
137
|
def add_attachment(name:, source:, type:, test_case: false)
|
@@ -146,7 +146,7 @@ module Allure
|
|
146
146
|
end
|
147
147
|
|
148
148
|
# Add categories info
|
149
|
-
# @param [File, Array<
|
149
|
+
# @param [File, Array<Category>] categories
|
150
150
|
# @return [void]
|
151
151
|
def add_categories(categories)
|
152
152
|
lifecycle.write_categories(categories)
|
@@ -154,7 +154,7 @@ module Allure
|
|
154
154
|
|
155
155
|
# Add step with provided name and optional status to current test step, fixture or test case
|
156
156
|
# @param [String] name
|
157
|
-
# @param [Symbol] status
|
157
|
+
# @param [Symbol] status {Status}, {Status::PASSED} by default
|
158
158
|
# @return [void]
|
159
159
|
def step(name:, status: nil)
|
160
160
|
lifecycle.add_test_step(StepResult.new(name: name, status: status || Status::PASSED, stage: Stage::FINISHED))
|
@@ -1,26 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "logger"
|
4
|
+
require "singleton"
|
4
5
|
|
5
6
|
module Allure
|
6
7
|
# Allure configuration class
|
7
8
|
class Config
|
9
|
+
include Singleton
|
10
|
+
|
8
11
|
# @return [String] default allure results directory
|
9
12
|
DEFAULT_RESULTS_DIRECTORY = "reports/allure-results"
|
10
13
|
# @return [String] default loggin level
|
11
14
|
DEFAULT_LOGGING_LEVEL = Logger::INFO
|
12
15
|
|
13
|
-
|
14
|
-
|
15
|
-
attr_writer :results_directory, :logging_level
|
16
|
+
attr_accessor :link_tms_pattern, :link_issue_pattern, :clean_results_directory
|
17
|
+
attr_writer :results_directory, :logging_level
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
def results_directory
|
20
|
+
@results_directory || DEFAULT_RESULTS_DIRECTORY
|
21
|
+
end
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
end
|
23
|
+
def logging_level
|
24
|
+
@logging_level || DEFAULT_LOGGING_LEVEL
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure-ruby-commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.13.5.rc.
|
4
|
+
version: 2.13.5.rc.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrejs Cunskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uuid
|