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
After the SalesForce Login it shows the "Whoops, there is no test to run" #2367
Comments
I have the same problem to test the Salesforce site. Is there are any workaround? thanks |
This is SF clickjacking protection. It forces the login form action to run on |
@johncblandii is right. At some point, probably at a login attempt, there was a script like so you should disable the anti-clickjacking code if you're trying to test that page, and if you don't own the code on that page, work around it by logging in via an API or query params in the url |
Anyone with a workaround to log in to Salesforce please help me I'm completely stuck. Thanks. |
@Bkucera Could you please help how to disable the anti-clickjacking code. Thanks. |
@simonmagabe if you control the source code, find the code that calls if you don't control the source code, you can't. This is why we suggest not to test pages you don't control. Instead, try logging in programmatically with |
Turning off anti-clickjacking doesn't work, @Bkucera. Cypress should look at moving beyond the iframe so it can be used for more than "we own all of the code" scenarios. To help understand why this keeps being an issue, Salesforce testing isn't about testing their sign in. It is about signing into their system and testing custom apps built on the Salesforce stack. By not using an iframe in TestCafe, I signed in easily on SF and wrote tests quickly. @simonmagabe that is something you have to get Salesforce to do. |
I am having the same issue. Is this iframe problem also happening in headless mode? |
@johncblandii yes this is the downside of Iframing the app, without rewriting all the AST in the proxy (which is possible). Current WorkaroundWe recommend using the Salesforce API to generate a user session, by using |
@Bkucera I'm currently running into the same issue. I'm new to Cypress and was wondering if you could explain how this issue could be bypassed. |
@Bkucera, we ditched Cypress long ago for this reason and lack of other browser support. I couldn't make the case for Cypress with these issues. Making an API request to auth was clunky for us when better solutions existed on other test platforms. I hope it continues to improve. It is so close to being great. |
I don't think the current workaround works. I can create the session using Here is my test code cy.request({
method: 'POST',
url: 'https://xxxxxx.my.salesforce.com/services/oauth2/token',
form: true,
body:'grant_type=password&client_id=MY_ID&client_secret=MY_SECRET&username=MY_USERNAME&password=MY_PASSWORD'
});
cy.visit('https://xxxxxx.my.salesforce.com/lightning/setup/SetupOneHome/home') note the post url isn't to |
^ seeing the same issue |
Is there no fix for this? This issue was posted a year ago and its ongoing. Please provide some follow up as we are still having this problem |
Current recommended workaround is in this comment: #2367 (comment) We haven't written out a specific example of exactly every piece of code to write to work around this. So, any suggestions from people who have gotten this working is appreciated. |
@jennifer-shehane I tried the workaround using the code I posted above, which sends a request that works and returns an access token that we can verify is valid, but we noticed that cy.setCookie('sid', 'access_token') which does save a cookie but doesn't allow us to bypass the login as suggested we assume this is because cy.setCookie('sid', 'access_token', {
path:'/',
httpOnly: true,
secure: false,
domain: 'domain_name'
}); I have not tried any of the above on any other site other than for trying to login to our salesforce scratch org, so I'm not suggesting these methods are broken but I may be using The actual app we want to test isn't built using salesforce so we are just going to mock the backend and test the UI standalone but it would be nice to be able to run the tests by going through salesforce so if anyone has any luck please let me know as there is very little information out there where people use cypress for testing Salesforce apps. |
Hey guys, Example: cy.visit("https://test.salesforce.com/un=test.user%40workspace.com&pw=your_password&startURL=%2F001") the It worked for me, hope it helps :) |
Thanks for this, but unfortunately doesn't work for me, when I try it through cypress I get the message |
So I managed to get this to work manually by using the following URL https://test.salesforce.com/login.jsp?un=user%40scratch.com&pw=thePassword123 oddly when doing it manually if you try it a second time in the same session it complains the password is wrong. When trying with cypress I get a security error
Which looks like it can be fixed by setting
which I'm guessing is a salesforce security option denying this. is there something you @bassolini have set in your org to allow this to work? |
Hey, sorry small mistake, I missed the ? before the un= https://test.salesforce.com/?un=test.user%40workspace.com&pw=your_password&startURL=%2F001 |
I'll re-open this for visibility, since it is an issue many users will run into and it is possible we may be able to fix this in the futue |
@bassolini your solution worked for me, I’m able to login into Salesforce. It’s a wonky workaround but it works for now. Thanks.
…Sent from my iPhone
On Sep 3, 2019, at 7:07 PM, Ben Kucera ***@***.***> wrote:
I'll re-open this for visibility, since it is an issue many users will run into and it is possible we may be able to fix this in the futue
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This worked for me. Thanks! |
I had the same problem as almost everyone I think... So what I have was 2 work arounds : so If access that link first , it won't close the left panel , some developer needs to investigate this |
Has anyone tried these approaches on Winter '23 and got it working? I can use these on the previous release but now Salesforce just hangs showing the Winter '23 logo. |
@jennifer-shehane Could you please update us on this if you can? i believe this is a global issue |
Hey all! Have any of you tried the |
@AtofStryker Yeah tried it but no success |
@jeanabanto It is global problem (see #23958). |
Hey all. We appreciate your patience on getting this issue resolved. The "Whoops, there is no test to run" needs to have the |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
After Cypress complete the fields and click login, the screen shows "Whoops, there is no test to run" and stop the test.
I asked this issue in https://gitter.im/cypress-io/cypress, and someone told me that its because Cypress doesn't allow you to change domains.
I tried this, I used my browser, and login as a real human would do, then I copied the url that the authentication generated into the Cypress test to "pre-load" the domain after the login change it, as shown below;
Desired behavior:
After login Cypress redirect me to SalesForce dashboard.
Steps to reproduce:
Versions
Cypress version 3.0.3, Mac Os, Google Chrome
The text was updated successfully, but these errors were encountered: