-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
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
How can I follow redirects? #97
Comments
Request has some options regarding following redirects, see |
@dareid Sorry should've phrased the question better, it does, by default, follow the hops and show them, but I can't seem to test the redirect/request/response along the way. For example, it('should upload a user photo', () => {
let headers = auth.headers;
return chakram.put(apiPhotoUrl, photo, { json: false, headers })
.then((putResponse) => {
expect(putResponse).to.have.status(200);
// This part needs to be modified to follow hops.
chakram.startDebug();
return chakram.get(apiPhotoUrl, auth);
})
.then((redirect) => {
expect(redirect).to.redirect;
})
.then((getResponse) => {
expect(getResponse).to.have.status(200);
expect(getResponse.body).to.equal(photo);
});
}); The apiPhotoUrl line will send the request, then I get a redirect, then a request, and finally a response. How can I test the final response? Currently the getResponse results in an error saying it's undefined. I know I should have a PS: Also thanks for your amazing REST test suite |
For example, I am trying to follow a request which gets redirect to Amazon and few other places then finishes. How can I follow the hops to test them each?
The text was updated successfully, but these errors were encountered: