diff --git a/tests/simcaq-front.js b/tests/simcaq-front.js index a02898a00269e051898a541d3abf78b2316eb58b..c18de716a92f8b828e12ee28ffe9230d6f3b890c 100644 --- a/tests/simcaq-front.js +++ b/tests/simcaq-front.js @@ -1,4 +1,4 @@ -const TIMEOUT = { timeout: 130000 }; +const TIMEOUT = { timeout: 140000 }; describe('1 - CAQ', function () { it('successfully loads', function () { @@ -20,6 +20,7 @@ describe('1 - CAQ', function () { cy.get('.block-ui-main').should('visible') cy.wait(Array(5).fill('@getEnrollment'), TIMEOUT) + cy.wait(1000) cy.wait('@postApi', TIMEOUT) cy.wait(300) @@ -31,8 +32,10 @@ describe('1 - CAQ', function () { cy.wait(300) if (apiGetCalls[i] > 0) cy.wait(Array(apiGetCalls[i]).fill('@getApi'), TIMEOUT) - if (i == 9 || i == 18) // Telas que contêm um post. + if (i == 9 || i == 18) { // Telas que contêm um post. + cy.wait(500) cy.wait('@postApi', TIMEOUT) + } cy.get('.btn-primary.step.next').click() } cy.wait(Array(3).fill('@getApi'), TIMEOUT) @@ -62,6 +65,7 @@ describe('2 - Orçamento educacional', function () { cy.contains('Simular').click() cy.wait(Array(5).fill('@getEnrollment'), TIMEOUT) + cy.wait(1000) cy.wait(['@postApi', '@postApi'], TIMEOUT) // Classroom count chamada duas vezes seguidas cy.wait(300) @@ -75,8 +79,10 @@ describe('2 - Orçamento educacional', function () { cy.wait(300) if (apiGetCalls[i] > 0) cy.wait(Array(apiGetCalls[i]).fill('@getApi'), TIMEOUT) - if (i == 10 || i == 19) // Telas que contêm um post. + if (i == 10 || i == 19) { // Telas que contêm um post. + cy.wait(500) cy.wait('@postApi', TIMEOUT) + } cy.get('.btn-primary.step.next').click() } @@ -109,6 +115,7 @@ describe('2 - Orçamento educacional', function () { cy.contains('Simular').click() cy.wait(Array(5).fill('@getEnrollment'), TIMEOUT) + cy.wait(1000) cy.wait(['@postApi', '@postApi'], TIMEOUT) // Classroom count chamada duas vezes seguidas cy.wait(300) @@ -122,8 +129,10 @@ describe('2 - Orçamento educacional', function () { cy.wait(300) if (apiGetCalls[i] > 0) cy.wait(Array(apiGetCalls[i]).fill('@getApi'), TIMEOUT) - if (i == 10 || i == 19) // Telas que contêm um post. + if (i == 10 || i == 19) { // Telas que contêm um post. + cy.wait(500) cy.wait('@postApi', TIMEOUT) + } cy.get('.btn-primary.step.next').click() } @@ -150,10 +159,13 @@ describe('3 - Fundo de manutenção', function () { cy.get('.financing').contains('Consultar').click() cy.wait(Array(5).fill('@getEnrollment'), TIMEOUT) + cy.wait(1000) + cy.wait('@postApi', TIMEOUT) cy.wait(15000) cy.route({ url: 'api/v1/**', method: 'GET' }).as('getApi') + cy.route({ url: 'api/v1/classroom_count**', method: 'POST' }).as('postApi') cy.get('.edit-mode').click() let apiGetCalls = [1, 1, 0, 1, 0, 3, 1, 1, 0, 4, 2, 0, 4, 0, 1, 0, 0, 7, 3, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela @@ -161,8 +173,10 @@ describe('3 - Fundo de manutenção', function () { cy.wait(300) if (apiGetCalls[i] > 0) cy.wait(Array(apiGetCalls[i]).fill('@getApi'), TIMEOUT) - if (i == 9 || i == 18) // Telas que contêm um post. + if (i == 9 || i == 18) { // Telas que contêm um post. + cy.wait(500) cy.wait('@postApi', TIMEOUT) + } cy.get('.btn-primary.step.next').click() }