testing url and login url has different domain #26491
xcx-ytg-fxxn
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
my testing url is “https://cloudrun.run.alipay.net/cloudrun”, when i use cy.visit, it will redirect to "https://auth.alipay.com/login/index.htm?goto=https%3A%2F%2Fopenauth.alipay.com%3A443%2Foauth2%2FpublicAppAuthorize.htm%3Fapp_id%3D2021003175685376%26scope%3Dauth_user%26state%3DaHR0cHM6Ly9jbG91ZHJ1bi5ydW4uYWxpcGF5Lm5ldC9jbG91ZHJ1bi9jb25zb2xl%26redirect_uri%3Dhttps%253A%252F%252Ftcloudrunconsole.run.alipay.net%252Fv1%252Flogin%252Fcallback",which domain is " https://auth.alipay.com" and cypress cannot take effect.
i hava tried to possible solutions: 1. use cy.session(): first login at https://auth.alipay.com and then use cy.visit to visit https://cloudrun.run.alipay.net/cloudrun, it still redirect to https://auth.alipay.com; 2. use cy.setcookie:first login at https://auth.alipay.com and record its all cookies, and then visit https://cloudrun.run.alipay.net/cloudrun and set all cookies, it failed too.
maybe use cy.visit to visit https://auth.alipay.com/login/index.htm with the goto param in cy.origin will take effect, but i do not konw how to get the redirected url of "https://auth.alipay.com/login/index.htm?goto=https%3A%2F%2Fopenauth.alipay.com%3A443%2Foauth2%2FpublicAppAuthorize.htm%3Fapp_id%3D2021003175685376%26scope%3Dauth_user%26state%3DaHR0cHM6Ly9jbG91ZHJ1bi5ydW4uYWxpcGF5Lm5ldC9jbG91ZHJ1bi9jb25zb2xl%26redirect_uri%3Dhttps%253A%252F%252Ftcloudrunconsole.run.alipay.net%252Fv1%252Flogin%252Fcallback" in cypress
how can i fix this problem, can anyone helps me
Beta Was this translation helpful? Give feedback.
All reactions