Hi, batch script below does the following:
1) Delete newman html extra report if already exists in Reports folder under C drive
2) Starts two command prompts in the background and calls the node.js to run the same set of newman/postman smoke tests at a time on two different environments.
As two start commands begins execution simultaneously , we need NOT to wait until the first one finishes so can avoid sequential execution and achieve kinda of parallel execution on two different environments with same collection.
REM set the reports path @echo on set "filePath-1=C:\Reports\SmokeTestReportServer-1.html" set "filePath-2=C:\Reports\SmokeTestReportServer-2.html" REM Delete the reports if already exists in Reports folder if exist "%filePath-1%" del /Q /F "%filePath-1%" if exist "%filePath-2%" del /Q /F "%filePath-2%" REM Executing Smoke Tests at a time by opening two command prompots for two different servers echo 'Server1' start /B cmd /c call newman run "SmokeTests.postman_collection.json" -e "Server1Env.postman_environment.json" -r htmlextra --reporter-htmlextra-export "C:\Reports\SmokeTestReportServer-1.html" echo 'Server1 execution is done' echo 'Server2' start /B cmd /c call newman run "SmokeTests.postman_collection.json" -e "Server2Env.postman_environment.json" -r htmlextra --reporter-htmlextra-export "C:\Reports\SmokeTestReportServer-2.html" echo 'Server2 execution is done' timeout /t 3 /nobreak exit
cmd: Start a new CMD shell and (optionally) run a command/executable program.
No comments:
Post a Comment