Skip to content
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

DOMException: Failed to set the 'domain' property on 'Document': 'azure.com' is a top-level domain. #29445

Closed
Magesgsm2016 opened this issue Apr 30, 2024 · 9 comments

Comments

@Magesgsm2016
Copy link

Magesgsm2016 commented Apr 30, 2024

Current behavior

Hi
I'm trying to tests a website on an Azure domain which looks like:

cy.visit("https://smart-05.eastus.cloudapp.azure.com/ps/it/ui/smart/global/")

I'm facing this issue that above Url not launching in chrome and edge browser. Still it is working fine with electron browser.
it was worked fine earlier in all my browser. Recently chrome version is updated to 124 .post update of chrome I'm facing the below mentioned issue.
my terminal just hangs after (Tests Starting) without stopping or showing any error.
When I try to run cypress, I'm getting the following error:

Uncaught(in promise) DOMException: Failed to set the 'domain' property on 'Document': 'azure.com' is a top-level domain.
    at $Cypress.configure (https://smart-05.eastus.cloudapp.azure.com/__cypress/runner/cypress_runner.js:40723:23)
    at $Cypress.create (https://smart-05.eastus.cloudapp.azure.com/__cypress/runner/cypress_runner.js:41231:13)
    at EventManager.setup (https://smart-05.eastus.cloudapp.azure.com/__/assets/index-9bf45ce8.js:133048:52)
    at Object.executeSpec (https://smart-05.eastus.cloudapp.azure.com/__/assets/index-9bf45ce8.js:133627:27)**
Error is throwing in the  domainName
=========================
     if (domainName && config.testingType === 'e2e') {
      document.domain = domainName
    }

cypress version :13.7.3
could you please help to resolve it ?
Reference:Issue with domains in 'baseUrl' having several dots #1680

Desired behavior

No response

Test code to reproduce

when i command "npx cypress open" and click on the specific specs file

cy.configurationPage(envData.aiopsLogInUrl, envData.userName, envData.password, envData.projectName);

should be launch in cypress runner

Cypress.Commands.add("loginProjectPage", (url, username, password) => {
  cy.visit(url);
  // cy.wait(10000)
  cy.get(homePage.txtUserName).type(username);
  cy.wait(1000)
  cy.get(homePage.txtPassword).type(password);
  cy.wait(1000)
  cy.get(homePage.btnLogin).click();
  cy.get(homePage.txtProjectListing, { timeout: Cypress.config("defaultCommandTimeout") }).should("be.visible");

});

envData

export class Utility {
  getEnvData() {
    const qa = {
      userName: "adxxxxx",
      password: "23456",
      aiopsLogInUrl:
        "https://smart-05.eastus.cloudapp.azure.com/ps/it/ui/smart/global/"
}

Cypress Version

13.7.3

Node version

v18.16.1

Operating System

window 10

Debug Logs

No response

Other

No response

@HiQ-MartinMichalek
Copy link

HiQ-MartinMichalek commented May 8, 2024

Hello there,

I am facing the same issue with 'azureedge.net' since Chrome version 124.

I tried using experimentalSkipDomainInjection, but to no avail.

Chrome: V 124
Cypress: V 12.5.1
Node: v20.5.1
OS: Windows 10

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label May 16, 2024
@AbdelazizBannani
Copy link

@Magesgsm2016
this solved it for me:
add the following to your config file. → experimentalSkipDomainInjection: ["*azure.com"],

@AOT1000
Copy link

AOT1000 commented May 23, 2024

I am facing the exact same issue with another application installed in an Azure machine that is exposed to the internet.
@AbdelazizBannani , could you please elaborate on which config file you added this to?

@AbdelazizBannani
Copy link

@AOT1000 I am using the most recent cyperss version (13.10.0) and I just added the following to my "cypress.config.js"

**experimentalSkipDomainInjection: ["*azure.com"],** video: true, chromeWebSecurity: true, screenshotsFolder: "cypress/screenshots", videosFolder: "cypress/videos",

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Nov 20, 2024
@jennifer-shehane jennifer-shehane added stage: investigating Someone from Cypress is looking into this and removed stale no activity on this issue for a long period stage: needs investigating Someone from Cypress needs to look at this labels Dec 3, 2024
@jennifer-shehane
Copy link
Member

We are working on a fix for this in Cypress 14.

@AbdelazizBannani
Copy link

@jennifer-shehane great to hear. Thnx for the feedback

@AtofStryker
Copy link
Contributor

closing as this is resolved with #30770 and will be released with Cypress 14

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 16, 2025

Released in 14.0.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v14.0.0, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: investigating Someone from Cypress is looking into this label Jan 16, 2025
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants