'Cypress| link to a different domain

I'm clicking a link inside an iFrame and the link is to another domain

cypress prints an error and say that the window is an unauthorized frame

this is the code I'm using to click the link

it('iframe',function(){

cy.get('#ifmail').within(function($iFrame){
  const iFrameContent = $iFrame.contents().find('a').eq(0)

  cy.wrap(iFrameContent).invoke('attr', 'target', '_parent').click()
})


 })

I need a solution that is not disabling security on the JSON files.

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source