bjowes / cypress-ntlm-auth

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

Cannot verify baseUrl when using the run command #145

Closed Arsodora closed 1 year ago

Arsodora commented 3 years ago

Hi,

I am trying to execute a run using the following command and the test does not start because it cannot verify the server is running. We have a warning when we run the test with the CLI but all test execute properly.

Is there a way to get the login done before the server verification is done or disable the server verification?

Thanks

$ npx cypress-ntlm run

Execution trace

Cypress could not verify that this server is running:

https://servername.com

We are verifying this server because it has been configured as your baseUrl.

Cypress automatically waits until your server is accessible before running tests.

We will try connecting to it 3 more times... We will try connecting to it 2 more times... We will try connecting to it 1 more time...

Cypress failed to verify that your server is running.

Please start this server and then run Cypress again. Cypress could not execute tests Could not find Cypress test run results npm ERR! code 1 npm ERR! path /home/... npm ERR! command failed npm ERR! command sh -c cypress-ntlm run

npm ERR! A complete log of this run can be found in: npm ERR! /home/...

Thanks

bjowes commented 3 years ago

Hi @Arsodora

Actually, cypress will only validate if is able to open a connection to the server in baseUrl - it will ignore 401 status codes since cypress knows that login may be required. Hence, it doesn't use the plugin at startup validation.

Arsodora commented 3 years ago

Hi @bjowes,

Thanks for your response.

I added a '/' at the end to have "baseUrl": "https://servername.com/"

I still have the issue in the CLI I in when using the run.

When I do the visit , it is always for sub page, so it is always in the following format cy.visit('Form/pagename/')

Arsodora commented 3 years ago

Hi @bjowes,

Something else I noticed. Same config, if i start Cypress using 'npm cypress open' -- no warning message

But if I start it using 'npm cypress-ntlm open', I get the warning message.

Cypress version 5.6.0.

bjowes commented 3 years ago

This might actually be related to HTTPS certificate validation. I have just made a beta version available that will accept (but warn) invalid (such as self signed) certs by default. Please try it out to see if that helps. npm i cypress-ntlm-auth@4.0.0-beta.1

bjowes commented 3 years ago

Found an issue, just released cypress-ntlm-auth@4.0.0-beta.2. Please try that instead.

smit9234 commented 2 years ago

I am running into the same issue I think, this just started happening using Cypress 8.7.0. I have tried reinstalling Cyperss and Cypress NTLM, but always returns this. Is there a way to check that the ntlm proxy is accepting connections?

cypress:server:events got request for event: ping:baseUrl, 'https://someurl' +5s cypress:network:agent addRequest called { isHttps: true, href: 'https://someurl' } +5s cypress:network:agent got family { family: undefined, href: 'https://someurl' } +1ms cypress:network:agent Creating proxied socket for https://someurl/ through http://127.0.0.1:61537 +0ms cypress:network:connect retries exhausted, bubbling up error { iteration: 0, err: Error: connect ECONNREFUSED 127.0.0.1:61537 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 61537 } } +5s cypress:server:events send error: Error: Cypress could not verify that this server is running:

smit9234 commented 2 years ago

@bjowes The issue was with Node 17, reverted back to 16 and all is well.

bjowes commented 2 years ago

Thanks for the update! I’ll have a look what needs to be updated for node 17

ons 3 nov. 2021 kl. 23:19 skrev Jason Smith @.***>:

@bjowes https://github.com/bjowes The issue was with Node 17, reverted back to 16 and all is well.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/bjowes/cypress-ntlm-auth/issues/145#issuecomment-960235065, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCHR3FSKEFKKQS7Q4WAM6DUKG7PBANCNFSM4T2NQIEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- /Björn W

Skickat från min iPhone

bjowes commented 1 year ago

The current plugin version is compatible with Node 17 and 18.