Skip to content

Commit

Permalink
Resolve problemas em testes que usavam reCAPTCHA e atualiza algumas r…
Browse files Browse the repository at this point in the history
…equisições que usavam nomes antigos de classes HTML
  • Loading branch information
Aushiffer authored and PaG0Dezaum2005 committed Aug 28, 2024
1 parent 1bfba18 commit 19187c9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 48 deletions.
9 changes: 4 additions & 5 deletions src/cypress/commands/checkFilterCount.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* Checa a contagem de um elemento específico na página de filtros. */
function checkFilterCount() {
cy.get('.foundResults').then(($foundResults) => {
const countPerPage = 20;
var resultsTextArray = $foundResults.text().split(" ");
var resultsCount = Number(resultsTextArray[0]);
let resultsTextArray = $foundResults.text().split(" ");
let resultsCount = Number(resultsTextArray[0]);
let resultsType = resultsTextArray[1];
const resultsCountPerPage = resultsCount < countPerPage ? resultsCount : countPerPage;

Expand All @@ -28,9 +27,9 @@ function checkFilterCount() {
cy.contains(resultsCount + " Espaços encontrados");

break;

default:
cy.log("[-] Tipo inválido, use \"opportunity\", \"space\" ou \"project\"");
cy.log("checkFilterCount(): tipo inválido");
cy.contains("FORCE ERROR");

break;
Expand Down
1 change: 0 additions & 1 deletion src/cypress/e2e/agentesPage/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ describe("Agents Page", () => {
cy.contains(expectedCount + " Agentes encontrados")
});


cy.get(":nth-child(2) > select").select(1);
cy.contains("Agente Individual");
cy.wait(1000);
Expand Down
17 changes: 9 additions & 8 deletions src/cypress/e2e/homepage/full.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,26 @@ describe("Homepage", () => {
backHomepage();
});

it("Navegação entre os cards da seção \"Em desteaque\"", () => {
it("Navegação entre os cards da seção \"Em destaque\"", () => {
cy.get(".carousel__next").click();
cy.wait(1000);
cy.get(".carousel__prev").click();
});

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");
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/");
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: 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");
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");
backHomepage();

/*
Expand Down
12 changes: 5 additions & 7 deletions src/cypress/e2e/loginPage/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ describe("Loginpage", () => {
cy.visit("/autenticacao/");
});

it("Verifica se é possivel logar com email ou cpf e senha", () => {
loginWith("Admin@local", "mapas123");
cy.get(".exit > a").click();
cy.visit("/autenticacao/");
loginWith("555.132.590-36", "Mapas12345!");
cy.contains("Minha conta");
});
it("Verifica se é possivel logar com email ou cpf e senha", () => {
loginWith("Admin@local", "mapas123");
cy.visit("/autenticacao/");
loginWith("12345678902", "mapas123");
});

it("Garantir que se as informações estiverem incorretas o usuário será avisado sobre", () => {
loginWith("blablabla", "mapas123");
Expand Down
27 changes: 11 additions & 16 deletions src/cypress/e2e/opportunity/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Opportunity Page", () => {

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();
});

it("Garante que os filtros por status das oportunidades funcionam", () => {
Expand All @@ -55,13 +55,13 @@ describe("Opportunity Page", () => {

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();

cy.get('.form > :nth-child(1) > :nth-child(4)').click();

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();
});

it("Garante que o filtro de oportunidades de editais oficiais funciona", () => {
Expand All @@ -72,9 +72,9 @@ describe("Opportunity Page", () => {
cy.contains("Status das oportunidades");

cy.get(".verified > input").click();
cy.wait(1000);
cy.wait(2500);

checkFilterCount("opportunity");
checkFilterCount();
});

it("Garante que os filtros por tipo de oportunidade funcionam", () => {
Expand All @@ -89,7 +89,7 @@ describe("Opportunity Page", () => {

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();

cy.reload();

Expand All @@ -103,7 +103,7 @@ describe("Opportunity Page", () => {

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();
});

it("Garante que os filtros por área de interesse funcionam", () => {
Expand All @@ -118,7 +118,7 @@ describe("Opportunity Page", () => {

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();

cy.reload();
cy.wait(1000);
Expand All @@ -128,15 +128,15 @@ describe("Opportunity Page", () => {

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();
});

it("Garante que o botão limpar filtros na pagina de oportunidades funciona", () => {
cy.visit("/oportunidades");

cy.wait(1000);

checkFilterCount("opportunity");
checkFilterCount();

clearAllFilters([
".form > :nth-child(1) > :nth-child(2)",
Expand All @@ -147,19 +147,14 @@ describe("Opportunity Page", () => {
":nth-child(2) > .mc-multiselect__option"
]);

checkFilterCount("opportunity");
checkFilterCount();

cy.wait(1000);
});

it("Garante geração de modelo da oportunidade", () => {
cy.visit("/autenticacao/");
loginWith("Admin@local", "mapas123");

cy.wait(5000)

cy.get('[style="width: 304px; height: 78px;"] > div > iframe').click();
cy.get('.right > .button--primary').click();

cy.wait(1000);

Expand Down
8 changes: 4 additions & 4 deletions src/cypress/e2e/projectsPage/full.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ describe("Pagina de Projetos", () => {
cy.wait(1000);
cy.get(':nth-child(18) > .mc-multiselect__option').click();
cy.wait(1000);
checkFilterCount("project");
checkFilterCount();
cy.reload();
cy.wait(1000);
cy.get('.mc-multiselect--input').click();
cy.get(':nth-child(18) > .mc-multiselect__option').click();
cy.wait(1000);
checkFilterCount("project");
checkFilterCount();
});

it("Garante que o botão limpar filtros na pagina de projetos funciona", () => {
checkFilterCount("project");
checkFilterCount();

clearAllFilters([
".verified",
Expand All @@ -42,6 +42,6 @@ describe("Pagina de Projetos", () => {

cy.wait(1000);

checkFilterCount("project");
checkFilterCount();
});
});
14 changes: 7 additions & 7 deletions src/cypress/e2e/spacesPage/full.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { clearAllFilters } = require("../../commands/clearAllFilters");
const { checkFilterCountOf } = require("../../commands/checkFilterCountOf");
const { checkFilterCount } = require("../../commands/checkFilterCount");

describe("Pagina de Espaços", () => {
beforeEach(() => {
Expand All @@ -18,31 +18,31 @@ describe("Pagina de Espaços", () => {
cy.get(':nth-child(2) > .mc-multiselect > :nth-child(1) > .v-popper > .mc-multiselect--input').click();
cy.get(':nth-child(86) > .mc-multiselect__option').click();
cy.wait(1000);
checkFilterCountOf("space");
checkFilterCount();
cy.reload();
cy.wait(1000);
cy.get(':nth-child(2) > .mc-multiselect > :nth-child(1) > .v-popper > .mc-multiselect--input').click();
cy.get(':nth-child(104) > .mc-multiselect__option').click();
cy.wait(1000);
checkFilterCountOf("space");
checkFilterCount();
});

it("Garante que os filtros de área de atuação funcionem", () => {
cy.contains("Área de atuação");
cy.get(':nth-child(3) > .mc-multiselect > :nth-child(1) > .v-popper > .mc-multiselect--input').click();
cy.get(':nth-child(41) > .mc-multiselect__option').click();
cy.wait(1000);
checkFilterCountOf("space");
checkFilterCount();
cy.reload();
cy.wait(1000);
cy.get(':nth-child(3) > .mc-multiselect > :nth-child(1) > .v-popper > .mc-multiselect--input').click();
cy.get(':nth-child(48) > .mc-multiselect__option').click();
cy.wait(1000);
checkFilterCountOf("space");
checkFilterCount();
});

it("Garante que o botão limpar filtros na pagina de espaços funciona", () => {
checkFilterCountOf("space");
checkFilterCount();

clearAllFilters([
".form > :nth-child(1) > :nth-child(2)",
Expand All @@ -54,6 +54,6 @@ describe("Pagina de Espaços", () => {
]);

cy.wait(1000);
checkFilterCountOf("space");
checkFilterCount();
});
});

0 comments on commit 19187c9

Please sign in to comment.