我是炮兵新手并且陷入基本流程,我遇到了以下问题:-
artillery run test_load.yaml
/usr/local/lib/node_modules/artillery/lib/commands/run.js:315
script.scenarios.forEach(function(scenario) {
^
TypeError: script.scenarios.forEach is not a function
at checkIfXPathIsUsed (/usr/local/lib/node_modules/artillery/lib/commands/run.js:315:20)
at fn (/usr/local/lib/node_modules/artillery/node_modules/async/lib/async.js:746:34)
at /usr/local/lib/node_modules/artillery/node_modules/async/lib/async.js:1213:16
at /usr/local/lib/node_modules/artillery/node_modules/async/lib/async.js:166:37
at /usr/local/lib/node_modules/artillery/node_modules/async/lib/async.js:706:43
at /usr/local/lib/node_modules/artillery/node_modules/async/lib/async.js:167:37
at Immediate._onImmediate (/usr/local/lib/node_modules/artillery/node_modules/async/lib/async.js:1206:34)
at runCallback (timers.js:794:20)
at tryOnImmediate (timers.js:752:5)
at processImmediate [as _immediateCallback] (timers.js:729:5)
.yml 文件:-
config:
http:
target: 'https://sit-api.XX.com'
phases:
duration: 60
arrivalRate: 20
defaults:
headers:
Authorization: "Basic XXXX=="
scenarios:
flow:
post:
url: '/XX/v1/XX?apikey=XX'
sslAuth: false
json:
siteId: '132'
orderId: '2220000666'
productId: '102793419'
timestamp: '202021-11-26T10:20.36'
pickTaskId: 'XXX-XX-XX-8e6f135-Yj9Rw1n35'
pickLocationId: 'U-XX-3'
quantityPicked: 21.1
quantityOrdered: 20.491
expect:
statusCode: 202
我正在使用以下命令运行这个 throw 终端:- artillery run test_load.yaml