Skip to content

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

@Magesgsm2016

Description

@Magesgsm2016

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions