We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When testing multiple interfaces, how to make the latter interface depend on the previous interface and execute it sequentially
requests configuration as below
requests: [ { method: 'POST', path: '/api/login', setupRequest: (req, context) => { req.headers['Content-Type'] = 'application/json'; req.body = JSON.stringify({ username: 'demo' + Math.random(), password: '123' + Math.random() }); return req; }, onResponse: (status, body, context, headers) => { if (status == 200) { const cookie = headers['Set-Cookie'].split(';')[0]; context.token = cookie; loginSuccessNum++; console.log('1111'); } else { loginFailNum++; console.log('login请求失败'); } } }, { method: 'POST', path: '/api/checkToken', setupRequest: (req, context) => { console.log('22222'); return { ...req, headers: { cookie: context.token } }; }, onResponse: (status, body, context) => { if (status == 200) { tokenSuceessNum++; } else { console.log('checkToken请求失败', status); tokenFailNum++; } } } ];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When testing multiple interfaces, how to make the latter interface depend on the previous interface and execute it sequentially
requests configuration as below
The text was updated successfully, but these errors were encountered: