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
In OIDC login, call back page doesn't load completely #26020
Comments
So it sounds like you make it past log in and load the deployed version of your site but you aren't able to interact with it with the second cy.origin block? You could try a couple of things.
Also you should check into our cy.session command. You can capture sessions from one url and apply it to another, that may help with your use case. |
@mjhenkes Thank you very much for the response and for your awesome library. |
Maybe try this flow?
*apply tokens to localhost It certainly isn't ideal having to run your main test body in a cy.origin block, however we will be fixing the typescript cy.require issue in our next release: As for applying cy.session, it's job is to capture and cache cookies, local and session storage and restore it. Off the top of my head I'm not quite sure how to apply it to other sites, you might need to play around with it to get it right. |
Thank you very much for the time you are putting in. I appreciate it. |
@MajidBabaeifar, my suggestion is close to what you had above, but not quite the same. Specfically the first cy.origin call to https://myonlineversionoflocalhost.com/. Did you try that and did it still fail? |
I am going to close this due to inactivity, but if this is still an issue let us know @MajidBabaeifar ! |
Hi again, |
Same issue. I can login normally, and very fast if I don't use Still have no clue. Edit:
|
Interesting. Is there anyway we can either get a full reproduction repository where we can reproduce the issue from cloning a git repository? I think I have seen this issue before when logging into twitter with Cypress, but the issue hasn't been present for some time (with twitter at least). I think the struggle currently is going to be able to reproduce this, which will allow us to identify and solve the problem. Would either of you be able to provide a fully reproducible example? |
I have updated the above comment.
I have tried to SSH to CircleCI to debug but still have no clue, everything look good, just page |
I have a similar issue and have been communicating with @canourrea23 on it. I shared a repository and credentials which she has been able to use to reproduce this issue. The issue is a blocker for us so it would be great if this issue could be prioritised. |
Hi @stephenmee. We have the reproduction and are able to reproduce it. I am going to route this issue over to the e2e team. |
Hi @AtofStryker @canourrea23 is there any update on this issue? It is a complete blocker for our automation. |
I have solved it by doing the normal login with a cypress command. I leave an example: the important thing is to use cy.origin My env:
Cypress.Commands.add('login', (url, email, password) => {
cy.session('appLogin', () => {
cy.clearData();
cy.visit(url);
cy.origin('https://login.microsoftonline.com',
{args: [email, password]},
([email, password]) => {
cy.get('#otherTile').then(($element) => {
if ($element.length !== 0) {
$element.click();
cy.log('Elemento encontrado');
}
});
cy.get('input[type=\'email\']').click({force: true});
cy.get('input[type=\'email\']').type(email);
cy.get('input[type=\'submit\']').click({force: true});
cy.get('input[name=\'passwd\']').type(password);
cy.get('input[type=\'submit\']').click({force: true});
cy.get('[type="checkbox"]').check()
cy.get('input[type=\'submit\']').click({force: true});
});
cy.wait(3000);
cy.visit(url);
});
});
|
@pookdeveloper |
Current behavior
I have a website that uses Open ID for login and after the login is successful, the provider website sends the user back to a URL to the actual website and I can't control this. for example user has to go to "localhost:3000" click on login button and then gets redirected to "someLoginProvider.com/login" and then after the login, user will come back to "myOnlineVersionOfLocalhost.com/callbackFromLogin" !
Here is the way I've tried to do this:
In cypress.js file I set the basic origin to localhost. and for login I try like below:
The idea is since my login is based on JWT stored in local storage, I wanted to do the login on my actual website, pickup the values from local storage, then visit my localhost and paste the values inside local storage. The problem is that when I run this test, after the click on submit, the browser doesn't go back in the https://myOnlineVersionOfLocalhost.com. Actually the website shows up on screen but the URL doesn't change. So it get stuck in load page situation.
Desired behavior
After I click the submit button in login page, It should redirect me back to my online website. It shouldn't stuck on page loading for no reason.
Test code to reproduce
Cypress Version
12.6.0
Node version
16.14.2
Operating System
windows 10
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: