1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

Merge pull request #194 from rodibrin/pr/newmanexecutetest

adapt the NewmanExecuteTest to windows file system
This commit is contained in:
rodibrin 2018-07-12 08:56:28 +02:00 committed by GitHub
commit 4cb5ba5f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -95,7 +95,7 @@ steps:
newmanCollection: '**/*.postman_collection.json'
newmanEnvironment: ''
newmanGlobals: ''
newmanRunCommand: "run ${config.newmanCollection} --environment '${config.newmanEnvironment}' --globals '${config.newmanGlobals}' --reporters junit,html --reporter-junit-export target/newman/TEST-${config.newmanCollection.toString().replaceAll('/','_').tokenize('.').first()}.xml --reporter-html-export target/newman/TEST-${config.newmanCollection.toString().replaceAll('/','_').tokenize('.').first()}.html"
newmanRunCommand: "run ${config.newmanCollection} --environment '${config.newmanEnvironment}' --globals '${config.newmanGlobals}' --reporters junit,html --reporter-junit-export target/newman/TEST-${config.newmanCollection.toString().replace(File.separatorChar,(char)'_').tokenize('.').first()}.xml --reporter-html-export target/newman/TEST-${config.newmanCollection.toString().replace(File.separatorChar,(char)'_').tokenize('.').first()}.html"
pipelineStashFilesAfterBuild:
runOpaTests: false
stashIncludes:

View File

@ -86,11 +86,11 @@ class NewmanExecuteTest extends BasePiperTest {
void testExecuteNewmanWithFolder() throws Exception {
jsr.step.newmanExecute(
script: nullScript,
newmanRunCommand: 'run ${config.newmanCollection} --iteration-data testDataFile --reporters junit,html --reporter-junit-export target/newman/TEST-${config.newmanCollection.toString().replaceAll(\'/\',\'_\').tokenize(\'.\').first()}.xml --reporter-html-export target/newman/TEST-${config.newmanCollection.toString().replaceAll(\'/\',\'_\').tokenize(\'.\').first()}.html'
newmanRunCommand: 'run ${config.newmanCollection} --iteration-data testDataFile --reporters junit,html --reporter-junit-export target/newman/TEST-${config.newmanCollection.toString().replace(File.separatorChar,(char)\'_\').tokenize(\'.\').first()}.xml --reporter-html-export target/newman/TEST-${config.newmanCollection.toString().replace(File.separatorChar,(char)\'_\').tokenize(\'.\').first()}.html'
)
// asserts
assertThat(jscr.shell, hasItem('newman run testCollectionsFolder/A.postman_collection.json --iteration-data testDataFile --reporters junit,html --reporter-junit-export target/newman/TEST-testCollectionsFolder_A.xml --reporter-html-export target/newman/TEST-testCollectionsFolder_A.html'))
assertThat(jscr.shell, hasItem('newman run testCollectionsFolder/B.postman_collection.json --iteration-data testDataFile --reporters junit,html --reporter-junit-export target/newman/TEST-testCollectionsFolder_B.xml --reporter-html-export target/newman/TEST-testCollectionsFolder_B.html'))
assertThat(jscr.shell, hasItem('newman run testCollectionsFolder'+File.separatorChar+'A.postman_collection.json --iteration-data testDataFile --reporters junit,html --reporter-junit-export target/newman/TEST-testCollectionsFolder_A.xml --reporter-html-export target/newman/TEST-testCollectionsFolder_A.html'))
assertThat(jscr.shell, hasItem('newman run testCollectionsFolder'+File.separatorChar+'B.postman_collection.json --iteration-data testDataFile --reporters junit,html --reporter-junit-export target/newman/TEST-testCollectionsFolder_B.xml --reporter-html-export target/newman/TEST-testCollectionsFolder_B.html'))
assertJobStatusSuccess()
}
}