I would like to know how to capture and read the URL after a click event on an <a>
link.
On the onClick event our javascript does some string manipulation of the actual href
of the clicked link and then a window.location.href = myNewReplacebleURL
is done on the fly. The original href
is not necessarily the location you get to after the onClick.
Here is how I started:
describe("Twitter", function() {
it("Should assert that via value is set correctly in JS", function() {
cy.server();
cy.visit(Cypress.config("appUrl") + "/probes/sha/sha-via.html");
cy.get("#v_test ul.share li a")
.click();
});
});
EDIT: What I would like is to catch the URL located at the "Page Load" step.