I'm trying to click on a link to a different domain
I used cy.origin in order to do so but its not working
the link gets clicked and opens but the window is flickering between the page
and a huge text saying :
"YOU ARE VIEWING THIS PAGE IN AN UNAUTHORIZED FRAME WINDOW"
this is the code used to click the link
it('iframe',function(){
cy.get('#ifmail', { timeout: 20000 }).within(function($iFrame){
const iFrameContent = $iFrame.contents().find('a').eq(0)
cy.wrap(iFrameContent).invoke('attr', 'target', '_parent').click()
cy.origin('www.stage-mycwt.com', () => {
// below is the actual link
//https://accounts.stage-mycwt.com/ext/pwdreset2/Reset?adapterId=2AdapterMyCwtWebO
cy.get('#newPassword').type('pass{enter}')
})
})
})
Maybe you are clicking the link too soon?
cy.origin('www.stage-mycwt.com', () => {
cy.wrap(iFrameContent).invoke('attr', 'target', '_parent').click()
cy.get('#newPassword').type('pass{enter}')
...
})