cypress-ntlm-auth icon indicating copy to clipboard operation
cypress-ntlm-auth copied to clipboard

Cannot verify baseUrl when using the run command

Open Arsodora opened this issue 4 years ago • 8 comments

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

Arsodora avatar Nov 18 '20 19:11 Arsodora

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.

  • Are you positive that the baseUrl is correct?
  • How do you access the site from the tests, do you use relative paths cy.visit('/') or full url cy.visit('https://myserver.com/')?

bjowes avatar Nov 18 '20 22:11 bjowes

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 avatar Nov 19 '20 01:11 Arsodora

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.

Arsodora avatar Nov 19 '20 14:11 Arsodora

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 [email protected]

bjowes avatar Aug 28 '21 21:08 bjowes

Found an issue, just released [email protected]. Please try that instead.

bjowes avatar Aug 31 '21 18:08 bjowes

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 avatar Nov 03 '21 21:11 smit9234

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

smit9234 avatar Nov 03 '21 22:11 smit9234

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 avatar Nov 03 '21 22:11 bjowes

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

bjowes avatar Nov 21 '22 19:11 bjowes