bjowes / cypress-ntlm-auth

Windows authentication plugin for Cypress
MIT License
55 stars 10 forks source link

ntlm-proxy is not getting started #97

Closed varunpradhan closed 4 years ago

varunpradhan commented 4 years ago

Hi @bjowes ,

I have copied the code in another location and trying to run command npm run cypress-ntlm then the ntlm-proxy is not getting started. I am facing below error:

image

bjowes commented 4 years ago

I think this is because you are running npm run cypress-ntlm from the node_modules\.bin folder. Try running it from the project root folder.

varunpradhan commented 4 years ago

Hi @bjowes

This was because I didn't copied ca.private.key and ca.public.key. Do we need to copy these too as I didn't copied node_module and \.http-mitm-proxy\keys folder?

As soon as I copied \.http-mitm-proxy\keys folder with the keys in it, it started working.

bjowes commented 4 years ago

No, you shouldn't need to copy .http-mitm-proxy folder - it is created automatically when the proxy starts. Did you get it working?

varunpradhan commented 4 years ago

Yes I did get it working after I copied the 2 keys

bjowes commented 4 years ago

Ok, I'll try to reproduce what you did.

varunpradhan commented 4 years ago

Ok Thank you @bjowes 👍

Also just out of the box can I have a helping hand from you in few of my doubts related to cypress???

Thanks

bjowes commented 4 years ago

I tried to reproduce this but didn't have any issues after copying my test project to a new folder. When copying and skipping node_modules, make sure you run npm install in the new folder to setup the node_modules content in the new folder.

As for support, I mainly offer support for my plugin here. You can try me - if it is something I can answer without much effort I'll do it, otherwise I recommend the cypress docs (which are really good actually). I'll close the issue, but you can ask your question in this thread.

varunpradhan commented 4 years ago

Hi @bjowes

I am unable to use fixtures inside When,And etc. It is showing me an error : TypeError: Cannot read property 'data' of undefined

I have created a Test.feature file to test the fixture and below is the code :

Feature File: image

Step Definition File: image

Below is the test runner error snippet: image

Can you please help me on this? How to resolve this? I have pushed the repo at : https://github.com/varunpradhan/Cypress

bjowes commented 4 years ago

Try this: cy.fixture('createTestData').as('data')

varunpradhan commented 4 years ago

Hi @bjowes This too didn't worked :(

bjowes commented 4 years ago

I'm a bit unsure how it works when you are mixing before with cucumber steps. According to the docs it seems to be ok, but I would still try moving the fixture call into the Given block - that way you are certain that it is run with the Given statement.

varunpradhan commented 4 years ago

Hi @bjowes I have moved the code to Given still the code is not working. Can you share how it is done by you in your project. Am I doing it in a right way?

lgandecki commented 4 years ago

for a lost googler - here is a solution to this problem https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/317#issuecomment-578191635

bjowes commented 4 years ago

Thanks @lgandecki - it seemed correct to me, good to know that you shouldn't import mocha. We didn't do that in our own project but I thought it wouldn't matter. @varunpradhan - is it working now?

varunpradhan commented 4 years ago

Hi @bjowes Yes it is working now. Thank you :)