私はnewman apiを使用して郵便受けのテストスーツを実行しています。その期待通りに適切に実行するが、私は--export-環境使用して、それが可能であるコマンドラインでファイルのテスト実行中に生成された環境変数を、エクスポートしたい:私は環境を得るためにはJavaScriptを書いている同じもののためnewman APIを使用して環境変数をエクスポートする方法
newman run collectionPreReq.json -e Environment.json -k --export-environment newmanExport.json
をcollectionPreReqによってエクスポートされたが、私が探しているものを得ていない、コードが
var newman = require('newman');
newman.run({
collection: require('./collectionPreReq.json'),
//reporters: 'cli',
environment: require('./Environment.json'),
insecure: true
}).on('start', function (err, args) {
console.log('running a collection...');
}).on('done', function (err, summary) {
if (err || summary.error) {
console.error('collection run encountered an error.');
}
else {
console.log('collection run completed.:');
console.log("summary environment :");
console.log(summary.environment);
}
});
出力です:
running a collection...
collection run completed.:
summary environment :
{ object: [Function], toJSON: [Function] }