bjowes / cypress-ntlm-auth

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

Updating package.json for Cypress NTLM Auth #118

Closed pgianino closed 4 years ago

pgianino commented 4 years ago

The install instructions say to update package.json. Is that the package.json file in the "cpress-ntlm-auth" folder, or another folder? I'm new to this work, and hesitant that I will change the wrong file without knowing the ramifications.

BTW - if there is a way to categorize this as a Question rather than an Issue, please let me know how and I will gladly take care of that.

bjowes commented 4 years ago

Hi @pgianino - the package.json to update is the one in your project folder. Typically, to install cypress and the plugin you create a project folder to hold your tests, then you enter that folder and run npm init to initialize a new npm project. Then you install the packages you need, with npm install cypress and so on. Now, the project folder contains a package.json file which references all the packages you have installed. In that file you can add scripts as "shortcuts" for executing tasks in your project, such as launching cypress with cypress-ntlm.

_(Details: The packages reside in node_modules folder. If you would put the project under source control, such as git, the node_modules folder is not committed. When you clone such a project, you start out with doing npm installwhich installs all dependencie listed in package.json. So there are other purposes to having this file.)_

Thanks for pointing out that it is a question rather than an issue. In github that is the right way to do it, there is no separate channel or tagging for questions, unless specified by the repo.

pgianino commented 4 years ago

@bjowes - thanks for the info. I uploaded a txt document with the steps I followed and the results I am encountering. Could you please take a look and let me know if I am following the ntlm-auth install and the usage instructions correctly? And also, is there something I need to do to get my scripts showing again in Cypress - I don't know if this is related or not.

Thanks very much. The plugin is going to be a huge win for me once I get on the right track!

ntlm-auth plugin issue for github 118 .txt

pgianino commented 4 years ago

@bjowes - sorry, one more note. In regards to my uploaded txt file and my missing test scripts, the script show up again in Cypress if I comment out the call to "initNtlmAuth" in the index.js file, and then open Cypress (using C:\Users\pgianino\cypress-workspace> ./node_modules/.bin/cypress open).

I suspect I've done something wrong on the ntlm-auth setup that is just compounding things when I get into Cypress. :-(

bjowes commented 4 years ago

@pgianino - thanks for the detailed description. Some pointers:

Hope this helps!

Comments on your attempts at the end of the description - you should not need to repeat them after following the points above, but just to explain:

pgianino commented 4 years ago

That got my over the issues I was having. I didn't have a package.json file in my project folder, and I assumed that was ok, but your help got me back on track, I am now able to launch cypress successfully with the NTML plugin, and I can see all of my test scripts (with and without the NTLM plugin).

Unfortunately I am now getting a Kerberos error when I attempt to open my SSO/NTLM protect application but I trust that is a different issue.

I am ok closing this. Thanks so much for your help and patience!