-
Notifications
You must be signed in to change notification settings - Fork 200
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
Could not generate token using frisby v2 #561
Comments
Try using |
Thanks @vlucas. |
Your curl command disables HTTPS cert checking with the var frisby = require('frisby');
frisby.globalSetup({
request: {
headers: {
'Authorization': 'Basic ' + Buffer.from("username:password").toString('base64'),
'header':'value'
},
// It's one of these
strictSSL : false,
rejectUnauthorized: false
}
});
//do setup for Authorization of the token for REST call
it ('uses globalSetup for every test after it is called', function () {
return frisby.get('URL')
.inspectResponse()
.expect('status', 400);
}); |
@LarryBattleWork |
Thanks. |
So your solution looks like this? process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
frisby.globalSetup({
request: {
headers: {
'Authorization': 'Basic ' + Buffer.from("username:password").toString('base64'),
'header':'value'
}
}
}); NOTE: Don't use |
@LarryBattleWork thanks for response. Also how can I get the response in variable. |
If curl |
@H1Gdev |
@vlucas Can you please suggest which reporting goes with Jasmine-Frisby project. Thanks in advance. |
i am using frisby for apis automation and Jasmine for test. I am not able to generate simple token generation using basic Auth
this is how my curl call look like for token generation and same I am trying with Frisby.js.
$ curl -k https://URL -u username:password -H "header:value"
The output brings token like some value
TDIKhjglj7698ssjgljuypubvbi
Same I am doing with frisby to generate token so in this case I am not getting error and my spec is getting passed everytime. Even for negative expects conditions. here is my code
var frisby =require('frisby');
frisby.globalSetup({
request: {
headers: {
'Authorization': 'Basic ' + Buffer.from("username:password").toString('base64'),
'Content-Type': 'application/json+scim',
'header':'value'
}} });
//do setup for Authorization of the token for REST call
it ('uses globalSetup for every test after it is called', function () {
can anyone just point out what exactly am I missing in code. I have tested with response 400 still test is getting passed and token not getting generated. I am using link Frisby Documentation
Also running test using -
#jasmine test_spec.js
Randomized with seed 54594
Started
1 spec, 0 failures
Finished in 0.049 seconds
Randomized with seed 54594 (jasmine --random=true --seed=54594)
The text was updated successfully, but these errors were encountered: