Cypress execute non stop first attempt when retry functionality is enable - cypress

Our application uses as login method Microsoft Azure OAuth2. As result when the user tries to open the application is redirected Microsoft Azure login page. This redirection caused to me an issue when a test failed and Cypress tries to re-executed. So, when the test failed then Cypress window is reload and lost the information that test executed already once. As result re-execute non stop the first attempt. Please for your help on that.

Cypress is focused in the testing of a single web page on purpose. But in your case it makes sense to trick cypress.
This must solve your issue: Access a new window - cypress.io

Related

Is Cypress compatible with Salesforce?

After I log in, the domain changes and it doesn't do anything else that my script tells it to do. Is it the case that you just can't do anything once the domain changes? I can't quite tell from the documentation. I know it says that it can't navigate to a second domain, but I haven't seen where it says it can't do anything on a second domain.
Additionally, did Cypress used to login to Salesforce with cy.request()? Because currently Salesforce doesn't allow for logging in by sending a request with parameters.
cy.visit('https://test.salesforce.com');
cy.get('.username').type(username)
cy.get('.password').type(password)
cy.get('#Login').click()
This is my code for logging in.
Hi you can use Session in cypress in order to Cache and restore cookies, localStorage, and sessionStorage
Just create a command in ./support/command.js
You can read the documentation here https://docs.cypress.io/api/commands/session#Syntax

How to authenticate to microsoft via cypress

Before entering my application, I have keycloak configured, which takes me to authenticate with microsoft, which makes opening a new tab in cypress and causing me to miss any manipulation, how to handle this?

Cypress for multiple windows

have a scenario where on launching the application, redirects to a new window for authentication and on entering the creds, the user is allowed to access the application. As multiple window handling is a trade off for cypress, is there any workaround for this?
Cypress can't work with multiple windows.
Follow: Multiple browsers open at the same time

Selenium webdriver takes 25 mins to identify and click an element

This is Salesforce application with selenium Java.
Scenario:
Login to Salesforce with username, password and click on login
After that click on account tab in the Salesforce homepage.
Issue:
Salesforce login functionality is working fine. No issues.
After login to Salesforce it take 23 mins to perform the next action (click on Account tab link)
Here I used explicit wait of presence of element for 30 secs for the account tab link before click operation.
My script is not getting failed. I am not getting any timeout exception or no such element exception and my script is successful only after 23 mins (it takes 23 mins to identify element and click an element)
With same selenium code I tried with different Salesforce application but this time everything works as expected(after login I am able to click on account tab link). I never change the code. I just changed the application URL
I am thinking there might be an issue with application.but I am not sure about exact issue.
At least I should have received timeout or no such element exception
Or my script should have executed right after login without 23 mins of delay
I tried all the possible options like Page load strategy, fluent wait and explicit wait. Nothing works for me
If you are facing cannot read property 'defaultview' of undefined. Or
If you are unable to perform any actions on Salesforce homepage or
If selenium web driver takes much time to perform the actions in Salesforce home page or
If your script is working fine with debug mode and not in run mode, please follow the below steps:
Launch the Salesforce URL
Do not login immediately, this will create the above problems instead apply some wait ( Apply thread.sleep for 8 to 10 sec)
3)Enter username and password and click on login button
now you are all set. Your are good to perform any actions in SF home page.
Thanks!

Trying to stop brute force login attempts in Joomla using onLoginFailure() function. Need help

I'm trying to develop a module for Joomla 1.5 that identifies brute force login attacks and shuts them down.
I found a function called onLoginFailure() that gets called when a login attempt fails. From within that function, I'm trying to figure out which username was used for the login attempt. After 5 failed login attemps, I want to then prevent any more attempts by the user for an hour.
Is anyone familiar enough with Joomla to help me
1) access the username from within the onLoginFailure() scope
2) help me identify the best place for my code to prevent login attempts (redirect to a page that tells them they are banned for an hour).
The best existing module I've found is someone who did a 10 second delay between login attempts...
I would create a component with an Authorization plugin (mainly a copy of joomla.php but adding these implementations).
The component is responsible for creating all the logic behind your logins (persisting all login attempts from a user, configuration for redirects, etc) and your Authentication plugin for checking if everything is correct.
Then you deactivate joomla.php and keep just your own authentication module.

Resources