perfecto-reporting 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +13 -0
- data/README.md +68 -0
- data/lib/perfecto-reporting.rb +20 -20
- data/lib/perfecto-reporting/client/PerfectoReportiumClient.rb +168 -168
- data/lib/perfecto-reporting/client/ReportiumClientFactory.rb +8 -8
- data/lib/perfecto-reporting/client/constants.rb +6 -6
- data/lib/perfecto-reporting/exceptions/ReportiumException.rb +11 -11
- data/lib/perfecto-reporting/license.txt +13 -0
- data/lib/perfecto-reporting/model/CustomField.rb +10 -10
- data/lib/perfecto-reporting/model/Job.rb +20 -20
- data/lib/perfecto-reporting/model/PerfectoExecutionContext.rb +112 -112
- data/lib/perfecto-reporting/model/Project.rb +19 -19
- data/lib/perfecto-reporting/test/TestContext.rb +64 -64
- data/lib/perfecto-reporting/test/result/TestResult.rb +13 -13
- data/lib/perfecto-reporting/test/result/TestResultFactory.rb +36 -36
- data/lib/perfecto-reporting/test/result/TestResultFailure.rb +39 -39
- data/lib/perfecto-reporting/test/result/TestResultSuccess.rb +17 -17
- data/lib/perfecto-reporting/version.rb +7 -7
- metadata +5 -2
@@ -1,9 +1,9 @@
|
|
1
|
-
require_relative 'PerfectoReportiumClient'
|
2
|
-
|
3
|
-
class ReportiumClientFactory
|
4
|
-
|
5
|
-
def self.createPerfectoReportiumClient(perfectoExecutionContext)
|
6
|
-
return PerfectoReportiumClient.new perfectoExecutionContext
|
7
|
-
end
|
8
|
-
|
1
|
+
require_relative 'PerfectoReportiumClient'
|
2
|
+
|
3
|
+
class ReportiumClientFactory
|
4
|
+
|
5
|
+
def self.createPerfectoReportiumClient(perfectoExecutionContext)
|
6
|
+
return PerfectoReportiumClient.new perfectoExecutionContext
|
7
|
+
end
|
8
|
+
|
9
9
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
# Test Commands
|
2
|
-
$START_TEST_COMMAND = 'mobile:test:start'
|
3
|
-
$TEST_STEP_COMMAND = 'mobile:test:step'
|
4
|
-
$END_STEP_COMMAND = 'mobile:step:end'
|
5
|
-
$START_STEP_COMMAND='mobile:step:start'
|
6
|
-
$END_TEST_COMMAND = 'mobile:test:end'
|
1
|
+
# Test Commands
|
2
|
+
$START_TEST_COMMAND = 'mobile:test:start'
|
3
|
+
$TEST_STEP_COMMAND = 'mobile:test:step'
|
4
|
+
$END_STEP_COMMAND = 'mobile:step:end'
|
5
|
+
$START_STEP_COMMAND='mobile:step:start'
|
6
|
+
$END_TEST_COMMAND = 'mobile:test:end'
|
7
7
|
$ASSERT_COMMAND = 'mobile:status:assert'
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
2
|
-
# Instance denoting customized reporting exception
|
3
|
-
class ReportiumException < StandardError
|
4
|
-
|
5
|
-
# Create new instance
|
6
|
-
#
|
7
|
-
# msg - new message to be attached to the exception
|
8
|
-
def initialize msg
|
9
|
-
super(msg)
|
10
|
-
end
|
11
|
-
|
1
|
+
|
2
|
+
# Instance denoting customized reporting exception
|
3
|
+
class ReportiumException < StandardError
|
4
|
+
|
5
|
+
# Create new instance
|
6
|
+
#
|
7
|
+
# msg - new message to be attached to the exception
|
8
|
+
def initialize msg
|
9
|
+
super(msg)
|
10
|
+
end
|
11
|
+
|
12
12
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2019 Perfecto
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
@@ -1,11 +1,11 @@
|
|
1
|
-
# CustomField - class
|
2
|
-
# Defines a hash list of all the custom field values defined for the test context
|
3
|
-
# The context fields should be saved as part of the Context and attached to the test report
|
4
|
-
#
|
5
|
-
class CustomField
|
6
|
-
attr_accessor :key, :value
|
7
|
-
def initialize(key, value)
|
8
|
-
@key = key
|
9
|
-
@value = value
|
10
|
-
end
|
1
|
+
# CustomField - class
|
2
|
+
# Defines a hash list of all the custom field values defined for the test context
|
3
|
+
# The context fields should be saved as part of the Context and attached to the test report
|
4
|
+
#
|
5
|
+
class CustomField
|
6
|
+
attr_accessor :key, :value
|
7
|
+
def initialize(key, value)
|
8
|
+
@key = key
|
9
|
+
@value = value
|
10
|
+
end
|
11
11
|
end
|
@@ -1,21 +1,21 @@
|
|
1
|
-
|
2
|
-
# Job
|
3
|
-
# Defines a job which runs the test / group of tests
|
4
|
-
#
|
5
|
-
# This can be used in order to locate specific job in reporting ui
|
6
|
-
class Job
|
7
|
-
|
8
|
-
attr_accessor :name, :number, :br_name
|
9
|
-
|
10
|
-
# initialize a new job instance
|
11
|
-
def initialize name, number
|
12
|
-
@name = name
|
13
|
-
@number = number
|
14
|
-
end
|
15
|
-
|
16
|
-
def withBranch(brName)
|
17
|
-
@br_name = brName
|
18
|
-
return self
|
19
|
-
end
|
20
|
-
|
1
|
+
|
2
|
+
# Job
|
3
|
+
# Defines a job which runs the test / group of tests
|
4
|
+
#
|
5
|
+
# This can be used in order to locate specific job in reporting ui
|
6
|
+
class Job
|
7
|
+
|
8
|
+
attr_accessor :name, :number, :br_name
|
9
|
+
|
10
|
+
# initialize a new job instance
|
11
|
+
def initialize name, number
|
12
|
+
@name = name
|
13
|
+
@number = number
|
14
|
+
end
|
15
|
+
|
16
|
+
def withBranch(brName)
|
17
|
+
@br_name = brName
|
18
|
+
return self
|
19
|
+
end
|
20
|
+
|
21
21
|
end
|
@@ -1,112 +1,112 @@
|
|
1
|
-
require_relative '../exceptions/ReportiumException'
|
2
|
-
require_relative '../model/CustomField'
|
3
|
-
|
4
|
-
# PerfectoExecutionContext
|
5
|
-
#
|
6
|
-
# This class defines the high-level execution context for all tests.
|
7
|
-
#
|
8
|
-
# Creating instance of this class possible only with PerfectoExecutionContextBuilder instance.
|
9
|
-
class PerfectoExecutionContext
|
10
|
-
|
11
|
-
attr_accessor :job, :project, :webdriver, :contextTags, :customFields
|
12
|
-
|
13
|
-
# create new instance
|
14
|
-
#
|
15
|
-
# perfectoExecutionContextBuilder -
|
16
|
-
# raise ReportiumException if driver not given.
|
17
|
-
def initialize (perfectoExecutionContextBuilder)
|
18
|
-
|
19
|
-
# execution is not possible without webdriver.
|
20
|
-
if perfectoExecutionContextBuilder.webdriver.nil?
|
21
|
-
raise ReportiumException.new('Missing required webdriver argument.')
|
22
|
-
end
|
23
|
-
|
24
|
-
@job = perfectoExecutionContextBuilder.job
|
25
|
-
@project = perfectoExecutionContextBuilder.project
|
26
|
-
@webdriver = perfectoExecutionContextBuilder.webdriver
|
27
|
-
@contextTags = perfectoExecutionContextBuilder.contextTags
|
28
|
-
@customFields = perfectoExecutionContextBuilder.customFields
|
29
|
-
|
30
|
-
end
|
31
|
-
|
32
|
-
# PerfectoExecutionContext
|
33
|
-
#
|
34
|
-
# This class used to create PerfectoExecutionContext instance
|
35
|
-
#
|
36
|
-
# example:
|
37
|
-
# perfectoExecutionContext::perfectoExecutionContextBuilder
|
38
|
-
# .withJob("job name" , job number )
|
39
|
-
# .withProject("project name" , project version)
|
40
|
-
# .withWebDriver(driver)
|
41
|
-
# .build()
|
42
|
-
class PerfectoExecutionContextBuilder
|
43
|
-
|
44
|
-
@@job = nil
|
45
|
-
@@project = nil
|
46
|
-
@@webdriver = nil
|
47
|
-
@@contextTags = nil
|
48
|
-
@@customFields = Hash.new
|
49
|
-
|
50
|
-
# define a job
|
51
|
-
def self.withJob job
|
52
|
-
@@job = job
|
53
|
-
return self
|
54
|
-
end
|
55
|
-
|
56
|
-
# define a project
|
57
|
-
def self.withProject project
|
58
|
-
@@project = project
|
59
|
-
return self
|
60
|
-
end
|
61
|
-
|
62
|
-
# define webdriver
|
63
|
-
def self.withWebDriver webdriver
|
64
|
-
@@webdriver = webdriver
|
65
|
-
return self
|
66
|
-
end
|
67
|
-
|
68
|
-
# define contextTags
|
69
|
-
def self.withContextTags *args
|
70
|
-
@@contextTags = args
|
71
|
-
return self
|
72
|
-
end
|
73
|
-
|
74
|
-
# define the custom fields, overriding any existing definition
|
75
|
-
def self.withCustomFields *args
|
76
|
-
unless args.nil?
|
77
|
-
args.each do |cf|
|
78
|
-
@@customFields[cf.key] = cf.value
|
79
|
-
end
|
80
|
-
end
|
81
|
-
return self
|
82
|
-
end
|
83
|
-
|
84
|
-
# building a new builder instance
|
85
|
-
def self.build
|
86
|
-
return self.new
|
87
|
-
end
|
88
|
-
|
89
|
-
def job
|
90
|
-
@@job
|
91
|
-
end
|
92
|
-
|
93
|
-
def project
|
94
|
-
@@project
|
95
|
-
end
|
96
|
-
|
97
|
-
def contextTags
|
98
|
-
@@contextTags
|
99
|
-
end
|
100
|
-
|
101
|
-
def customFields
|
102
|
-
@@customFields
|
103
|
-
end
|
104
|
-
|
105
|
-
def webdriver
|
106
|
-
@@webdriver
|
107
|
-
end
|
108
|
-
|
109
|
-
end # end PerfectoExecutionContextBuilder
|
110
|
-
|
111
|
-
end
|
112
|
-
|
1
|
+
require_relative '../exceptions/ReportiumException'
|
2
|
+
require_relative '../model/CustomField'
|
3
|
+
|
4
|
+
# PerfectoExecutionContext
|
5
|
+
#
|
6
|
+
# This class defines the high-level execution context for all tests.
|
7
|
+
#
|
8
|
+
# Creating instance of this class possible only with PerfectoExecutionContextBuilder instance.
|
9
|
+
class PerfectoExecutionContext
|
10
|
+
|
11
|
+
attr_accessor :job, :project, :webdriver, :contextTags, :customFields
|
12
|
+
|
13
|
+
# create new instance
|
14
|
+
#
|
15
|
+
# perfectoExecutionContextBuilder -
|
16
|
+
# raise ReportiumException if driver not given.
|
17
|
+
def initialize (perfectoExecutionContextBuilder)
|
18
|
+
|
19
|
+
# execution is not possible without webdriver.
|
20
|
+
if perfectoExecutionContextBuilder.webdriver.nil?
|
21
|
+
raise ReportiumException.new('Missing required webdriver argument.')
|
22
|
+
end
|
23
|
+
|
24
|
+
@job = perfectoExecutionContextBuilder.job
|
25
|
+
@project = perfectoExecutionContextBuilder.project
|
26
|
+
@webdriver = perfectoExecutionContextBuilder.webdriver
|
27
|
+
@contextTags = perfectoExecutionContextBuilder.contextTags
|
28
|
+
@customFields = perfectoExecutionContextBuilder.customFields
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
# PerfectoExecutionContext
|
33
|
+
#
|
34
|
+
# This class used to create PerfectoExecutionContext instance
|
35
|
+
#
|
36
|
+
# example:
|
37
|
+
# perfectoExecutionContext::perfectoExecutionContextBuilder
|
38
|
+
# .withJob("job name" , job number )
|
39
|
+
# .withProject("project name" , project version)
|
40
|
+
# .withWebDriver(driver)
|
41
|
+
# .build()
|
42
|
+
class PerfectoExecutionContextBuilder
|
43
|
+
|
44
|
+
@@job = nil
|
45
|
+
@@project = nil
|
46
|
+
@@webdriver = nil
|
47
|
+
@@contextTags = nil
|
48
|
+
@@customFields = Hash.new
|
49
|
+
|
50
|
+
# define a job
|
51
|
+
def self.withJob job
|
52
|
+
@@job = job
|
53
|
+
return self
|
54
|
+
end
|
55
|
+
|
56
|
+
# define a project
|
57
|
+
def self.withProject project
|
58
|
+
@@project = project
|
59
|
+
return self
|
60
|
+
end
|
61
|
+
|
62
|
+
# define webdriver
|
63
|
+
def self.withWebDriver webdriver
|
64
|
+
@@webdriver = webdriver
|
65
|
+
return self
|
66
|
+
end
|
67
|
+
|
68
|
+
# define contextTags
|
69
|
+
def self.withContextTags *args
|
70
|
+
@@contextTags = args
|
71
|
+
return self
|
72
|
+
end
|
73
|
+
|
74
|
+
# define the custom fields, overriding any existing definition
|
75
|
+
def self.withCustomFields *args
|
76
|
+
unless args.nil?
|
77
|
+
args.each do |cf|
|
78
|
+
@@customFields[cf.key] = cf.value
|
79
|
+
end
|
80
|
+
end
|
81
|
+
return self
|
82
|
+
end
|
83
|
+
|
84
|
+
# building a new builder instance
|
85
|
+
def self.build
|
86
|
+
return self.new
|
87
|
+
end
|
88
|
+
|
89
|
+
def job
|
90
|
+
@@job
|
91
|
+
end
|
92
|
+
|
93
|
+
def project
|
94
|
+
@@project
|
95
|
+
end
|
96
|
+
|
97
|
+
def contextTags
|
98
|
+
@@contextTags
|
99
|
+
end
|
100
|
+
|
101
|
+
def customFields
|
102
|
+
@@customFields
|
103
|
+
end
|
104
|
+
|
105
|
+
def webdriver
|
106
|
+
@@webdriver
|
107
|
+
end
|
108
|
+
|
109
|
+
end # end PerfectoExecutionContextBuilder
|
110
|
+
|
111
|
+
end
|
112
|
+
|
@@ -1,20 +1,20 @@
|
|
1
|
-
# Project
|
2
|
-
#
|
3
|
-
# Tests can be filtered by project they belong to.
|
4
|
-
#
|
5
|
-
# Usage:
|
6
|
-
# Project.new projectName, projectVersion
|
7
|
-
class Project
|
8
|
-
|
9
|
-
attr_accessor :name, :version
|
10
|
-
|
11
|
-
# initialize new project instance
|
12
|
-
#
|
13
|
-
# name - the new project's name
|
14
|
-
# version - the project's version
|
15
|
-
def initialize name, version
|
16
|
-
@name = name
|
17
|
-
@version = version
|
18
|
-
end
|
19
|
-
|
1
|
+
# Project
|
2
|
+
#
|
3
|
+
# Tests can be filtered by project they belong to.
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# Project.new projectName, projectVersion
|
7
|
+
class Project
|
8
|
+
|
9
|
+
attr_accessor :name, :version
|
10
|
+
|
11
|
+
# initialize new project instance
|
12
|
+
#
|
13
|
+
# name - the new project's name
|
14
|
+
# version - the project's version
|
15
|
+
def initialize name, version
|
16
|
+
@name = name
|
17
|
+
@version = version
|
18
|
+
end
|
19
|
+
|
20
20
|
end
|
@@ -1,64 +1,64 @@
|
|
1
|
-
require_relative '../model/CustomField.rb'
|
2
|
-
# TestContext
|
3
|
-
#
|
4
|
-
# TestExecutionTags will be presented in reporting ui.
|
5
|
-
# This tags attached to each test execution.
|
6
|
-
#
|
7
|
-
# Custom Fields defined for the TestContext are presented in report UI
|
8
|
-
# These custom fields override the values in the PerfectoExecutionContext
|
9
|
-
class TestContext
|
10
|
-
|
11
|
-
attr_accessor :testExecutionTags, :customFields
|
12
|
-
|
13
|
-
# Create TestContext instance
|
14
|
-
def initialize(contextBuilder )
|
15
|
-
@testExecutionTags = contextBuilder.testExecutionTags
|
16
|
-
@customFields = contextBuilder.customFields
|
17
|
-
end
|
18
|
-
|
19
|
-
# TestContextBuilder
|
20
|
-
#
|
21
|
-
# This class used to create TestContext instance
|
22
|
-
#
|
23
|
-
# example:
|
24
|
-
# cf1 = CustomField.new(key1, val1)
|
25
|
-
# cf2 = CustomField.new(key2, val2)
|
26
|
-
# TestContext::TestContextBuilder
|
27
|
-
# .withContextTags("tag1" , "tag2" )
|
28
|
-
# .withCustomFields(cf1, cf2)
|
29
|
-
# .build()
|
30
|
-
class TestContextBuilder
|
31
|
-
@@customFields = Hash.new
|
32
|
-
@@testExecutionTags = nil
|
33
|
-
|
34
|
-
# define contextTags
|
35
|
-
def self.withTestExecutionTags *args
|
36
|
-
@@testExecutionTags = args
|
37
|
-
return self
|
38
|
-
end
|
39
|
-
|
40
|
-
# define the custom fields, overriding any existing definition
|
41
|
-
def self.withCustomFields *args
|
42
|
-
unless args.nil?
|
43
|
-
args.each do |cf|
|
44
|
-
@@customFields[cf.key] = cf.value
|
45
|
-
end
|
46
|
-
end
|
47
|
-
return self
|
48
|
-
end
|
49
|
-
|
50
|
-
# building a new builder instance
|
51
|
-
def self.build
|
52
|
-
return self.new
|
53
|
-
end
|
54
|
-
|
55
|
-
def testExecutionTags
|
56
|
-
@@testExecutionTags
|
57
|
-
end
|
58
|
-
|
59
|
-
def customFields
|
60
|
-
@@customFields
|
61
|
-
end
|
62
|
-
|
63
|
-
end # end TestContextBuilder
|
64
|
-
end
|
1
|
+
require_relative '../model/CustomField.rb'
|
2
|
+
# TestContext
|
3
|
+
#
|
4
|
+
# TestExecutionTags will be presented in reporting ui.
|
5
|
+
# This tags attached to each test execution.
|
6
|
+
#
|
7
|
+
# Custom Fields defined for the TestContext are presented in report UI
|
8
|
+
# These custom fields override the values in the PerfectoExecutionContext
|
9
|
+
class TestContext
|
10
|
+
|
11
|
+
attr_accessor :testExecutionTags, :customFields
|
12
|
+
|
13
|
+
# Create TestContext instance
|
14
|
+
def initialize(contextBuilder )
|
15
|
+
@testExecutionTags = contextBuilder.testExecutionTags
|
16
|
+
@customFields = contextBuilder.customFields
|
17
|
+
end
|
18
|
+
|
19
|
+
# TestContextBuilder
|
20
|
+
#
|
21
|
+
# This class used to create TestContext instance
|
22
|
+
#
|
23
|
+
# example:
|
24
|
+
# cf1 = CustomField.new(key1, val1)
|
25
|
+
# cf2 = CustomField.new(key2, val2)
|
26
|
+
# TestContext::TestContextBuilder
|
27
|
+
# .withContextTags("tag1" , "tag2" )
|
28
|
+
# .withCustomFields(cf1, cf2)
|
29
|
+
# .build()
|
30
|
+
class TestContextBuilder
|
31
|
+
@@customFields = Hash.new
|
32
|
+
@@testExecutionTags = nil
|
33
|
+
|
34
|
+
# define contextTags
|
35
|
+
def self.withTestExecutionTags *args
|
36
|
+
@@testExecutionTags = args
|
37
|
+
return self
|
38
|
+
end
|
39
|
+
|
40
|
+
# define the custom fields, overriding any existing definition
|
41
|
+
def self.withCustomFields *args
|
42
|
+
unless args.nil?
|
43
|
+
args.each do |cf|
|
44
|
+
@@customFields[cf.key] = cf.value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
return self
|
48
|
+
end
|
49
|
+
|
50
|
+
# building a new builder instance
|
51
|
+
def self.build
|
52
|
+
return self.new
|
53
|
+
end
|
54
|
+
|
55
|
+
def testExecutionTags
|
56
|
+
@@testExecutionTags
|
57
|
+
end
|
58
|
+
|
59
|
+
def customFields
|
60
|
+
@@customFields
|
61
|
+
end
|
62
|
+
|
63
|
+
end # end TestContextBuilder
|
64
|
+
end
|