Cypress - Unable to open link/anchor tag urls in Chrome - cypress

I am trying to navigate to different parts of my web application by clicking on simple anchor tags via cypress using cy.click() method.
The url in the browser updates to the new url but the page load fails. It gives an error and subsequently all the following steps fail. This error is not valid cause I can manually and on Firefox navigate to this with the same steps.
I have tried to cy.wait() also tried to assert using cy.should() till an element is visible but the page itself fails to load.
If I use cy.reload() the page reloads and works fine (new url is already set in the browse).
Note: I am facing this issue only in Chrome and Electron. This is not a problem in Firefox which is surprising.
cy.get("button[href='someLink']").click()
cy.reload()
Cypress runner New Url
On click in the cypress runner I can see "new url" but the redirect fails or just doesn't happen in chrome
In the console I can see New url and Url updated by: pushState
Console url update by pushState
Is the issue with the web app? Or is there a bug on chrome side or cypress is simply not able to route to the url?

Related

Cypress test returns to the login page after clicking the button in another page

I am trying to put a cypress test where after login to the baseUrl page, it moves to the second page. When I click on a button in the second page, it kicks the test back to the login page. I did try this, but it did not work.
cy.visit(Cypress.env('baseUrl')+"/admin);
That indicates the redirected page is not online and cypress tries to go to the baseurl. Check if all the consoles for the project are started and compiled correctrly and rerun the test
This fixed the issue. Source:https://docs.cypress.io/api/cypress-api/cookies.html#Preserve-Once
Cypress.Cookies.preserveOnce('SessionID', 'auth_cookie');

Web API for iOS opening new browser tabs

When the Square app is calling my web app callback url Safari opens the callback url in a new tab every time I complete a transaction. This results in numerous tabs being opening. Am I doing something wrong or is this to be expected?
That is the expected behavior.

IE11 losing session or cookie info after window.open

Here's my problem
I have a website(X1.com) which contains a login and a button(window.open) after login to open another app (X2.com) in a detached window.
this X2.com has list of items and when I double click an item it is supposed to open X1.com/item1.
All of this was working as expected when I was using IE9, chrome and firefox.
But when updated my IE9 to IE11 double clicking the item on X2.com is taking to the login page of X1.com saying session timed out. Chrome still works fine. When I close/logout and login again to X1.com keeping X2.com window open X2.com is able to open that X1.com/item1 page properly.
Is there an internet option or security setting or a plugin in IE that's blocking X2.com from opening X1.com/item1 page first time?
My company uses IE11 only for operations and that's why I have to get it working. Please ask if my question is not clear. I can provide the exact urls if required.
It's a common issue in IE11, as a workaround add registry entry of value 0 at:
HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/Main/TabProcGrowth

Html5 pushstate internal service error when page refresh, or view source code

i am attempting to copy a tutorial example found here http://html5.gingerhost.com/ but whenever i try to refresh the page it takes me to a "500 Internal Server Error". also when i click the link and the page loads the other content, when i look at the source code it only shows my another "500 Internal Server Error"
please help!
thanks alot!
This is because the server needs to be able to understand the URLs too. So for example, you're page is at http://example.com. You use a link's click event to make it http://example.com/more-info. But if http://example.com/more-info doesn't exist on the server, refreshing the page won't work properly because the browser won't know that /more-info is actually part of the index page. So pushstate only works if the client and the server both recognise the new URLs.

Ajax + pushState bug in Chrome

I've encountered a strange bug in Chrome 19. I implemented a full-AJAX website (every non-external link is opened via AJAX request) with pushState support. I transmit the HTML snippets in AJAX via JSON format.
When I leave my site via an external link and then go back, Chrome renders cached data for that URL - the problem is, he caches the JSON content and shows that, instead of full web-page.
This is reproducible by these steps (UPDATE: I removed AJAX functionality on my website since then, so this bug does no longer appear):
Open http://beta.mirtes.cz/
Click on the second date link (16. 6. 2012 next to "It all began with a strange e-mail"). This page (you are now at http://beta.mirtes.cz/it-all-began-with-a-strange-e-mail) is loaded via AJAX.
Click on "It all began with a strange e-mail". You are redirected to an external website.
Click "Back" in Chrome after the page is completely loaded.
I try to send all AJAX responses with Cache-Control: no-cache, but with no effect.
Firefox 12 works OK.
I came with a workaround - I perform AJAX request with additional dummy GET parameter - ?ajax=1. This way the browser can recognize the difference between usual HTML content and JSON. It doesn't have any impact on the user, the parameter is visible only in Firebug.

Resources