-
Notifications
You must be signed in to change notification settings - Fork 10
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
I have configured NTM-Auth-plugin and when i run the cypress So I am facing the issue: Error: Cannot find module 'cypress-ntlm-auth/dist/plugin' #216
Comments
Hi @MuhammadJawad1214 - it seems you are using an older plugin setup. It is much simpler with the current versions, you don't need to put anything (related to cypress-ntlm-auth) in cypress.config.js anymore. Importing the commands (as you have done) is enough. See the Readme for detailed instructions. |
Thanks @bjowes it works But I am facing some new issues |
Try to run it, I think it still works. The error you are seeing is a
typescript error, meaning it could not locate the command types for the
plugin. I can take a look at that later.
…On Tue, Sep 20, 2022 at 1:22 PM MuhammadJawad1214 ***@***.***> wrote:
Thanks @bjowes <https://github.com/bjowes> it works But I am facing some
new issues
When i use cy.ntlm So it gives me this error : Property 'ntlm' does not
exist on type 'cy & CyEventEmitter'.ts(2339)
—
Reply to this email directly, view it on GitHub
<#216 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCHR3E2DJLN2HZWZDDCFYLV7GM6TANCNFSM6AAAAAAQQ5IH3I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I have tried to run with the npx cypress-ntlm while ntlm proxy is running but having this error now on cypress browser cy.visit() failed trying to load: We attempted to make an http request to this URL but the request failed without a response. We received this error at the network level:
Common situations why this would fail:
|
@bjowes this is the screen shot of the error |
It is a bit difficult to keep track when there are several separate issues combined in one thread - just hope I don't mix things up.
|
When i was running ntlm-cypress without the base url
▲ [WARNING] Use "cypress/pages/loginPage.ts" instead of "cypress/pages/LoginPage.ts" to avoid issues with case-sensitive file systems [different-path-case]
GET /__cypress/tests?p=cypress%5Csupport%5Ce2e.js 200 3533.892 ms - -
▲ [WARNING] Use "cypress/pages/loginPage.ts" instead of "cypress/pages/LoginPage.ts" to avoid issues with case-sensitive file systems [different-path-case]
|
And this one is initializing the base url as well, The cypress browse is just loading and the error is as follows GET /__cypress/iframes/cypress%5Ce2e%5Cfeatures%5Clogin.feature 200 0.830 ms - 949 |
Really wierd that baseUrl should make such a difference. I have also noticed the |
The above two logs are from the cypress-ntlm-auth followed as it is written in README.md file, I will try again and will share the logs with you |
I am using the ntlm plugin as follows for the google, We really don't need the username and pass for google But it our ntlm usage requires and I implemented like that cy.ntlm(["google.com"], "mujawad", "pass") This is the logs from ntlm-auth logs GET // 200 5.528 ms - - |
These are the logs of the ntlm-proxy terminal cypress-ntlm-auth: Certificate validation failed for "registry.npmjs.org:80". ETIMEDOUT |
You need to set the DEBUG variable in the ntlm-proxy terminal, before
starting it. The interesting logs will end up there.
When running without external ntlm-proxy, all logs end up in the
cypress-ntlm terminal.
…On Wed, Sep 21, 2022 at 9:35 AM MuhammadJawad1214 ***@***.***> wrote:
*These are the logs of the ntlm-proxy terminal*
cypress-ntlm-auth: Certificate validation failed for "
registry.npmjs.org:80". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
download.cypress.io:80". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
clientservices.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "accounts.google.com".
ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
content-autofill.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
update.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "google.com".
ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
optimizationguide-pa.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
safebrowsing.googleapis.com". ETIMEDOUT
—
Reply to this email directly, view it on GitHub
<#216 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCHR3A2PZG2HQTVFXZHJ2LV7K3EDANCNFSM6AAAAAAQQ5IH3I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is the log as followed your instructions GET // 200 39.402 ms - - |
@bjowes and this is my proxy settings |
On other side on ntlm-proxy terminal i got certification failed issues: cypress-ntlm-auth: Certificate validation failed for "registry.npmjs.org:80". ETIMEDOUT |
cy.ntlm() should be called with your target hosts, like ['google.com'] if
that is the site you are testing.
You are calling it with the address of the ntlm-proxy. This might lead to
some unexpected loop in the plugin, I have not tested this scenario.
Change cy.ntlm() to your target and try again.
You mentioned before that everything worked a few days ago. This test case
cannot have worked before, if that was the cy.ntlm call.
Also, the logs you are sharing are still from the terminal where you are
launching cypress. You need to share the logs from the terminal where you
are running ntlm-proxy.
…On Wed, Sep 21, 2022 at 1:36 PM MuhammadJawad1214 ***@***.***> wrote:
*On other side on ntlm-proxy terminal i got certification failed issues:*
cypress-ntlm-auth: Certificate validation failed for "
registry.npmjs.org:80". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
download.cypress.io:80". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
clientservices.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "accounts.google.com".
ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
content-autofill.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
update.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "google.com".
ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
optimizationguide-pa.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
safebrowsing.googleapis.com". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
vnext.g2claims-dev.genre.com". UNABLE_TO_GET_ISSUER_CERT_LOCALLY
—
Reply to this email directly, view it on GitHub
<#216 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCHR3DJWFLRJ5MIVYUGLD3V7LXNTANCNFSM6AAAAAAQQ5IH3I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This log is from ntlm-proxy, please check |
Yes I have tried with the targeted host as well and still the result is the same issue The log is from ntlm-proxy terminal, I am sharing the new logs as well |
ETIMEDOUT looks better than socket error.
My best bet is your company proxy. Try running cypress without the plugin,
can you do cy.visit('https://google.com')?
If no, you are missing company proxy configuration. See
https://docs.cypress.io/guides/references/proxy-configuration#Set-a-proxy-on-Windows
In short, you need to set HTTP_PROXY environment variable to the URL of
your corporate proxy. Do this before you launch cypress-ntlm, and the
plugin will adjust the settings to cypress automatically.
Note: If the corporate proxy also requires windows authentication, neither
cypress nor this plugin will work :(
On Wed, Sep 21, 2022 at 2:24 PM MuhammadJawad1214 ***@***.***>
wrote:
… cy.ntlm() should be called with your target hosts, like ['google.com'] if
that is the site you are testing. You are calling it with the address of
the ntlm-proxy. This might lead to some unexpected loop in the plugin, I
have not tested this scenario. Change cy.ntlm() to your target and try
again. You mentioned before that everything worked a few days ago. This
test case cannot have worked before, if that was the cy.ntlm call. Also,
the logs you are sharing are still from the terminal where you are
launching cypress. You need to share the logs from the terminal where you
are running ntlm-proxy.
… <#m_-654911907380230631_>
On Wed, Sep 21, 2022 at 1:36 PM MuhammadJawad1214 *@*.*> wrote: On other
side on ntlm-proxy terminal i got certification failed issues:
cypress-ntlm-auth: Certificate validation failed for "
registry.npmjs.org:80 <http://registry.npmjs.org:80>". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
download.cypress.io:80 <http://download.cypress.io:80>". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
clientservices.googleapis.com <http://clientservices.googleapis.com>".
ETIMEDOUT cypress-ntlm-auth: Certificate validation failed for
"accounts.google.com <http://accounts.google.com>". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "
content-autofill.googleapis.com <http://content-autofill.googleapis.com>".
ETIMEDOUT cypress-ntlm-auth: Certificate validation failed for "
update.googleapis.com <http://update.googleapis.com>". ETIMEDOUT
cypress-ntlm-auth: Certificate validation failed for "google.com
<http://google.com>". ETIMEDOUT cypress-ntlm-auth: Certificate validation
failed for " optimizationguide-pa.googleapis.com
<http://optimizationguide-pa.googleapis.com>". ETIMEDOUT cypress-ntlm-auth:
Certificate validation failed for " safebrowsing.googleapis.com
<http://safebrowsing.googleapis.com>". ETIMEDOUT cypress-ntlm-auth:
Certificate validation failed for " vnext.g2claims-dev.genre.com
<http://vnext.g2claims-dev.genre.com>". UNABLE_TO_GET_ISSUER_CERT_LOCALLY —
Reply to this email directly, view it on GitHub <#216 (comment)
<#216 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABCHR3DJWFLRJ5MIVYUGLD3V7LXNTANCNFSM6AAAAAAQQ5IH3I
<https://github.com/notifications/unsubscribe-auth/ABCHR3DJWFLRJ5MIVYUGLD3V7LXNTANCNFSM6AAAAAAQQ5IH3I>
. You are receiving this because you were mentioned.Message ID: @.*>
Yes I have tried with the targeted host as well and still the result is
the same issue
No few days ago i was having trouble with starting the ntlm-proxy, My
cy.ntlm() is not yet working
I am using VPN along with company proxy as well
The log is from ntlm-proxy terminal, I am sharing the new logs as well
[image: image]
<https://user-images.githubusercontent.com/113983022/191502890-ad6a60a1-4dc9-4c28-b2ee-f3e4898c5550.png>
—
Reply to this email directly, view it on GitHub
<#216 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCHR3EVIYJL4PJMZYHKP6DV7L5A3ANCNFSM6AAAAAAQQ5IH3I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@bjowes Yes I have applied the proxy configuration as described in the documentation and the cy.visit('https://google.com/') is working perfectly fine without ntlm-proxy But in this case I am not having access to my company URL which is running on proxy that's why I am trying to use NTLM-Plugin. Hopes the plugin helps me accessing the Target URL NOTE: I am using the VPN and proxy to access the targeted website |
Could you please describe your use case in more detail what do you mean
that you don’t have access to “my company URL”?
Simply put, if you can use a browser (no cypress), access your target site
and enter your credentials in the login prompt, and this works, then the
plug-in can help you to remove the login step (which is not compatible with
automated testing). That is the only purpose of the plug-in. If you cannot
reach the target URL through manual means, the plug-in won’t help.
ons 21 sep. 2022 kl. 15:09 skrev MuhammadJawad1214 ***@***.***
:
@bjowes <https://github.com/bjowes> Yes I have applied the proxy
configuration as described in the documentation and the cy.visit('
https://google.com/') is working perfectly fine without ntlm-proxy But in
this case I am not having access to my company *URL* which is running on
proxy that's why I am using NTLM-Plugin. Hopes the plugin helps me
accessing the Target URL
—
Reply to this email directly, view it on GitHub
<#216 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCHR3GUMIBJ4TUZNW4LY5LV7MCJDANCNFSM6AAAAAAQQ5IH3I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
/Björn W
Skickat från min iPhone
|
I am following the ntlm-auth to access the intranet services. In my case I am having the following things can you think btlm-plugin can solve this issue??? @bjowes please guide if am not on a right path |
From that description, it seems like the correct use case.
When you state that cypress can access other websites but not the target
url, how does cypress respond? Do you get a login prompt or something else?
If you get a login prompt, then the plugin should help. If you get some
other network error, you first need to resolve that.
A network error could for instance be caused by the corporate proxy, if the
target url server is inside your network and connections should not pass
through the corporate proxy.
If this is the case, you need to add the hostname of the target url (and
any other internal hostnames it uses) to the NO_PROXY environment variable
before starting the ntlm-proxy.
This will ensure that connections to the hosts in NO_PROXY will not be
passed through the corporate proxy.
…On Thu, Sep 22, 2022 at 7:32 AM MuhammadJawad1214 ***@***.***> wrote:
I am following the ntlm-auth to access the *intranet services.* In my
case I am having the following things
1: I can access the target url *without cypress* on chrome browser
2: I can other websites on cypress browser
3: *I can not access the target url on cypress browser* and this is my
case.(I am suppose to solve this problem by using your plugin)
can you think btlm-plugin can solve this issue??? @bjowes
<https://github.com/bjowes> please guide if am not on a right path
—
Reply to this email directly, view it on GitHub
<#216 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCHR3CYVPDYCAB5MBXQBP3V7PVNTANCNFSM6AAAAAAQQ5IH3I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@bjowes Kindly look into this as I am curious to use you plugin as soon as possible |
I did reply by email but for some reason github didn't post it. |
I am not sure how cypress will behave when you have settings for NO_PROXY both as environment variable and as npm config. When running cypress (without plugin), look in the proxy settings and make sure that NO_PROXY these matches the environment variable. Also make sure you don't set ports, it should just be hostnames (and possibly wildcards) in NO_PROXY |
Not clear what you mean with the last statement. What does the "Proxy bypass list" say when you run cypress open (not cypress-ntlm open)? |
When I run without ntlm proxy, the cypress configuration show the list of no_proxy variables that i have set for them But in case of ntlm-plugin Its not showing the no proxy variables that i have assigned to it |
Ok, but you have different settings for no_proxy in the npm config and in the environment variable. One of them does not include your target site. Which one shows up in cypress? |
To brute force it, try setting NO_PROXY to * |
I think the system environmental variable shows up in cypress, i have removed the no proxy from npm config file |
In this case( NO_PROXY = * ) both the target url and other URLs are not working, I have tried this with both NTLM-Plugin and without NTLM-proxy |
Well, this means that when bypassing the corporate proxy, you cannot reach google.com (expected), but you also cannot reach your target site. This makes me doubt that your target site really is reachable without going through the corporate proxy. Could you please confirm this? |
Yes my target website is reachable using VPN without using proxy. |
Please explain "using VPN". I presume you have a VPN client on your machine, and use it to connect to the corporate network. Once connected, you can access the target site (and likely other intranet resources). Correct? |
yes you're correct @bjowes, if i am connected to VPN then i can access the target site. Hmmm I have tried once again So When I turned Off my proxy manually, I will not be able to connect to either of the target site or any other website like google.com, it means that without using proxy i am not able to use the internet on browser |
Yes, and it means that you cannot reach the target site without proxy. Try to understand the windows proxy settings in detail to see if this is the case. Usually a "Proxy PAC" file is used for these advanced setups. That file contains logic to find which proxy to use for each site. Or ask someone who knows your corporate network in more detail which proxy is the correct one to use for your target site |
Yes @bjowes you are right. Basically we are using different proxies for different websites. So what will be the solution in this case?? |
@bjowes have you idea on this regarding this case? |
Thanks for confirming. We could have saved some effort if this was clear from the start. Cypress and the plugin (and most node.js based things) only supports ONE http proxy. |
Finally it works for me, By the way the issue was with the domain password. |
Ok, but let’s start with getting cypress to reach the target url. Did you
look into the NO_PROXY setting?
tors 22 sep. 2022 kl. 08:52 skrev MuhammadJawad1214 <
***@***.***>:
I am just updating the above comment. In my case I am having the following
things
1: I can access the target url *without cypress* on chrome browser
2: I can access other websites on cypress browser *(Without ntlm-proxy)*
3: *I can not access the target url on cypress browser (Without using
ntlm-proxy)* and this is my case.(I am suppose to solve this problem by
using your plugin)
[image: image]
<https://user-images.githubusercontent.com/113983022/191677479-e0e1eb65-3019-4357-baaf-71d951fc7f8d.png>
4: I can't access any of the URLs( Even i cannot access google.com as
well ) from cypress browser using *NTM-Proxy*, This is other case with
NTLM_Proxy
—
Reply to this email directly, view it on GitHub
<#216 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCHR3BR4CSILZXK2B3P3RDV7P6ZTANCNFSM6AAAAAAQQ5IH3I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
/Björn W
Skickat från min iPhone
|
While installing the cypress-NTLM-Auth The dist/plugin is not created. Can any one please help @bjowes
1: I am using Cypress latest version with cucumber and typeScript.
2: I have added commands in cypress/support/e2e as follows
import './commands'
import 'cypress-ntlm-auth/dist/commands';
3: My cypress.config file contains
The text was updated successfully, but these errors were encountered: