How can I dynamically retrieve the URL of a preview app created on Vercel when a pull request is made in a Next.js project deployed via GitHub? I want to utilize Cypress for testing purposes on this deployed app, but I’m unsure how to automatically obtain the preview app’s URL for visiting it in Cypress tests.
describe("template spec", () => {
it("passes", () => {
cy.visit("url");
cy.get(
'img[alt="Next.js Logo"][fetchpriority="high"][width="180"][height="37"][decoding="async"][data-nimg="1"][class="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"]'
).should("exist");
});
});