Closed varunpradhan closed 4 years ago
Hi @varunpradhan !
We are using ntlm-auth together with cucumber at work so it should work fine. Since the plugin can't detect the proxy I am guessing there is a configuration issue.
cypress/plugins/index.js
as described in the readme?Hi @bjowes
-Yes the plugin was working before I started to use cucumber. -Yes I had added the initialization code for the plugin in cypress/plugins/index.js as described in the readme
Below is my index.js file
-Yes I am launching cypress with the plugins launcher (cypress-ntlm) as described in the readme
I get this error:
Thanks for pasting the plugins/index.js
file, i can see the issue. You have the correct initalization for ntlm-auth and for cucumber separately, but you need to combine them.
The second module.exports = ...
overwrites the first assignment to modules.exports, which removes the initalization for ntlm-auth. Try combining them like this:
module.exports = (on, config) => {
on('file:preprocessor', cucumber());
config = ntlmAuth.initNtlmAuth(config);
return config;
}
Hi @bjowes
Now I am facing this issue:
This is my update plugins/index.js
Oh, my bad. I just wrote that code example from my head, didn't test it. Replace file.preprocessor
with file:preprocessor
like you had it in the first place.
Ya I got it. Yes now it's working. Thank you for the help.
Hi @bjowes
I have cucumber plugin too along with ntlm-auth
I have added cy.ntlm('', '', '') inside Given block and it failed with an error that The cypress-ntlm-auth plugin must be loaded before using this method
example :
Given('I go to URL', () => { cy.ntlm('', '', '')
cy.visit(Cypress.env('url'))
cy.wait(3000)
})