From a1532c90df31aae9fe198cf69474fe14169af7b5 Mon Sep 17 00:00:00 2001 From: Lemeri123 <132246079+Lemeri123@users.noreply.github.com> Date: Thu, 2 Jan 2025 21:39:32 +0300 Subject: [PATCH] Fix: fixed fails for New PRs Due to 2025 Year Change --- cypress/e2e/Landing.cy.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/Landing.cy.js b/cypress/e2e/Landing.cy.js index 65e82f4d..53f9b65c 100644 --- a/cypress/e2e/Landing.cy.js +++ b/cypress/e2e/Landing.cy.js @@ -1,10 +1,11 @@ import path from "path"; -import cities from "../../config/city-lists.json" +import cities from "../../config/city-lists.json"; describe("Landing Page Tests", () => { beforeEach(() => { cy.visit("/"); }); + it("Contains correct heading", () => { const Year = new Date().getFullYear(); cy.getTestData("landing-heading").contains(`AsyncAPI Conf On Tour ${Year}`); @@ -15,12 +16,12 @@ describe("Landing Page Tests", () => { }); it("Verify the downloaded file", () => { + const Year = new Date().getFullYear(); cy.getTestData("prospectus-download").should("be.visible"); cy.getTestData("prospectus-download").click(); - const Year = new Date().getFullYear(); const downloadsFolder = Cypress.config("downloadsFolder"); - cy.readFile(path.join(downloadsFolder, `conf ${Year}.pdf`)); + cy.readFile(path.join(downloadsFolder, `conf ${Year}.pdf`)).should("exist"); }); it("Should contain Speakers section", () => { @@ -37,21 +38,20 @@ describe("Landing Page Tests", () => { it("Should contain logos in Sponsor component", () => { const eventSponsors = cities[0].sponsors.eventSponsors; - - const financialSponsor = cities[0].sponsors.financialSponsors; + const financialSponsors = cities[0].sponsors.financialSponsors; eventSponsors.forEach((sponsor) => { - cy.getTestData('sponsor-section') + cy.getTestData("sponsor-section") .find(`img[src="${sponsor.image}"]`) - .should('be.visible'); - cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist'); + .should("be.visible"); + cy.get(`a[href="${sponsor.websiteUrl}"]`).should("exist"); }); - financialSponsor.forEach((sponsor) => { - cy.getTestData('sponsor-section') + financialSponsors.forEach((sponsor) => { + cy.getTestData("sponsor-section") .find(`img[src="${sponsor.image}"]`) - .should('be.visible'); - cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist'); + .should("be.visible"); + cy.get(`a[href="${sponsor.websiteUrl}"]`).should("exist"); }); });