Cypress for multiple windows - cypress

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

Related

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 execute non stop first attempt when retry functionality is enable

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

Cookies in MS Teams Tab application

I've been trying to work out authenticating users into my app, which is running inside a MS Teams Tab application, and I'm having issues in mobile.
To authorize requests in the application, we just need to have a cookie in place that the server sets when the user authenticates. So for this to work inside Microsoft Teams, I've been trying to just send the token to the iframe and set the cookie. Everything works pretty well on web and desktop, but on mobile (I've tested only with iOS so cannot really tell about Android), the cookie doesn't work at all.
I've tried to set some test cookies and read them, and it doesn't work. So my question is if there is a way to work with cookies in mobile? Is it an issue on my end or has it been disabled in the web view that loads the tab? Is there a way around it or any suggestion that would help solve my problem?
Thanks for the help!

Internet Explorer waits to user action - no refresh in the background

I am facing very interesting issue and I am not sure what can cause this. I am using SSO SAML for authentication to the system and IE11 as the browser to access the application. After some time (e.g. 5 min) the session terminates and it is renewed and it is a background process. Somehow only in IE, the session is not renewed until I maximize the browser and do some user action (after that it works). Other browsers are not affected and everything works in background properly. Do anyone know what can cause the issue in IE that the browser needs to user action?

How to integrate google contacts api in node webkit

I need to integrate google contacts import in my nw.js app. How should I create the google app ? When I create the app as web app, it asks for redirect uri which is not available for desktop apps. I'm not clear about how to implement google integration for desktop apps. Can anyone help me on this. ?
There is an option in OAuth for desktop applications, when instead of http://domain you will redirect to app://something and you application will be started or receive a callback.
To make this, in your application you need to open request token url in new window (new window in your node-webkit app).
Also: google docs and node-webkit github issue and other issue about this.
For me I thought better would be open a default browser, there is a high chance that user already authenticated, and then just need to click "allow". So I start simple webserver inside node-wekit app and redirect to localhost.
You can see implementation in my project https://github.com/Paxa/postbird/blob/90cfb53b1775310eb2f262c8b54c9dba15b5cc0a/app/heroku_client.js#L185
To open default browser I use command "open" (only for mac)
child_process.spawn('open', [url]);
I also try to close browser window when user redirected back, it works but not always.
response.writeHead(200, {"Content-Type": "text/html"});
response.end("<script type='text/javascript'>window.close();</script>");
May be I should also make a window active when receive redirect back (didn't try it yet):
var currentWin = require('gui').Window.get();
currentWin.focus();
If google not allows to make localhost as a callback url, you can try to use some domain (even free) and point it to 127.0.0.1 or use http://readme.localtest.me/

Resources