From 4ff3145c2eeafae81f83dcfed378e9b410ca4913 Mon Sep 17 00:00:00 2001 From: SahilDahekar Date: Wed, 27 Nov 2024 14:49:25 +0530 Subject: [PATCH 1/5] Fixed width for sponsor and subscribe section on home page --- pages/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.js b/pages/index.js index 9a94f90a..78c8de64 100644 --- a/pages/index.js +++ b/pages/index.js @@ -185,6 +185,7 @@ export default function Home() { +
@@ -192,6 +193,5 @@ export default function Home() { - ); } From 4c2991f8c5171758a179a3860886d3b4a9b1ef46 Mon Sep 17 00:00:00 2001 From: SahilDahekar Date: Wed, 27 Nov 2024 15:20:50 +0530 Subject: [PATCH 2/5] Fixed sponsor render issue on venue pages --- config/city-lists.json | 84 ++++++++++++++++++++++++---- pages/venue/[id].js | 2 +- pages/venue/online/register/index.js | 2 +- 3 files changed, 74 insertions(+), 14 deletions(-) diff --git a/config/city-lists.json b/config/city-lists.json index b49501a9..f21e3ff2 100644 --- a/config/city-lists.json +++ b/config/city-lists.json @@ -8,9 +8,24 @@ "img": "/img/testMic.webp", "address": "AsyncAPI YouTube Channel", "map": "https://www.youtube.com/live/F9wHxd-v2f0?si=PT8BuAUKNmoLHRiM", - "sponsors": [ - "/img/apidays.png" - ], + "sponsors": { + "eventSponsors" : [{ + "image":"/img/apidays.png", + "websiteUrl":"https://www.apidays.global/" + }], + "financialSponsors" : [ + { + "image":"/img/graviteeio.svg" , + "websiteUrl": "https://www.gravitee.io/", + "className":"w-[250px] h-[50px]" + }, + { + "image":"/img/postman.png" , + "websiteUrl":"https://www.postman.com/", + "className":"w-[240px] h-[70px]" + } + ] + }, "ticket": false, "isFree": true, "ended": true, @@ -27,9 +42,24 @@ "img": "/img/finland.webp", "address": "Pikku-Finlandia, Helsinki, Karamzininranta 4, 00100 Helsinki, Finland", "map": "https://maps.app.goo.gl/UpdEp188m5YNEAEo9", - "sponsors": [ - "/img/apidays.png" - ], + "sponsors": { + "eventSponsors" : [{ + "image":"/img/apidays.png", + "websiteUrl":"https://www.apidays.global/" + }], + "financialSponsors" : [ + { + "image":"/img/graviteeio.svg" , + "websiteUrl": "https://www.gravitee.io/", + "className":"w-[250px] h-[50px]" + }, + { + "image":"/img/postman.png" , + "websiteUrl":"https://www.postman.com/", + "className":"w-[240px] h-[70px]" + } + ] + }, "ticket": false, "isFree": false, "ended": true @@ -43,9 +73,24 @@ "img": "/img/london.gif", "address": "155 Bishopsgate, London EC2M 3YD", "map": "https://maps.app.goo.gl/b2Vb5H2mM41F9nQA6", - "sponsors": [ - "/img/apidays.png" - ], + "sponsors": { + "eventSponsors" : [{ + "image":"/img/apidays.png", + "websiteUrl":"https://www.apidays.global/" + }], + "financialSponsors" : [ + { + "image":"/img/graviteeio.svg" , + "websiteUrl": "https://www.gravitee.io/", + "className":"w-[250px] h-[50px]" + }, + { + "image":"/img/postman.png" , + "websiteUrl":"https://www.postman.com/", + "className":"w-[240px] h-[70px]" + } + ] + }, "ticket": "https://ticket.apidays.global/event/apidays-london-2024/869eca20-bfb6-4103-b8bb-d0348932e940/", "isFree": true, "ended": true, @@ -61,9 +106,24 @@ "img": "https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExd24yenR4djEyZzRoeDA0ZmEyb3Y1c2F4NWVmbG13NmZwYWNhZzdnNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/Tuy3QxNZF1cxG/giphy.gif", "address": "CNIT (Centre des Nouvelles Industries et Technologies), Paris 2 Place de la Défense, 92092 Puteaux", "map": "https://maps.app.goo.gl/5te8WRM9Rb8B6vNd9", - "sponsors": [ - "/img/apidays.png" - ], + "sponsors": { + "eventSponsors" : [{ + "image":"/img/apidays.png", + "websiteUrl":"https://www.apidays.global/" + }], + "financialSponsors" : [ + { + "image":"/img/graviteeio.svg" , + "websiteUrl": "https://www.gravitee.io/", + "className":"w-[250px] h-[50px]" + }, + { + "image":"/img/postman.png" , + "websiteUrl":"https://www.postman.com/", + "className":"w-[240px] h-[70px]" + } + ] + }, "ticket": "https://ticket.apidays.global/event/apidays-paris-2024/f8f61349-4f78-4bba-a162-68d598833116/cart?coupon=ASYNCAPICONF", "isFree": true, "cfp": false, diff --git a/pages/venue/[id].js b/pages/venue/[id].js index ef15092d..7b63d784 100644 --- a/pages/venue/[id].js +++ b/pages/venue/[id].js @@ -93,7 +93,7 @@ function Venue({ city }) {
- +
); diff --git a/pages/venue/online/register/index.js b/pages/venue/online/register/index.js index fbb6966d..62ce4060 100644 --- a/pages/venue/online/register/index.js +++ b/pages/venue/online/register/index.js @@ -7,7 +7,7 @@ export default function SpeakersForm(){
- +
) } From 58b4084fea5802b26e458cc06ea5455b8ed23ac2 Mon Sep 17 00:00:00 2001 From: SahilDahekar Date: Wed, 27 Nov 2024 16:35:25 +0530 Subject: [PATCH 3/5] Added cypress test for checking sponsor logos rendering --- cypress/e2e/Landing.cy.js | 25 +++++++++++++++++++++++++ cypress/e2e/Venue.cy.js | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/Landing.cy.js b/cypress/e2e/Landing.cy.js index 27d69fb4..1ef252cb 100644 --- a/cypress/e2e/Landing.cy.js +++ b/cypress/e2e/Landing.cy.js @@ -33,6 +33,31 @@ describe("Landing Page Tests", () => { cy.getTestData("sponsor-section").should("be.visible"); }); + it("Should contain logos in Sponsor component", () => { + const eventSponsors = [ + { image: '/img/apidays.png', websiteUrl: 'https://www.apidays.global/' }, + ]; + + const financialSponsor = [ + { image: '/img/graviteeio.svg', websiteUrl: 'https://www.gravitee.io/' }, + { image: '/img/postman.png', websiteUrl: 'https://www.postman.com/' }, + ]; + + eventSponsors.forEach((sponsor) => { + cy.getTestData('sponsor-section') + .find(`img[src="${sponsor.image}"]`) + .should('be.visible'); + cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist'); + }); + + financialSponsor.forEach((sponsor) => { + cy.getTestData('sponsor-section') + .find(`img[src="${sponsor.image}"]`) + .should('be.visible'); + cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist'); + }); + }); + it("Subscribe Button is functional", () => { cy.getTestData("subscribe-button").invoke("removeAttr", "target").click(); diff --git a/cypress/e2e/Venue.cy.js b/cypress/e2e/Venue.cy.js index cc14bb20..4f8ddc0e 100644 --- a/cypress/e2e/Venue.cy.js +++ b/cypress/e2e/Venue.cy.js @@ -18,7 +18,39 @@ it("should render guideline for not ended cities and agenda otherwise",()=>{ }); -it.only("Form should work",()=>{ +it("Should contain logos in Sponsor component", () => { + const sponsors = { + eventSponsors : [ + { image: '/img/apidays.png', websiteUrl: 'https://www.apidays.global/' }, + ], + financialSponsor : [ + { image: '/img/graviteeio.svg', websiteUrl: 'https://www.gravitee.io/' }, + { image: '/img/postman.png', websiteUrl: 'https://www.postman.com/' }, + ] + }; + + cy.wrap(cities).each((city) => { + cy.visit(`http://localhost:3000/venue/${city.name}`); + + cy.getTestData("sponsor-section").should("exist"); + + sponsors.eventSponsors.forEach((sponsor) => { + cy.getTestData('sponsor-section') + .find(`img[src="${sponsor.image}"]`) + .should('be.visible'); + cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist'); + }); + + sponsors.financialSponsor.forEach((sponsor) => { + cy.getTestData('sponsor-section') + .find(`img[src="${sponsor.image}"]`) + .should('be.visible'); + cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist'); + }); + }) +}); + +it("Form should work",()=>{ cy.visit('http://localhost:3000/venue/online/register'); cy.getTestData("cfp-form").should('be.visible'); From cf4c4fca952d67544fabf103a8cae46240363401 Mon Sep 17 00:00:00 2001 From: SahilDahekar Date: Wed, 27 Nov 2024 23:35:45 +0530 Subject: [PATCH 4/5] Imported hardcode data from city.json --- cypress/e2e/Landing.cy.js | 11 ++++------- cypress/e2e/Venue.cy.js | 16 +++++----------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/Landing.cy.js b/cypress/e2e/Landing.cy.js index 1ef252cb..e36ad38b 100644 --- a/cypress/e2e/Landing.cy.js +++ b/cypress/e2e/Landing.cy.js @@ -1,4 +1,6 @@ import path from "path"; +import cities from "../../config/city-lists.json" + describe("Landing Page Tests", () => { beforeEach(() => { cy.visit("/"); @@ -34,14 +36,9 @@ describe("Landing Page Tests", () => { }); it("Should contain logos in Sponsor component", () => { - const eventSponsors = [ - { image: '/img/apidays.png', websiteUrl: 'https://www.apidays.global/' }, - ]; + const eventSponsors = cities[0].sponsors.eventSponsors; - const financialSponsor = [ - { image: '/img/graviteeio.svg', websiteUrl: 'https://www.gravitee.io/' }, - { image: '/img/postman.png', websiteUrl: 'https://www.postman.com/' }, - ]; + const financialSponsor = cities[0].sponsors.financialSponsors; eventSponsors.forEach((sponsor) => { cy.getTestData('sponsor-section') diff --git a/cypress/e2e/Venue.cy.js b/cypress/e2e/Venue.cy.js index 4f8ddc0e..5f67ecca 100644 --- a/cypress/e2e/Venue.cy.js +++ b/cypress/e2e/Venue.cy.js @@ -19,29 +19,23 @@ it("should render guideline for not ended cities and agenda otherwise",()=>{ }); it("Should contain logos in Sponsor component", () => { - const sponsors = { - eventSponsors : [ - { image: '/img/apidays.png', websiteUrl: 'https://www.apidays.global/' }, - ], - financialSponsor : [ - { image: '/img/graviteeio.svg', websiteUrl: 'https://www.gravitee.io/' }, - { image: '/img/postman.png', websiteUrl: 'https://www.postman.com/' }, - ] - }; + const eventSponsors = cities[0].sponsors.eventSponsors; + + const financialSponsor = cities[0].sponsors.financialSponsors; cy.wrap(cities).each((city) => { cy.visit(`http://localhost:3000/venue/${city.name}`); cy.getTestData("sponsor-section").should("exist"); - sponsors.eventSponsors.forEach((sponsor) => { + eventSponsors.forEach((sponsor) => { cy.getTestData('sponsor-section') .find(`img[src="${sponsor.image}"]`) .should('be.visible'); cy.get(`a[href="${sponsor.websiteUrl}"]`).should('exist'); }); - sponsors.financialSponsor.forEach((sponsor) => { + financialSponsor.forEach((sponsor) => { cy.getTestData('sponsor-section') .find(`img[src="${sponsor.image}"]`) .should('be.visible'); From 14483596e3c3defe198394a76a397d85cadaa742 Mon Sep 17 00:00:00 2001 From: SahilDahekar Date: Thu, 28 Nov 2024 12:32:52 +0530 Subject: [PATCH 5/5] Made changes to if condition in venue.cy.js --- cypress/e2e/Venue.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/Venue.cy.js b/cypress/e2e/Venue.cy.js index 5f67ecca..5ee24e6d 100644 --- a/cypress/e2e/Venue.cy.js +++ b/cypress/e2e/Venue.cy.js @@ -6,7 +6,7 @@ it("should render guideline for not ended cities and agenda otherwise",()=>{ cy.getTestData(`venue-${city.name}`).then(val=>{ - if(!city.ended){ + if(Date.now()>Date(city.date) && !city.ended){ cy.getTestData("guideline-com").should("be.visible"); } else{