Open nitish-Datman opened 1 year ago
@emilyrohrbough let me know if this can be resolved
@nitish-Datman It appears the redirect is busting out of the AUT (application under test) iframe. Have you tried/considered enabling modifyObstructiveCode
to see if this prevent this behavior?
@emilyrohrbough i have tried , did not help
i meet the same issue, when request my domain , the response submit redirect html ,then cypress runner getting exit, jump to redirect domain , can i know cy.origin can cover it?
@jennifer-shehane can this be resolved please
Right now there doesn't seem to be enough information to reproduce the problem on our end. Unless we receive a reliable reproduction, we'll eventually have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.
Please provide a reproducible example of the issue you're encountering. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.
describe("Test", function () {
it("Test flow", function () {
cy.visit('http://shorturl.at/IMNQV')
cy.get(nameOnCard_input, { timeout: 25000 }).type("nitish");
cy.get("#cardNumber")
.iframeLoaded()
.its("document")
.getInDocument('input[name="cardnumber"]')
.type('4929421234600821');
cy.get("#expiryDate")
.iframeLoaded()
.its("document")
.getInDocument('input[name="exp-date"]')
.type('1123');
cy.get("#cvv")
.iframeLoaded()
.its("document")
.getInDocument('input[name="cvc"]')
.type('356');
cy.xpath("//body/div[@id='__next']/div[1]/section[2]/div[2]/div[1]/form[1]/div[1]/button[1]")
.click()
});
});`
add this in command.js
Cypress.Commands.add(
'iframeLoaded',
{ prevSubject: 'element' },
($iframe) => {
const contentWindow = $iframe.prop('contentWindow')
return new Promise(resolve => {
if (
contentWindow &&
contentWindow.document.readyState === 'complete'
) {
resolve(contentWindow)
} else {
$iframe.on('load', () => {
resolve(contentWindow)
})
}
})
})
Cypress.Commands.add(
'getInDocument',
{ prevSubject: 'document' },
(document, selector) => Cypress.$(selector, document)
)
@chrisbreiding i have added the code snippet to replicate the issue , hope this helps
I'm unable to reproduce the issue with the code provided. The variable nameOnCard_input
is undefined. If I substitute it with a selector for the only input on the page visited, the next command (cy.get("#cardNumber")
) fails because there's no element with an id of cardNumber
on the page.
@chrisbreiding apologises as i missed to add the locator for nameOnCard_input
here is the locator for the same #nameOnCard
and for (cy.get("#cardNumber")) its an iframe , you need to add the iframe support command line in the command.js page as mentioned above.
proving you few urls as it gets expired after visiting once,
Unfortunately none of those urls worked. It's possible, since they're links, a web crawler is picking them up and invalidating them by visiting the url. Could you post a few more, but just the IDs (so they don't turn into links)?
here are the url id's below,
seems like all the urls are expiring , i'm adding in the sheet https://docs.google.com/spreadsheets/d/1z08dCTFnGuqmPWmHmaWFY9kGxFwPxgjqZ03NaovQ644/edit?usp=sharing
once you request for access will provide the same
@chrisbreiding shared
I was able to get the example code running by visiting one of the urls in the sheet, but the test passes and I don't see any failures or a redirect happening. Although the click command succeeds at the end, it doesn't seem to have any effect, so it doesn't go as far as the test in your video.
I know you tried using modifyObstructiveCode
and it didn't work, but this might require using experimentalModifyObstructiveThirdPartyCode
. Can you trying setting that to true
in your cypress.config.js
and see if it helps?
it didn’t help, now the wired part is while experimentalModifyObstructiveThirdPartyCode: true,
adding this to cypress.config.js
iframe is not even loading ,
for iframe to load now i have to give now modifyObstructiveCode: false
without experimentalModifyObstructiveThirdPartyCode , no idea what has changed
Interesting, I was able to reproduce the issue after setting modifyObstructiveCode: false
. Now that I've reproduced it, I'm going to route this to a team to look into.
Here are debug logs I captured when reproducing the issue: debug.log
@chrisbreiding When is the issue is planned to fix
I am facing the same issue, Can any one share the solution if possible? while running the test , cypress runner getting disappeared on redirect,
Same here but my dashboard just get restarted.
Same here my dashboard get restarted. I tried to use modifyObstructiveCode
and experimentalModifyObstructiveThirdPartyCode
but without success
I noticed, that in my case that issue mostly exists while using Chrome - both Edge and Electron work fine most of the time (it still happens from time to time) Looking forward for it to be fixed
Hello, this is happening to me with the same payment platform! we are simulating a payment and once we confirm it redirects to a new page and the Cypress sidebar disappears! Just like in the video, what can we do ?? is there any workaround ??
Hello,
Please keep proper wait time before redirecting to other page.It works
Best regards
On Fri, Dec 8, 2023, 10:45 AM crismarycastellanos @.***> wrote:
Hello, this is happening to me with the same payment platform! we are simulating a payment and once we confirm it redirects to a new page and the Cypress sidebar disappears! Just like in the video, what can we do ?? is there any workaround ??
— Reply to this email directly, view it on GitHub https://github.com/cypress-io/cypress/issues/23751#issuecomment-1847509014, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOSJZO3A7MQSED4VMOBCCJDYIM74FAVCNFSM6AAAAAAQIW5BE6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXGUYDSMBRGQ . You are receiving this because you commented.Message ID: @.***>
Any news on this issue, seems we facing something similar.
Any update on the issue?
I am getting this issue as well. The behavioral difference being that when the redirect fires the Cypress controls disappear and the non AUT browser resolves to the redirected page. This makes the headed runner basically unrecoverable and require a restart.
I have the same issue. Because of security reasons i cant provide any reproducible code, but the problem for me happens when a payment gate redirects to authentication page. For a second the GUI shows "Your tests are loading..." and then exits out of the current test to the Specs list.
I tried both modifyObstructiveCode
and experimentalModifyObstructiveThirdPartyCode
unfortunately with no luck.
I have the same issue. Because of security reasons i cant provide any reproducible code, but the problem for me happens when a payment gate redirects to authentication page. For a second the GUI shows "Your tests are loading..." and then exits out of the current test to the Specs list.
I tried both
modifyObstructiveCode
andexperimentalModifyObstructiveThirdPartyCode
unfortunately with no luck.
I am experiencing exactly the same issue with a payment gateway for an e-commerce platform. Unfortunately, I cannot provide the code for security reasons. Is there any news on this issue? I have tried many workarounds, but nothing has worked for me so far.
Current behavior
while running the test , cypress runner getting disappeared on redirect,
Desired behavior
cypress runner should still be visible on redirect
Test code to reproduce
https://user-images.githubusercontent.com/62381266/189370370-c5597087-2d1d-478c-b043-56f31c0c2ce6.mov
Cypress Version
10.6.0
Node version
v16.16.0
Operating System
macOS 11.2.3
Debug Logs
No response
Other
No response