diff --git a/src/cypress/commands/checkFilterCount.js b/src/cypress/commands/checkFilterCount.js index 1066ab5217..236724b0c2 100644 --- a/src/cypress/commands/checkFilterCount.js +++ b/src/cypress/commands/checkFilterCount.js @@ -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; @@ -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; diff --git a/src/cypress/e2e/agentesPage/index.cy.js b/src/cypress/e2e/agentesPage/index.cy.js index 4f82506a3b..ef4a91e000 100644 --- a/src/cypress/e2e/agentesPage/index.cy.js +++ b/src/cypress/e2e/agentesPage/index.cy.js @@ -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); diff --git a/src/cypress/e2e/homepage/full.cy.js b/src/cypress/e2e/homepage/full.cy.js index cb1b9a63c1..64c841e592 100644 --- a/src/cypress/e2e/homepage/full.cy.js +++ b/src/cypress/e2e/homepage/full.cy.js @@ -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(); /* diff --git a/src/cypress/e2e/loginPage/index.cy.js b/src/cypress/e2e/loginPage/index.cy.js index 7a7be86205..c1ea25de03 100644 --- a/src/cypress/e2e/loginPage/index.cy.js +++ b/src/cypress/e2e/loginPage/index.cy.js @@ -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"); diff --git a/src/cypress/e2e/opportunity/index.cy.js b/src/cypress/e2e/opportunity/index.cy.js index b1c471e20d..21a911c9cb 100644 --- a/src/cypress/e2e/opportunity/index.cy.js +++ b/src/cypress/e2e/opportunity/index.cy.js @@ -41,7 +41,7 @@ describe("Opportunity Page", () => { cy.wait(1000); - checkFilterCount("opportunity"); + checkFilterCount(); }); it("Garante que os filtros por status das oportunidades funcionam", () => { @@ -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", () => { @@ -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", () => { @@ -89,7 +89,7 @@ describe("Opportunity Page", () => { cy.wait(1000); - checkFilterCount("opportunity"); + checkFilterCount(); cy.reload(); @@ -103,7 +103,7 @@ describe("Opportunity Page", () => { cy.wait(1000); - checkFilterCount("opportunity"); + checkFilterCount(); }); it("Garante que os filtros por área de interesse funcionam", () => { @@ -118,7 +118,7 @@ describe("Opportunity Page", () => { cy.wait(1000); - checkFilterCount("opportunity"); + checkFilterCount(); cy.reload(); cy.wait(1000); @@ -128,7 +128,7 @@ describe("Opportunity Page", () => { cy.wait(1000); - checkFilterCount("opportunity"); + checkFilterCount(); }); it("Garante que o botão limpar filtros na pagina de oportunidades funciona", () => { @@ -136,7 +136,7 @@ describe("Opportunity Page", () => { cy.wait(1000); - checkFilterCount("opportunity"); + checkFilterCount(); clearAllFilters([ ".form > :nth-child(1) > :nth-child(2)", @@ -147,7 +147,7 @@ describe("Opportunity Page", () => { ":nth-child(2) > .mc-multiselect__option" ]); - checkFilterCount("opportunity"); + checkFilterCount(); cy.wait(1000); }); @@ -155,11 +155,6 @@ describe("Opportunity Page", () => { 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); diff --git a/src/cypress/e2e/projectsPage/full.cy.js b/src/cypress/e2e/projectsPage/full.cy.js index ce93fdbcbb..a38f497651 100644 --- a/src/cypress/e2e/projectsPage/full.cy.js +++ b/src/cypress/e2e/projectsPage/full.cy.js @@ -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", @@ -42,6 +42,6 @@ describe("Pagina de Projetos", () => { cy.wait(1000); - checkFilterCount("project"); + checkFilterCount(); }); }); \ No newline at end of file diff --git a/src/cypress/e2e/spacesPage/full.cy.js b/src/cypress/e2e/spacesPage/full.cy.js index 68bc2eac27..295aa6579a 100644 --- a/src/cypress/e2e/spacesPage/full.cy.js +++ b/src/cypress/e2e/spacesPage/full.cy.js @@ -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(() => { @@ -18,13 +18,13 @@ 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", () => { @@ -32,17 +32,17 @@ describe("Pagina de Espaços", () => { 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)", @@ -54,6 +54,6 @@ describe("Pagina de Espaços", () => { ]); cy.wait(1000); - checkFilterCountOf("space"); + checkFilterCount(); }); }); \ No newline at end of file