Skip to content

Commit

Permalink
Arrumei todos os specs do cypress.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaG0Dezaum2005 committed Aug 30, 2024
1 parent d71a09a commit 309975e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
42 changes: 21 additions & 21 deletions src/cypress/commands/checkFilterCount.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ function checkFilterCount() {
let resultsType = resultsTextArray[1];
const resultsCountPerPage = resultsCount < countPerPage ? resultsCount : countPerPage;

switch (resultsType) {
case "Oportunidades":
cy.get('.upper').should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Oportunidades encontradas");
break;
case "Projetos":
cy.get('.upper').should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Projetos encontrados");
break;
case "Espaços":
cy.get('.upper').should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Espaços encontrados");
break;
switch (resultsType) {
case "Oportunidades":
cy.get('.upper').should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Oportunidades encontradas");
break;
case "Projetos":
cy.get('.upper').should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Projetos encontrados");
break;
case "Espaços":
cy.get('.upper').should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Espaços encontrados");
break;

default:
cy.log("checkFilterCount(): tipo inválido");
Expand Down
15 changes: 7 additions & 8 deletions src/cypress/e2e/homepage/full.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,19 @@ describe("Homepage", () => {
cy.get(".carousel__prev").click();
});

it("Acessa o navbar e o botão \"Acessar\" dos cards da seção \"Em destaque\"", () => {
cy.get(".agents > a > span").click();
cy.wait(1000);
cy.get(".carousel__slide--active > .entity-card > .entity-card__footer > .entity-card__footer--action > .button").click();
cy.url().should("include", "/agente/");
it("Acessa o navbar e o botão \"Acessar\" dos cards da seção \"Em desteaque\"", () => {
cy.contains("Acessar").eq(0).click();
cy.wait(2000);
cy.url().should("include", "/agente/27/#info");
cy.contains("Anne Elisa");
backHomepage();

cy.get(".agents > a > span").click();
cy.wait(1000);
cy.get('.carousel__next').click();
cy.get('[style="width: 31.25%; order: 3;"] > .entity-card > .entity-card__footer > .entity-card__footer--action > .button').click();
cy.url().should("include", "/agente/");
cy.contains("a", "https://pt.wikipedia.org/wiki/Cleodon_Silva");
cy.get('[style="width: 31.25%; order: 2;"] > .entity-card > .entity-card__footer > .entity-card__footer--action > .button').click();
cy.url().should("include", "/agente/16/#info");
cy.contains("Universidade de Brasília");
backHomepage();

/*
Expand Down
4 changes: 3 additions & 1 deletion src/cypress/e2e/opportunity/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ describe("Opportunity Page", () => {

it("Garante que os filtros de oportunidades funcionam quando existem resultados para a busca textual", () => {
cy.visit("/oportunidades");
cy.get(".search-filter__actions--form-input").type("f");

cy.get(".search-filter__actions--form-input").type("teste");

cy.wait(1000);

checkFilterCount();
Expand Down

0 comments on commit 309975e

Please sign in to comment.