Skip to content

Commit

Permalink
feat: testes tratamento de registros por páginas nas oportunidades
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmagpac committed Jun 12, 2024
1 parent 09ca33b commit 82e77d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cypress/commands/checkFilterCountOf.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
/* Checa a contagem de um elemento específico na página de filtros. */
function checkFilterCountOf(element) {
cy.get('.foundResults').then(($foundResults) => {
const countPerPage = 20;
var resultsTextArray = $foundResults.text().split(" ");
var resultsCount = Number(resultsTextArray[0]);
const resultsCountPerPage = resultsCount < countPerPage ? resultsCount : countPerPage;

switch (element) {
case "opportunity":
cy.get(".upper." + element + "__color").should("have.length", resultsCount);
cy.get("span.upper." + element + "__color").should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Oportunidades encontradas");

break;

case "project":
cy.get(".upper." + element + "__color").should("have.length", resultsCount);
cy.get("span.upper." + element + "__color").should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Projetos encontrados");

break;

case "space":
cy.get(".upper." + element + "__color").should("have.length", resultsCount);
cy.get("span.upper." + element + "__color").should("have.length", resultsCountPerPage);
cy.wait(1000);
cy.contains(resultsCount + " Espaços encontrados");

Expand Down

0 comments on commit 82e77d6

Please sign in to comment.