diff --git a/cypress.json b/cypress.json index 6e4f1258907525f83b6085bf8e8ec9e38d0601ac..8ca0f640989b9c8a471600fdadfb189bb2269177 100644 --- a/cypress.json +++ b/cypress.json @@ -1,10 +1,10 @@ { "baseUrl": "http://simcaq.c3sl.ufpr.br/", "integrationFolder": "./tests", - "execTimeout": 80000, - "taskTimeout": 80000, - "defaultCommandTimeout": 40000, + "execTimeout": 100000, + "taskTimeout": 100000, + "defaultCommandTimeout": 60000, "pageLoadTimeout": 400000, - "responseTimeout": 100000, - "requestTimeout": 100000 + "responseTimeout": 120000, + "requestTimeout": 120000 } diff --git a/tests/simcaq-front.js b/tests/simcaq-front.js index 4b9c320cbe45c4d058f9d01b73b897e43b8cee17..7cf857247455ef90dbed851562840930aec7e468 100644 --- a/tests/simcaq-front.js +++ b/tests/simcaq-front.js @@ -28,7 +28,7 @@ describe('1 - CAQ', function () { cy.route({ url: 'api/v1/**', method: 'GET' }).as('getApi') cy.get('.edit-mode' ).click() - let apiGetCalls = [0, 3, 1, 1, 0, 4, 2, 0, 4, 0, 0, 0, 7, 3, 0, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela + let apiGetCalls = [0, 3, 2, 1, 0, 4, 1, 0, 4, 0, 0, 0, 7, 3, 0, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela for (let i = 0; i < 19; i++) { cy.wait(300) if (apiGetCalls[i] > 0) @@ -80,7 +80,7 @@ describe('2 - Orçamento educacional', function () { cy.get('.block-ui-spinner' ).should('not.be.visible') cy.contains('4').click() - let apiGetCalls = [0, 1, 2, 0, 1, 0, 3, 1, 1, 0, 4, 2, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela + let apiGetCalls = [0, 1, 2, 0, 1, 0, 3, 2, 1, 0, 4, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela for (let i = 0; i < 24; i++) { cy.wait(300) if (apiGetCalls[i] > 0) @@ -93,7 +93,10 @@ describe('2 - Orçamento educacional', function () { cy.get('.block-ui-spinner' ).should('not.be.visible') cy.get('.btn-primary.step.next').click() } - cy.wait(Array(3).fill('@getApi') ) + cy.wait(Array(8).fill('@getApi') ) + cy.wait(1000) + cy.wait('@postApi') + cy.wait(300) cy.get('.block-ui-spinner' ).should('not.visible').then(() => { return cy.get('.finalize').click() }) }) @@ -132,12 +135,12 @@ describe('2 - Orçamento educacional', function () { cy.wait(300) cy.contains('4').click() - let apiGetCalls = [0, 1, 2, 0, 1, 0, 3, 1, 1, 0, 4, 2, 0, 4, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela - for (let i = 0; i < 25; i++) { + let apiGetCalls = [0, 1, 2, 0, 1, 0, 3, 2, 1, 0, 4, 2, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela + for (let i = 0; i < 24; i++) { cy.wait(300) if (apiGetCalls[i] > 0) cy.wait(Array(apiGetCalls[i]).fill('@getApi') ) - if (i == 10 || i == 19) { // Telas que contêm um post. + if (i == 10 || i == 18) { // Telas que contêm um post. cy.wait(500) cy.wait('@postApi' ) } @@ -145,52 +148,55 @@ describe('2 - Orçamento educacional', function () { cy.get('.btn-primary.step.next').click() } cy.wait(Array(3).fill('@getApi') ) + cy.wait(1000) cy.get('.block-ui-spinner' ).should('not.visible').then(() => { return cy.get('.finalize').click() }) }) }) -describe('3 - Fundo de manutenção', function () { - it('successfully loads', function () { - cy.clearLocalStorage() - cy.clearCookies() - - cy.server() - cy.route({ url: 'api/v1/enrollment**', method: 'GET' }).as('getEnrollment') - cy.route({ url: 'api/v1/classroom_count**', method: 'POST' }).as('postApi') - cy.visit('http://simcaq.c3sl.ufpr.br/', { - auth: { - username: 'simcaq', - password: 'simcaqeducacao' - } - }) - cy.wait(1000) - - cy.get('.financing').contains('Consultar').click() - cy.wait(Array(5).fill('@getEnrollment') ) - cy.wait(1000) - cy.wait('@postApi' ) - - cy.wait(1500) - - cy.route({ url: 'api/v1/**', method: 'GET' }).as('getApi') - cy.route({ url: 'api/v1/classroom_count**', method: 'POST' }).as('postApi') - cy.get('.block-ui-spinner' ).should('not.be.visible') - cy.get('.edit-mode').click() - - let apiGetCalls = [1, 1, 0, 1, 0, 3, 1, 1, 0, 4, 2, 0, 4, 0, 0, 0, 7, 3, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela - for (let i = 0; i < 23; i++) { - cy.wait(300) - if (apiGetCalls[i] > 0) - cy.wait(Array(apiGetCalls[i]).fill('@getApi') ) - if (i == 9 || i == 17) { // Telas que contêm um post. - cy.wait(500) - cy.wait('@postApi' ) - } - - cy.get('.block-ui-spinner' ).should('not.be.visible') - cy.get('.btn-primary.step.next').click() - } - cy.wait(Array(3).fill('@getApi') ) - cy.get('.block-ui-spinner' ).should('not.visible').then(() => { return cy.get('.finalize').click() }) - }) -}) \ No newline at end of file +// Tela 3 está desativada no momento. + +// describe('3 - Fundo de manutenção', function () { +// it('successfully loads', function () { +// cy.clearLocalStorage() +// cy.clearCookies() + +// cy.server() +// cy.route({ url: 'api/v1/enrollment**', method: 'GET' }).as('getEnrollment') +// cy.route({ url: 'api/v1/classroom_count**', method: 'POST' }).as('postApi') +// cy.visit('http://simcaq.c3sl.ufpr.br/', { +// auth: { +// username: 'simcaq', +// password: 'simcaqeducacao' +// } +// }) +// cy.wait(1000) + +// cy.get('.financing').contains('Consultar').click() +// cy.wait(Array(5).fill('@getEnrollment') ) +// cy.wait(1000) +// cy.wait('@postApi' ) + +// cy.wait(1500) + +// cy.route({ url: 'api/v1/**', method: 'GET' }).as('getApi') +// cy.route({ url: 'api/v1/classroom_count**', method: 'POST' }).as('postApi') +// cy.get('.block-ui-spinner' ).should('not.be.visible') +// cy.get('.edit-mode').click() + +// let apiGetCalls = [1, 1, 0, 1, 0, 3, 1, 1, 0, 4, 2, 0, 4, 0, 0, 0, 7, 3, 0, 0, 0, 0, 0] // Quantidade de get's da api por tela +// for (let i = 0; i < 23; i++) { +// cy.wait(300) +// if (apiGetCalls[i] > 0) +// cy.wait(Array(apiGetCalls[i]).fill('@getApi') ) +// if (i == 9 || i == 17) { // Telas que contêm um post. +// cy.wait(500) +// cy.wait('@postApi' ) +// } + +// cy.get('.block-ui-spinner' ).should('not.be.visible') +// cy.get('.btn-primary.step.next').click() +// } +// cy.wait(Array(3).fill('@getApi') ) +// cy.get('.block-ui-spinner' ).should('not.visible').then(() => { return cy.get('.finalize').click() }) +// }) +// }) \ No newline at end of file