question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Basic auth in baseUrl does not work in electron browser

See original GitHub issue

Current behavior:

If I have a baseUrl in cypress.json:

{
  "baseUrl": "http://username:password@test.dev.mypage.com"
}

then a basic cypress run does not work. I get this error:

Timed out waiting for the browser to connect. Retrying...

This also happens if I run --headed.

It does work in latest Chrome (66).

Desired behavior:

It should open the page with basic auth data.

Steps to reproduce:

  1. Add baseUrl to cypress.json:
{
  "baseUrl": "http://username:password@test.dev.mypage.com"
}
  1. Do cypress run

Versions

Cypress 2.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
rgrigelcommented, May 3, 2018

We ran into this issue in our project when updating Cypress from 1.4.2 to 2.1.0. There is a workaround based on (https://github.com/cypress-io/cypress/issues/1115). We extended Cypress’s visit command with:

Cypress.Commands.overwrite('visit', (orig, url, options) => {
  options = options || {};
  options.auth = {
    username: Cypress.env('AUTH_USER'),
    password: Cypress.env('AUTH_PASS')
  };
  return orig(url, options)
});

and we are running it with:

CYPRESS_AUTH_USER=user CYPRESS_AUTH_PASS=pass CYPRESS_baseUrl=https://app.com cypress run
2reactions
Narretzcommented, Apr 25, 2018

Important note: It works with the auth parameter in “cy.visit”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron basic auth pop up not working - Stack Overflow
Show activity on this post. I am trying to open my node website inside electron app using its url, the node app has...
Read more >
Web Security - Cypress Documentation
Browsers adhere to a strict same-origin policy. This means that browsers restrict access between <iframes> when their origin policies do not match.
Read more >
authentication failed: Invalid Base URL. - Zapier Community
Basically this means you weren't able to connect Zapier to your app. Good question.
Read more >
session | Electron
Manage browser sessions, cookies, cache, proxy settings, etc. ... This class is not exported from the 'electron' module. It is only available as...
Read more >
HTTP REST API Calls in ElectronJS - GeeksforGeeks
We assume that you are familiar with the prerequisites as covered in the above-mentioned link. For Electron to work, node and npm need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found