-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25bcd29
commit d1f49d8
Showing
4 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
const { mock } = require('pactum'); | ||
const assert = require('assert'); | ||
const { publish } = require('../src'); | ||
|
||
describe('global extensions', () => { | ||
|
||
afterEach(() => { | ||
mock.clearInteractions(); | ||
}); | ||
|
||
it('with global extensions', async () => { | ||
const id = mock.addInteraction('post test-summary with metadata to teams'); | ||
await publish({ | ||
config: { | ||
"targets": [ | ||
{ | ||
"name": "teams", | ||
"inputs": { | ||
"url": "http://localhost:9393/message" | ||
}, | ||
} | ||
], | ||
"extensions": [ | ||
{ | ||
"name": "metadata", | ||
"inputs": { | ||
"data": [ | ||
{ | ||
"key": "Browser", | ||
"value": "Chrome" | ||
}, | ||
{ | ||
"value": "1920*1080" | ||
}, | ||
{ | ||
"value": "1920*1080", | ||
"condition": "never" | ||
}, | ||
{ | ||
"key": "Pipeline", | ||
"value": "some-url", | ||
"type": "hyperlink" | ||
}, | ||
] | ||
} | ||
} | ||
], | ||
"results": [ | ||
{ | ||
"type": "testng", | ||
"files": [ | ||
"test/data/testng/single-suite.xml" | ||
] | ||
} | ||
] | ||
} | ||
}); | ||
assert.equal(mock.getInteraction(id).exercised, true); | ||
}); | ||
|
||
it('with global and normal extensions', async () => { | ||
const id = mock.addInteraction('post test-summary with metadata and hyperlinks to teams'); | ||
await publish({ | ||
config: { | ||
"targets": [ | ||
{ | ||
"name": "teams", | ||
"inputs": { | ||
"url": "http://localhost:9393/message" | ||
}, | ||
"extensions": [ | ||
{ | ||
"name": "hyperlinks", | ||
"inputs": { | ||
"links": [ | ||
{ | ||
"text": "Pipeline", | ||
"url": "some-url" | ||
}, | ||
{ | ||
"text": "Video", | ||
"url": "some-url", | ||
"condition": "pass" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
} | ||
], | ||
"extensions": [ | ||
{ | ||
"name": "metadata", | ||
"inputs": { | ||
"data": [ | ||
{ | ||
"key": "Browser", | ||
"value": "Chrome" | ||
}, | ||
{ | ||
"value": "1920*1080" | ||
}, | ||
{ | ||
"value": "1920*1080", | ||
"condition": "never" | ||
}, | ||
{ | ||
"key": "Pipeline", | ||
"value": "some-url", | ||
"type": "hyperlink" | ||
}, | ||
] | ||
} | ||
} | ||
], | ||
"results": [ | ||
{ | ||
"type": "testng", | ||
"files": [ | ||
"test/data/testng/single-suite.xml" | ||
] | ||
} | ||
] | ||
} | ||
}); | ||
assert.equal(mock.getInteraction(id).exercised, true); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters