如何从浏览器运行newman测试? 我们可以使用Python进行操作,还是节点中可以选择执行此操作? 抱歉,我确实不是开发人员。需要您的支持和帮助
const newman = require('newman');
newman.run({
collection: require('./Tests.postman_collection.json'),
environment: require('./Test.postman_environment.json'),
reporters: ['htmlextra', 'cli'],
reporter: {
htmlextra: {
export: './Reports/Feb25.html'
}
}
})
.on('start', function(err, args) { // on start of run, log to console
console.log('Running collection for you...');
})
.on('done', function(err, summary) {
if (err || summary.error) {
console.error('collection run encountered an error.');
} else {
console.log('collection run completed.');
}
});