Skip to content

Commit

Permalink
Added cypress test for checking sponsor logos rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
SahilDahekar committed Nov 27, 2024
1 parent 4c2991f commit 58b4084
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
25 changes: 25 additions & 0 deletions cypress/e2e/Landing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
34 changes: 33 additions & 1 deletion cypress/e2e/Venue.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 58b4084

Please sign in to comment.