@@ -47,7 +47,8 @@ describe('TestBeats', () => {
47
47
it ( 'should send results with failures to beats' , async ( ) => {
48
48
const id1 = mock . addInteraction ( 'post test results to beats' ) ;
49
49
const id2 = mock . addInteraction ( 'get test results from beats' ) ;
50
- const id3 = mock . addInteraction ( 'post test-summary with beats to teams with ai failure summary' ) ;
50
+ const id3 = mock . addInteraction ( 'get empty error clusters from beats' ) ;
51
+ const id4 = mock . addInteraction ( 'post test-summary with beats to teams with ai failure summary' ) ;
51
52
await publish ( {
52
53
config : {
53
54
api_key : 'api-key' ,
@@ -74,13 +75,15 @@ describe('TestBeats', () => {
74
75
assert . equal ( mock . getInteraction ( id1 ) . exercised , true ) ;
75
76
assert . equal ( mock . getInteraction ( id2 ) . exercised , true ) ;
76
77
assert . equal ( mock . getInteraction ( id3 ) . exercised , true ) ;
78
+ assert . equal ( mock . getInteraction ( id4 ) . exercised , true ) ;
77
79
} ) ;
78
80
79
81
it ( 'should send results with attachments to beats' , async ( ) => {
80
82
const id1 = mock . addInteraction ( 'post test results to beats' ) ;
81
83
const id2 = mock . addInteraction ( 'get test results from beats' ) ;
82
84
const id3 = mock . addInteraction ( 'upload attachments' ) ;
83
- const id4 = mock . addInteraction ( 'post test-summary to teams with strict as false' ) ;
85
+ const id4 = mock . addInteraction ( 'get empty error clusters from beats' ) ;
86
+ const id5 = mock . addInteraction ( 'post test-summary to teams with strict as false' ) ;
84
87
await publish ( {
85
88
config : {
86
89
api_key : 'api-key' ,
@@ -108,6 +111,7 @@ describe('TestBeats', () => {
108
111
assert . equal ( mock . getInteraction ( id2 ) . exercised , true ) ;
109
112
assert . equal ( mock . getInteraction ( id3 ) . exercised , true ) ;
110
113
assert . equal ( mock . getInteraction ( id4 ) . exercised , true ) ;
114
+ assert . equal ( mock . getInteraction ( id5 ) . exercised , true ) ;
111
115
} ) ;
112
116
113
117
it ( 'should send results to beats without targets' , async ( ) => {
@@ -133,7 +137,8 @@ describe('TestBeats', () => {
133
137
it ( 'should send results with smart analysis to beats' , async ( ) => {
134
138
const id1 = mock . addInteraction ( 'post test results to beats' ) ;
135
139
const id2 = mock . addInteraction ( 'get test results with smart analysis from beats' ) ;
136
- const id3 = mock . addInteraction ( 'post test-summary with beats to teams with ai failure summary and smart analysis' ) ;
140
+ const id3 = mock . addInteraction ( 'get empty error clusters from beats' ) ;
141
+ const id4 = mock . addInteraction ( 'post test-summary with beats to teams with ai failure summary and smart analysis' ) ;
137
142
await publish ( {
138
143
config : {
139
144
api_key : 'api-key' ,
@@ -160,6 +165,41 @@ describe('TestBeats', () => {
160
165
assert . equal ( mock . getInteraction ( id1 ) . exercised , true ) ;
161
166
assert . equal ( mock . getInteraction ( id2 ) . exercised , true ) ;
162
167
assert . equal ( mock . getInteraction ( id3 ) . exercised , true ) ;
168
+ assert . equal ( mock . getInteraction ( id4 ) . exercised , true ) ;
169
+ } ) ;
170
+
171
+ it ( 'should send results with error clusters to beats' , async ( ) => {
172
+ const id1 = mock . addInteraction ( 'post test results to beats' ) ;
173
+ const id2 = mock . addInteraction ( 'get test results from beats' ) ;
174
+ const id3 = mock . addInteraction ( 'get error clusters from beats' ) ;
175
+ const id4 = mock . addInteraction ( 'post test-summary with beats to teams with error clusters' ) ;
176
+ await publish ( {
177
+ config : {
178
+ api_key : 'api-key' ,
179
+ project : 'project-name' ,
180
+ run : 'build-name' ,
181
+ targets : [
182
+ {
183
+ name : 'teams' ,
184
+ inputs : {
185
+ url : 'http://localhost:9393/message'
186
+ }
187
+ }
188
+ ] ,
189
+ results : [
190
+ {
191
+ type : 'testng' ,
192
+ files : [
193
+ 'test/data/testng/single-suite-failures.xml'
194
+ ]
195
+ }
196
+ ]
197
+ }
198
+ } ) ;
199
+ assert . equal ( mock . getInteraction ( id1 ) . exercised , true ) ;
200
+ assert . equal ( mock . getInteraction ( id2 ) . exercised , true ) ;
201
+ assert . equal ( mock . getInteraction ( id3 ) . exercised , true ) ;
202
+ assert . equal ( mock . getInteraction ( id4 ) . exercised , true ) ;
163
203
} ) ;
164
204
165
205
} ) ;
0 commit comments