@@ -75,10 +75,10 @@ export const allureCypress = (on: Cypress.PluginEvents, config?: AllureCypressCo
75
75
}
76
76
77
77
if ( type === MessageType . METADATA ) {
78
- const { parameter, links, attachments, ...metadata } = payload ;
78
+ const { parameter = [ ] , links = [ ] , attachments, ...metadata } = payload ;
79
79
const currentStep = currentSteps [ currentSteps . length - 1 ] ;
80
80
81
- parameter ? .forEach ( ( { name, value, excluded, mode } ) => {
81
+ parameter . forEach ( ( { name, value, excluded, mode } ) => {
82
82
currentTest . parameter ( name , value , {
83
83
excluded,
84
84
mode,
@@ -90,12 +90,15 @@ export const allureCypress = (on: Cypress.PluginEvents, config?: AllureCypressCo
90
90
( currentStep || currentTest ) . addAttachment ( attachment . name , attachment . type , attachmentName ) ;
91
91
} ) ;
92
92
93
- if ( ! config ?. links ?. length || ! links ?. length ) {
94
- currentTest . applyMetadata ( metadata ) ;
93
+ if ( ! config ?. links ?. length ) {
94
+ currentTest . applyMetadata ( {
95
+ ...metadata ,
96
+ links,
97
+ } ) ;
95
98
return ;
96
99
}
97
100
98
- const formattedLinks : Link [ ] = links ? .map ( ( link ) => {
101
+ const formattedLinks : Link [ ] = links . map ( ( link ) => {
99
102
const matcher = config ?. links ?. find ?.( ( item ) => item . type === link . type ) ;
100
103
101
104
if ( ! matcher || link . url . startsWith ( "http" ) ) {
0 commit comments