From ba2f64f31a672668ca3335b6e3acf012d05c8bfe Mon Sep 17 00:00:00 2001 From: jgaguiarm Date: Fri, 11 Sep 2026 16:59:25 -0300 Subject: [PATCH 1/4] =?UTF-8?q?Automatiza=20teste=20de=20upload=20do=20rel?= =?UTF-8?q?at=C3=B3rio=20para=20pagamento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/efomento/noticePage/notice.cy.js | 26 +++++++-- .../fixtures/documents/payments-report.csv | 21 +++++++ cypress/fixtures/users.json | 10 ++++ cypress/pages/notice/NoticePage.js | 21 +++++++ cypress/pages/notice/elements.js | 2 + cypress/support/workflows/NoticeWorkflow.js | 58 +++++++++++++++++++ .../js/Pages/Notices/NoticesListPage.vue | 1 + 7 files changed, 133 insertions(+), 6 deletions(-) create mode 100644 cypress/fixtures/documents/payments-report.csv create mode 100644 cypress/support/workflows/NoticeWorkflow.js diff --git a/cypress/e2e/efomento/noticePage/notice.cy.js b/cypress/e2e/efomento/noticePage/notice.cy.js index 16b93cff..d95477bc 100644 --- a/cypress/e2e/efomento/noticePage/notice.cy.js +++ b/cypress/e2e/efomento/noticePage/notice.cy.js @@ -1,3 +1,4 @@ +import NoticeWorkflow from '../../../support/workflows/NoticeWorkflow'; import Login from '../../../pages/auth'; import Notice from '../../../pages/notice/NoticePage'; @@ -6,13 +7,13 @@ describe('Notice Page - E2E Tests', () => { cy.fixture('users').as('user'); cy.fixture('notices').as('notice'); - cy.get('@user').then((user) => { - Login.accessLoginPage(); - Login.successLogin(user.valid_email, user.password, user.name); - }); + // // cy.get('@user').then((user) => { + // // Login.accessLoginPage(); + // // Login.successLogin(user.valid_email, user.password, user.name); + // // }); - Notice.visitPage(); - Notice.verifyPageLoaded(); + // Notice.visitPage(); + // Notice.verifyPageLoaded(); }); describe('Page Access and Navigation', () => { @@ -174,4 +175,17 @@ describe('Notice Page - E2E Tests', () => { Notice.verifyUpdatedDataAboutProcess(newNoticeData.noticeInstrumentType, newNoticeData.noticeManagerEmail); }); }); + + describe('Upload Payment Report', () => { + it('should upload payments report', function () { + // Arrange + cy.loginByRole('financial'); + + // Act + NoticeWorkflow.uploadPaymentsReportFile(); + + // Assert + NoticeWorkflow.validatePaymentReportUpload(); + }); + }); }); diff --git a/cypress/fixtures/documents/payments-report.csv b/cypress/fixtures/documents/payments-report.csv new file mode 100644 index 00000000..7648a42f --- /dev/null +++ b/cypress/fixtures/documents/payments-report.csv @@ -0,0 +1,21 @@ +270401 - FUNDO ESTADUAL DE CULTURA,,,,,,,,,,,,,"98571495,02","98223904,68","91271532,56",,, +Unidade Gestora / Data NE,Nota de Empenho,Data NL,Nota de Liquidação,Data OB,Ordem Bancária,Fonte Completa,Natureza Despesa,Processo,Credor,Nome do Credor,Credor da Retenção,Domicílio Bancário Origem (OB),Empenhado,Liquidado,Pago,,, +26/02/2025,"2025NE000002 - PARECERISTAS -18º EDITAL CICLO CEARÁ CARNAVALESCO 2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0058/2025/SECULT/ASJUR, CONTRATO N°0009/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008956/2024-81",26/02/2025,2025NL000005,27/02/2025,2025OB000025,7591200070,339036,12345.678901/2345-69,21711889873,THAIS LIMA DOS REIS,07954597000152 - SECRETARIA DA FAZENDA DO EST DO CEARA,104 - 0919 - 0006007021122,"30,08","30,08","30,08",,NUP, +26/02/2025,"2025NE000002 - PARECERISTAS -18º EDITAL CICLO CEARÁ CARNAVALESCO 2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0058/2025/SECULT/ASJUR, CONTRATO N°0009/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008956/2024-81",26/02/2025,2025NL000005,18/03/2025,2025OB000146,v,339036,12345.678901/2345-70,21711889873,THAIS LIMA DOS REIS,07954605000160 - PREFEITURA MUNICIPAL DE FORTALEZA,104 - 0919 - 0006007021122,"161,25","161,25","161,25",0,12345.678901/2345-69,TRUE +26/02/2025,"2025NE000002 - PARECERISTAS -18º EDITAL CICLO CEARÁ CARNAVALESCO 2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0058/2025/SECULT/ASJUR, CONTRATO N°0009/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008956/2024-81",26/02/2025,2025NL000005,01/04/2025,2025OB000156,7591200070,339036,12345.678901/2345-71,21711889873,THAIS LIMA DOS REIS,00394460005887 - SECRETARIA DA RECEITA FEDERAL DO BRASIL,104 - 0919 - 0006007021122,"280,41","280,41","280,41",0,12345.678901/2345-70,TRUE +26/02/2025,"2025NE000003 - CONTRIBUIÇÕES PROVIDENCIARIAS SOBRE SERVIÇOS DE TERCEIROS - PF - RECURSO DESTINADO AO INSS PATRONAL DA PARECERISTA, THAIS LIMA DOS REIS, INSCRITA NO CPF:217.118.898-73, CONFORME PROCESSO N°27001.008956/2024-81",26/02/2025,2025NL000006,01/04/2025,2025OB000158,7591200070,339047,12345.678901/2345-72,394460005887,SECRETARIA DA RECEITA FEDERAL DO BRASIL,- - -,104 - 0919 - 0006007021122,"2753,26","2753,26","2753,26",0,12345.678901/2345-71,TRUE +26/02/2025,"2025NE000004 - PARECERISTAS -EDITAL CICLO CEARÁ CARNAVALESCO - 2025 - - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0062/2025/SECULT/ASJUR, INEXIGIBILIDADE DE LICITAÇÃO Nº 05/2025, CONTRATO Nº0008/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008952/2024-01",26/02/2025,2025NL000009,27/02/2025,2025OB000042,7591200070,339036,12345.678901/2345-73,1534103376,FRANCISCO LUIS TEIXEIRA DOS SANTOS,07954597000152 - SECRETARIA DA FAZENDA DO EST DO CEARA,104 - 0919 - 0006007021122,"1,95","1,95","1,95",0,12345.678901/2345-72,TRUE +26/02/2025,"2025NE000004 - PARECERISTAS -EDITAL CICLO CEARÁ CARNAVALESCO - 2025 - - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0062/2025/SECULT/ASJUR, INEXIGIBILIDADE DE LICITAÇÃO Nº 05/2025, CONTRATO Nº0008/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008952/2024-01",26/02/2025,2025NL000009,28/02/2025,2025OB000080,7591200070,339036,12345.678901/2345-74,1534103376,FRANCISCO LUIS TEIXEIRA DOS SANTOS,- - -,104 - 0919 - 0006007021122,"2470,14","2470,14","2470,14",0,12345.678901/2345-73,TRUE +26/02/2025,"2025NE000004 - PARECERISTAS -EDITAL CICLO CEARÁ CARNAVALESCO - 2025 - - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0062/2025/SECULT/ASJUR, INEXIGIBILIDADE DE LICITAÇÃO Nº 05/2025, CONTRATO Nº0008/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008952/2024-01",26/02/2025,2025NL000009,18/03/2025,2025OB000152,7591200070,339036,12345.678901/2345-75,1534103376,FRANCISCO LUIS TEIXEIRA DOS SANTOS,07954605000160 - PREFEITURA MUNICIPAL DE FORTALEZA,104 - 0919 - 0006007021122,"142,5","142,5","142,5",0,12345.678901/2345-74,TRUE +26/02/2025,"2025NE000004 - PARECERISTAS -EDITAL CICLO CEARÁ CARNAVALESCO - 2025 - - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0062/2025/SECULT/ASJUR, INEXIGIBILIDADE DE LICITAÇÃO Nº 05/2025, CONTRATO Nº0008/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008952/2024-01",26/02/2025,2025NL000009,01/04/2025,2025OB000156,7591200070,339036,12345.678901/2345-76,1534103376,FRANCISCO LUIS TEIXEIRA DOS SANTOS,00394460005887 - SECRETARIA DA RECEITA FEDERAL DO BRASIL,104 - 0919 - 0006007021122,"235,41","235,41","235,41",0,12345.678901/2345-75,TRUE +26/02/2025,"2025NE000005 - CONTRIBUIÇÕES PREVIDENCIÁRIAS SOBRE SERVIÇOS DE TERCEIROS - PF - RECURSO DESTINADO AO INSS PATRONAL DA PARECERISTA, FRANCISCO LUIS TEIXEIRA DOS SANTOS SELECIONADA PARA O EDITAL 18º EDITAL CICLO CEARÁ CARNAVALESCO - 2025 CONFORME PROCESSO N°27001.008952/2024-01",26/02/2025,2025NL000010,01/04/2025,2025OB000161,7591200070,339047,12345.678901/2345-77,394460005887,SECRETARIA DA RECEITA FEDERAL DO BRASIL,- - -,104 - 0919 - 0006007021122,"598,5","598,5","598,5",0,12345.678901/2345-76,TRUE +26/02/2025,"2025NE000006 - PARECERISTAS - 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0060/2025/SECULT/ASJUR, CONTRATO N°0005/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008954/2024-92",26/02/2025,2025NL000003,27/02/2025,2025OB000027,7591200070,339036,12345.678901/2345-78,4146785677,LEANDRO EUSTÁQUIO GOMES,- - -,104 - 0919 - 0006007021122,"2344,77","2344,77","2344,77",0,12345.678901/2345-77,TRUE +26/02/2025,"2025NE000006 - PARECERISTAS - 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0060/2025/SECULT/ASJUR, CONTRATO N°0005/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008954/2024-92",26/02/2025,2025NL000003,20/03/2025,2025OB000153,7591200070,339036,12345.678901/2345-79,4146785677,LEANDRO EUSTÁQUIO GOMES,07954605000160 - PREFEITURA MUNICIPAL DE FORTALEZA,104 - 0919 - 0006007021122,135,135,135,0,12345.678901/2345-78,TRUE +26/02/2025,"2025NE000006 - PARECERISTAS - 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0060/2025/SECULT/ASJUR, CONTRATO N°0005/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008954/2024-92",26/02/2025,2025NL000003,01/04/2025,2025OB000156,7591200070,339036,12345.678901/2345-80,4146785677,LEANDRO EUSTÁQUIO GOMES,00394460005887 - SECRETARIA DA RECEITA FEDERAL DO BRASIL,104 - 0919 - 0006007021122,"220,23","220,23","220,23",0,12345.678901/2345-79,TRUE +26/02/2025,"2025NE000007 - CONTRIBUIÇÕES PROVIDENCIARIAS SOBRE SERVIÇOS DE TERCEIROS - PF - RECURSO DESTINADO AO INSS PATRONAL DO PARECERISTA, LEANDRO EUSTÁQUIO GOMES, SELECIONADO PARA O EDITAL 18º EDITAL CICLO CEARÁ CARNAVALESCO - 2025 CONFORME PROCESSO N°27001.008954/2024-92",26/02/2025,2025NL000004,01/04/2025,2025OB000159,7591200070,339047,12345.678901/2345-81,394460005887,SECRETARIA DA RECEITA FEDERAL DO BRASIL,- - -,104 - 0919 - 0006007021122,567,567,567,0,12345.678901/2345-80,TRUE +26/02/2025,"2025NE000008 - CONTRATO Nº07/2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0069/2025/SECULT/ASJUR, CONTRATO N°0007/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008955/2024-37",26/02/2025,2025NL000007,27/02/2025,2025OB000028,7591200070,339036,12345.678901/2345-82,71064672604,CLAUDIA SILVA DE LIMA,07954597000152 - SECRETARIA DA FAZENDA DO EST DO CEARA,104 - 0919 - 0006007021122,"30,08","30,08","30,08",0,12345.678901/2345-81,TRUE +26/02/2025,"2025NE000008 - CONTRATO Nº07/2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0069/2025/SECULT/ASJUR, CONTRATO N°0007/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008955/2024-37",26/02/2025,2025NL000007,27/02/2025,2025OB000029,7591200070,339036,12345.678901/2345-83,71064672604,CLAUDIA SILVA DE LIMA,- - -,104 - 0919 - 0006007021122,"2753,26","2753,26","2753,26",0,12345.678901/2345-82,TRUE +26/02/2025,"2025NE000008 - CONTRATO Nº07/2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0069/2025/SECULT/ASJUR, CONTRATO N°0007/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008955/2024-37",26/02/2025,2025NL000007,18/03/2025,2025OB000151,7591200070,339036,12345.678901/2345-84,71064672604,CLAUDIA SILVA DE LIMA,07954605000160 - PREFEITURA MUNICIPAL DE FORTALEZA,104 - 0919 - 0006007021122,"161,25","161,25","161,25",0,12345.678901/2345-83,TRUE +26/02/2025,"2025NE000008 - CONTRATO Nº07/2025 - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0069/2025/SECULT/ASJUR, CONTRATO N°0007/2025, ANEXO AO PROCESSO DE PROCESSO Nº27001.008955/2024-37",26/02/2025,2025NL000007,01/04/2025,2025OB000156,7591200070,339036,12345.678901/2345-85,71064672604,CLAUDIA SILVA DE LIMA,00394460005887 - SECRETARIA DA RECEITA FEDERAL DO BRASIL,104 - 0919 - 0006007021122,"280,41","280,41","280,41",0,12345.678901/2345-84,TRUE +26/02/2025,"2025NE000009 - INSS PATRONAL DA SR. CLAUDIA SILVA DE LIMA - RECURSO DESTINADO AO INSS PATRONAL DO PARECERISTA, CLÁUDIA SILVA DE LIMA, SELECIONADO PARA O EDITAL 18º EDITAL CICLO CEARÁ CARNAVALESCO - 2025 CONFORME PROCESSO N°27001.008955/2024-37",26/02/2025,2025NL000008,01/04/2025,2025OB000160,7591200070,339047,12345.678901/2345-86,394460005887,SECRETARIA DA RECEITA FEDERAL DO BRASIL,- - -,104 - 0919 - 0006007021122,"677,25","677,25","677,25",0,12345.678901/2345-85,TRUE +26/02/2025,"2025NE000010 - PARECERISTAS - ELTHON GOMES FERNANDES - RECURSO DESTINADO ÀS DESPESAS COM SERVIÇOS TÉCNICOS PROFISSIONAIS, PRESTAÇÃO DE SERVIÇOS DE ANALISE E PARECER TÉCNICO A SER EMITIDO DURANTE 18º EDITAL CICLO CEARÁ CARNAVALESCO 2025, CONFORME PARECER Nº 0034/2025/SECULT/ASJUR, CONTRATO N°04/2025,INEXIGIBILIDADE DE LICITAÇÃO Nº 01/2025, ANEXO AO PROCESSO DE PROCESSO Nº 27001.008953/2024-48",26/02/2025,2025NL000012,27/02/2025,2025OB000023,7591200070,339036,12345.678901/2345-87,4893791419,ELTHON GOMES FERNANDES DA SILVA,- - -,104 - 0919 - 0006007021122,"2344,77","2344,77","2344,77",0,12345.678901/2345-86,TRUE diff --git a/cypress/fixtures/users.json b/cypress/fixtures/users.json index 2c0d920d..f099d3a2 100644 --- a/cypress/fixtures/users.json +++ b/cypress/fixtures/users.json @@ -48,5 +48,15 @@ "updated_name": "User Updated", "updated_email": "user.updated@example.com", "new_password": "newpassword" + }, + "financial": { + "name": "Ana Claudia Moreira da Silva", + "valid_email": "claudia.moreira@secult.ce.gov.br", + "password": "password", + "invalid_email": "test", + "incorrect_password": "123456", + "updated_name": "User Updated", + "updated_email": "user.updated@example.com", + "new_password": "newpassword" } } diff --git a/cypress/pages/notice/NoticePage.js b/cypress/pages/notice/NoticePage.js index 330f94ec..254d4a57 100644 --- a/cypress/pages/notice/NoticePage.js +++ b/cypress/pages/notice/NoticePage.js @@ -236,6 +236,27 @@ class Notice { expect(text.trim()).to.eq(newManagerEmail); }); } + + clickUploadPaymentsReportButton() { + cy.get(el.uploadBPaymentsReportButton) + .should('be.visible') + .and('not.be.disabled') + .contains('Subir relatório de pagamentos'); + } + + uploadPaymentsReport() { + cy.get(el.paymentsReportFileInput).selectFile('cypress/fixtures/documents/payments-report.csv', { + force: true, + }); + } + + displaySuccessMessagePaymentReportUploaded() { + cy.get(el.successAlert, { timeout: 20000 }) + .contains( + 'Importação concluída. 1 projeto(s) tiveram parcela(s) atualizada(s) com sucesso. 18 projeto(s) foram ignorados por não possuírem orçamento, parcela cadastrada ou parcela pendente de pagamento.' + ) + .should('be.visible'); + } } export default new Notice(); diff --git a/cypress/pages/notice/elements.js b/cypress/pages/notice/elements.js index bc60e43d..6dc5100c 100644 --- a/cypress/pages/notice/elements.js +++ b/cypress/pages/notice/elements.js @@ -59,6 +59,8 @@ export const elements = { noticeEditTextField: '[data-cy=notice-edit-textfield]', noticeEditTextArea: '[data-cy=notice-edit-textarea]', noticeEditTextSelect: '[data-cy=notice-edit-select]', + paymentsReportFileInput: '[data-cy=payments-report-file-input]', + uploadBPaymentsReportButton: '[data-cy=upload-payments-report-button]', // Alerts successAlert: '.v-snackbar', diff --git a/cypress/support/workflows/NoticeWorkflow.js b/cypress/support/workflows/NoticeWorkflow.js new file mode 100644 index 00000000..6531f706 --- /dev/null +++ b/cypress/support/workflows/NoticeWorkflow.js @@ -0,0 +1,58 @@ +import '../commands.js'; +import Notice from '../../pages/notice/NoticePage.js'; + +class NoticeWorkflow { + gotToNoticePage() { + Notice.visitPage(); + Notice.verifyPageLoaded(); + } + + accessNoticeDetails(nup) { + Notice.searchNoticeByNup(nup); + Notice.findNoticeByNup(nup); + + cy.url().should('match', /\/editais\/\d+\/projetos$/); + } + + fillNoticeIdentificationData(notice) { + Notice.openIdentificationDataForm(); + + Notice.fillIdentificationDataForm({ + noticeNup: notice.noticeNup, + instrumentType: notice.noticeInstrumentType, + totalAmount: notice.noticeTotalValue, + noticeManager: notice.noticeAccompanimentManager, + managerEmail: notice.noticeManagerEmail, + quotaNumber: notice.quotaNumber, + }); + + Notice.verifySuccessMessageIdentificationDataForm(); + } + + updateNoticeData(currentNotice, newNotice) { + this.accessNoticeDetails(currentNotice.noticeNup); + + Notice.clickShowAllInformationButton(); + Notice.verifyDetailViewElements(); + + Notice.updateDataAboutProcess(newNotice.noticeInstrumentType, newNotice.noticeManagerEmail); + + Notice.verifySuccessMessageUpdateNoticeData(); + + Notice.verifyUpdatedDataAboutProcess(newNotice.noticeInstrumentType, newNotice.noticeManagerEmail); + } + + uploadPaymentsReportFile() { + this.gotToNoticePage(); + + Notice.clickUploadPaymentsReportButton(); + + Notice.uploadPaymentsReport(); + } + + validatePaymentReportUpload() { + Notice.displaySuccessMessagePaymentReportUploaded(); + } +} + +export default new NoticeWorkflow(); diff --git a/resources/js/Pages/Notices/NoticesListPage.vue b/resources/js/Pages/Notices/NoticesListPage.vue index 2275e17c..86bebac6 100644 --- a/resources/js/Pages/Notices/NoticesListPage.vue +++ b/resources/js/Pages/Notices/NoticesListPage.vue @@ -253,6 +253,7 @@ async function handleFileUpload(event) { type="file" accept=".xlsx,.xls,.csv" class="hidden" + data-cy="payments-report-file-input" @change="handleFileUpload" /> Date: Fri, 18 Sep 2026 17:18:25 -0300 Subject: [PATCH 2/4] =?UTF-8?q?Refatorando=20alguns=20testes=20para=20a=20?= =?UTF-8?q?p=C3=A1gina=20de=20editais?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/efomento/noticePage/notice.cy.js | 156 +++++++++++------- cypress/fixtures/notices.json | 12 +- cypress/pages/notice/NoticePage.js | 144 ++++++++++------ cypress/pages/notice/elements.js | 11 +- cypress/support/workflows/NoticeWorkflow.js | 53 +++++- database/seeders/CypressRoleSeeder.php | 27 +++ database/seeders/CypressSeeder.php | 15 ++ reset-fomento.sh | 6 + .../js/Pages/Notices/NoticesListPage.vue | 2 +- resources/js/Pages/Notices/NupDialog.vue | 23 ++- 10 files changed, 320 insertions(+), 129 deletions(-) create mode 100644 database/seeders/CypressRoleSeeder.php create mode 100644 database/seeders/CypressSeeder.php diff --git a/cypress/e2e/efomento/noticePage/notice.cy.js b/cypress/e2e/efomento/noticePage/notice.cy.js index d95477bc..47bed865 100644 --- a/cypress/e2e/efomento/noticePage/notice.cy.js +++ b/cypress/e2e/efomento/noticePage/notice.cy.js @@ -1,114 +1,142 @@ import NoticeWorkflow from '../../../support/workflows/NoticeWorkflow'; -import Login from '../../../pages/auth'; import Notice from '../../../pages/notice/NoticePage'; describe('Notice Page - E2E Tests', () => { beforeEach(() => { cy.fixture('users').as('user'); cy.fixture('notices').as('notice'); - - // // cy.get('@user').then((user) => { - // // Login.accessLoginPage(); - // // Login.successLogin(user.valid_email, user.password, user.name); - // // }); - - // Notice.visitPage(); - // Notice.verifyPageLoaded(); }); - describe('Page Access and Navigation', () => { - it('should access the notice list page', function () { - cy.url().should('include', '/editais'); - }); + describe('Dashboard', () => { + it('should display the notice dashboard metrics', function () { + // Arrange + cy.loginByRole('fomentation'); - it('should display the notice list table', function () { - cy.get('[data-cy=table-notice-list]').should('be.visible'); - }); - }); + // Act + NoticeWorkflow.gotToNoticePage(); - describe('Dashboard Visibility', () => { - it('should display all dashboard cards', function () { + // Assert Notice.verifyDashboardCardsAreVisible(); }); it('should display all dashboard metric cards', function () { - Notice.verifyAllDashboardMetrics(); - }); - }); + // Arrange + cy.loginByRole('fomentation'); - describe('User Information Display', () => { - it('should display logged user name in header avatar', function () { - Notice.verifyLoggedUserDisplayedInHeader(this.user.name); - }); + // Act + NoticeWorkflow.gotToNoticePage(); - it('should display welcome message with user name', function () { - Notice.verifyWelcomeMessageDisplaysUsername(this.user.name); + // Assert + Notice.verifyAllDashboardMetrics(); }); }); - describe('Identification Data Form', () => { + describe('Identification Data', () => { it('should open the identification data form', function () { - Notice.openIdentificationDataForm(); - cy.get('[data-cy=notice-nup-identification-data-form]').should('be.visible'); + // Arrange + cy.loginByRole('fomentation'); + NoticeWorkflow.gotToNoticePage(); + + // Act + NoticeWorkflow.openIdentificationDataForm(); + + // Assert + NoticeWorkflow.validateIdentificationDataFormIsVisible(); }); it('should fill and submit the identification data form', function () { - Notice.openIdentificationDataForm(); + // Arrange + const notice = this.notice; + cy.loginByRole('fomentation'); + + // Act + NoticeWorkflow.fillNoticeIdentificationData(notice); + Notice.submitIdentificationDataForm(); - const notice = this.notice[0]; - const formData = { - noticeNup: notice.noticeNup, - instrumentType: notice.noticeInstrumentType, - totalAmount: notice.noticeTotalValue, - noticeManager: notice.noticeAccompanimentManager, - managerEmail: notice.noticeManagerEmail, - quotaNumber: notice.quotaNumber, - }; - - Notice.fillIdentificationDataForm(formData); + // Assert Notice.verifySuccessMessageIdentificationDataForm(); }); }); describe('Search Functionality', () => { it('should find a notice by title', function () { - const notice = this.notice[0]; + // Arrange + const notice = this.notice; + cy.loginByRole('fomentation'); + // Act + NoticeWorkflow.gotToNoticePage(); Notice.searchNoticeByTitle(notice.title); + + // Assert + Notice.validateResultSearchByTitle(notice.title); }); - it('should find a notice by NUP number', function () { - const notice = this.notice[0]; + it('should find a notice by NUP', function () { + // Arrange + const notice = this.notice; + cy.loginByRole('fomentation'); + // Act + NoticeWorkflow.gotToNoticePage(); Notice.searchNoticeByNup(notice.noticeNup); + + // Assert + Notice.validateResultSearchByNup(notice.noticeNup); }); it('should clear search and display all notices', function () { - const notice = this.notice[0]; + // Arrange + const notice = this.notice; + cy.loginByRole('fomentation'); - Notice.searchNoticeByNup(notice.noticeNup); - cy.get('[data-cy=find-specific-notice] input').clear(); - cy.get('[data-cy=table-notice-list] tbody tr').should('have.length.greaterThan', 1); + NoticeWorkflow.gotToNoticePage(); + + Notice.getTotalNotices().then((initialTotal) => { + Notice.searchNoticeByNup(notice.noticeNup); + + // Act + Notice.clearNoticeSearch(); + + // Assert + Notice.validateAllNoticesAreDisplayed(initialTotal); + }); }); }); describe('Filtering', () => { it('should filter notices by process status', function () { - const notice = this.notice[0]; + // Arrange + const notice = this.notice; + cy.loginByRole('fomentation'); + + NoticeWorkflow.gotToNoticePage(); + + // Act + Notice.filterByProcessStatus(notice.processStatus); - Notice.filterByProcessStatus(notice.processsStatus); + // Assert + Notice.validateNoticesByStatus(notice.processStatus); }); it('should filter notices by instrument type', function () { - const notice = this.notice[0]; + // Arrange + const notice = this.notice; + cy.loginByRole('fomentation'); + + NoticeWorkflow.gotToNoticePage(); - Notice.filterByInstrumentType(notice.noticeInstrumentType); + // Act + Notice.filterByInstrumentType(notice.instrumentType); + + // Assert + Notice.validateNoticesByInstrumentType(notice.instrumentType); }); }); - describe('Notice Details View', () => { + describe.only('Notice Details View', () => { it('should open notice details page', function () { - const notice = this.notice[0]; + const notice = this.notice; Notice.searchNoticeByNup(notice.noticeNup); Notice.goToNoticeDetailsPage(notice.noticeNup); @@ -116,7 +144,7 @@ describe('Notice Page - E2E Tests', () => { }); it('should display all information in detail view', function () { - const notice = this.notice[0]; + const notice = this.notice; Notice.searchNoticeByNup(notice.noticeNup); Notice.goToNoticeDetailsPage(notice.noticeNup); @@ -125,7 +153,7 @@ describe('Notice Page - E2E Tests', () => { }); it('should display correct NUP in detail view', function () { - const notice = this.notice[0]; + const notice = this.notice; Notice.searchNoticeByNup(notice.noticeNup); Notice.goToNoticeDetailsPage(notice.noticeNup); Notice.displayCorrectNupInDetailView(notice.noticeNup); @@ -134,7 +162,7 @@ describe('Notice Page - E2E Tests', () => { describe('Pagination', () => { it('should change the number of items displayed per page', function () { - const itemsPerPage = this.notice[0].quantityPerPage; + const itemsPerPage = this.notice.quantityPerPage; Notice.changeItemsPerPage(itemsPerPage); }); @@ -164,15 +192,15 @@ describe('Notice Page - E2E Tests', () => { describe('Update Notice Data', () => { it('should update data about notice and save', function () { - const currentNoticeData = this.notice[0]; - const newNoticeData = this.notice[1]; + const currentNotice = this.notice; + const updateData = this.notice; - Notice.goToNoticeDetailsPage(currentNoticeData.noticeNup); + Notice.goToNoticeDetailsPage(currentNotice.noticeNup); Notice.clickShowAllInformationButton(); Notice.verifyDetailViewElements(); - Notice.updateDataAboutProcess(newNoticeData.noticeInstrumentType, newNoticeData.noticeManagerEmail); + Notice.updateDataAboutProcess(updateData.noticeInstrumentType, updateData.noticeManagerEmail); Notice.verifySuccessMessageUpdateNoiceData(); - Notice.verifyUpdatedDataAboutProcess(newNoticeData.noticeInstrumentType, newNoticeData.noticeManagerEmail); + Notice.verifyUpdatedDataAboutProcess(updateData.noticeInstrumentType, updateData.noticeManagerEmail); }); }); diff --git a/cypress/fixtures/notices.json b/cypress/fixtures/notices.json index 04d6d0e4..28cb4064 100644 --- a/cypress/fixtures/notices.json +++ b/cypress/fixtures/notices.json @@ -1,13 +1,13 @@ { "id": 54, - "title": "SINCRONISMO DO MAPA CULTURAL COM O EFOMENTO", + "title": "EDITAL CYPRESS - EFOMENTO", "processStatus": "Processos em andamento", "noticeNup": "27001123456789012", - "processInstrumentType": "CONVÊNIO", - "noticeTotalValue": 13500000, - "noticeAccompanimentManager": "Saulo Furtado", - "noticeManagerEmail": "saulo.furtado@example.com", - "quotaNumber": 5, + "instrumentType": "CONVÊNIO", + "totalAmount": 13500000, + "accompanimentManager": "Cypress Notice Manager", + "managerEmail": "cypress.manager@example.com", + "quotaNumber": 3, "installmentAmount": 1500000, "quantityPerPage": 25 } diff --git a/cypress/pages/notice/NoticePage.js b/cypress/pages/notice/NoticePage.js index 254d4a57..6fadf482 100644 --- a/cypress/pages/notice/NoticePage.js +++ b/cypress/pages/notice/NoticePage.js @@ -1,7 +1,6 @@ import { elements as el } from './elements'; class Notice { - // Navigation and Page Access visitPage() { cy.visit('/editais'); } @@ -10,14 +9,13 @@ class Notice { cy.get(el.noticeListTable, { timeout: 10000 }).should('be.visible'); } - // Dashboard verifyDashboardCardsAreVisible() { cy.get(el.dashboardCard).should('have.length.at.least', 1); } verifyAllDashboardMetrics() { const expectedMetrics = [ - 'Editais Pendentes para abertura de processo', + 'Editais pendentes para abertura de processo', 'Editais com processos em andamento', 'Processos Formalizados', ]; @@ -27,7 +25,6 @@ class Notice { }); } - // User Info verifyLoggedUserDisplayedInHeader(username) { cy.get(el.userAvatarButton).should('be.visible').and('contain', username); } @@ -36,41 +33,55 @@ class Notice { cy.get(el.welcomeMessage).should('be.visible').and('contain', username); } - // Form Navigation + verifyIdentificationDataFormIsVisible() { + cy.get(el.noticeNupInput).should('be.visible'); + cy.get(el.instrumentTypeSelect).should('be.visible'); + cy.get(el.totalAmountInput).should('be.visible'); + cy.get(el.noticeManagerInput).should('be.visible'); + cy.get(el.managerEmailInput).should('be.visible'); + cy.get(el.quotaNumberInput).should('be.visible'); + cy.get(el.publicPolicySelect).should('be.visible'); + cy.get(el.budgeAllocationNupInput).should('be.visible'); + cy.get(el.budgetAllocationRequestDateInput).should('be.visible'); + cy.get(el.creditorRegistrationNup).should('be.visible'); + cy.get(el.creditorRegistratioRequestDate).should('be.visible'); + cy.get(el.closeIdentificationDataButton).should('be.visible'); + cy.get(el.submitFormButton).should('be.visible'); + } + openIdentificationDataForm() { cy.get(el.identificationDataFormButton).should('be.visible').first().click(); } - // Form Filling - fillIdentificationDataForm(formData) { - const { noticeNup, instrumentType, totalAmount, noticeManager, managerEmail, quotaNumber } = formData; + fillRequiredIdentificationDataFields(formData) { + const { noticeNup, instrumentType, totalAmount, quotaNumber } = formData; - // Fill NUP field cy.get(el.noticeNupInput).should('be.visible').type(noticeNup); - - // Select instrument type - cy.get(el.instrumentTypeSelect).should('be.visible').click(); - - cy.contains('.v-list-item', instrumentType).should('be.visible').click(); - - // Fill amount + this.selectDropdownOption(el.instrumentTypeSelect, instrumentType); cy.get(el.totalAmountInput).should('be.visible').type(totalAmount); + cy.get(el.quotaNumberInput).should('be.visible').type(quotaNumber); + } - // Fill manager name - cy.get(el.noticeManagerInput).should('be.visible').type(noticeManager); + fillIdentificationDataForm(formData) { + const { noticeNup, instrumentType, totalAmount, accompanimentManager, managerEmail, quotaNumber } = formData; - // Fill email + cy.get(el.noticeNupInput).should('be.visible').type(noticeNup); + this.selectDropdownOption(el.instrumentTypeSelect, instrumentType); + cy.get(el.totalAmountInput).should('be.visible').type(totalAmount); + cy.get(el.noticeManagerInput).should('be.visible').type(accompanimentManager); cy.get(el.managerEmailInput).should('be.visible').type(managerEmail); - - // Fill quota number cy.get(el.quotaNumberInput).should('be.visible').type(quotaNumber); + } - // Submit form + submitIdentificationDataForm() { cy.get(el.submitFormButton).should('be.visible').click(); } + verifyRequiredFieldValidation() { + cy.get(el.noticeNupInput).closest('.v-input').contains('Campo obrigatório').should('be.visible'); + } + verifySuccessMessageIdentificationDataForm() { - // Verify success message cy.get(el.successAlert, { timeout: 20000 }) .contains('Número do processo salvo com sucesso') .should('be.visible'); @@ -88,10 +99,11 @@ class Notice { cy.contains('.v-list-item', valueStr).should('be.visible').click(); } - // Search and Filtering searchNoticeByTitle(title) { cy.get(el.findSpecificNoticeInput).should('be.visible').type(title); + } + verifyNoticeWithTitleIsDisplayed(title) { cy.get(el.noticeListTable).within(() => { cy.get(el.noticeTitleNoticesList).contains(title).should('be.visible'); }); @@ -101,48 +113,76 @@ class Notice { const expectedNup = this.normalizeNup(nup); cy.get(el.findSpecificNoticeInput).should('be.visible').type(expectedNup); + } + + validateResultSearchByNup(nup) { + const expectedNup = this.normalizeNup(nup); cy.get(el.noticeListTable).within(() => { cy.get(el.noticeNupNoticesList) .invoke('text') .then((text) => { - const formattedNup = text.replace(/\D/g, ''); + const formattedNup = this.normalizeNup(text); + expect(formattedNup).to.equal(expectedNup); }); }); } + validateResultSearchByTitle(noticeTitle) { + cy.get(el.noticeListTable).within(() => { + cy.get(el.noticeTitleNoticesList).contains(noticeTitle).should('be.visible'); + }); + } + + clearNoticeSearch() { + cy.get(`${el.findSpecificNoticeInput} input`).clear(); + } + + getTotalNotices() { + return cy + .get(el.noticeTotalCount) + .invoke('text') + .then((text) => Number(text.trim())); + } + + validateAllNoticesAreDisplayed(expectedQuantity) { + this.getTotalNotices().should('eq', expectedQuantity); + + cy.get(`${el.noticeListTable} tbody tr`).should('have.length', expectedQuantity); + } filterByProcessStatus(status) { this.selectDropdownOption(el.filterProcessStatusSelect, status); + } - // Verify the table shows items matching the selected status + verifyNoticesAreFilteredByStatus(status) { cy.get(el.noticeListTable).should('be.visible').and('contain', status); } filterByInstrumentType(instrumentType) { this.selectDropdownOption(el.filterInstrumentTypeSelect, instrumentType); + } - // Verify the table lists the expected instrument type - // cy.get(el.noticeListTable).should('be.visible').and('contain', instrumentType); + verifyNoticesAreFilteredByInstrumentType(instrumentType) { + cy.get(el.noticeListTable).should('be.visible').and('contain', instrumentType); } - // Detail View goToNoticeDetailsPage(nup) { const expectedNup = this.normalizeNup(nup); - cy.get(el.noticeNupNoticesList).each(($element) => { - const currentNup = this.normalizeNup($element.text()); - - if (currentNup === expectedNup) { - cy.wrap($element).closest('tr').find(el.accessNoticeInformationButton).click(); - } - }); + cy.get(el.noticeTableRow) + .filter((_, row) => { + const currentNup = this.normalizeNup(Cypress.$(row).find(el.noticeNupNoticesList).text()); - cy.url({ timeout: 10000 }).should('match', /\/editais\/\d+\/projetos$/); + return currentNup === expectedNup; + }) + .first() + .find(el.accessNoticeInformationButton) + .click(); } - clickShowAllInformationButton() { - cy.get(el.showAllInformationButton).should('be.visible').click(); + verifyNoticeDetailsPageIsDisplayed() { + cy.url({ timeout: 10000 }).should('match', /\/editais\/\d+\/projetos$/); } verifyDetailViewElements() { @@ -171,7 +211,6 @@ class Notice { cy.get('[data-cy=notice-nup-show-all-information]').should('be.visible').and('contain', formatedNup); } - // Pagination changeItemsPerPage(quantity) { const quantityStr = quantity.toString(); this.selectDropdownOption(el.quantityPerPageSelect, quantityStr); @@ -183,6 +222,10 @@ class Notice { const pageStr = pageNumber.toString(); cy.get(el.paginationNumber).contains(pageStr).should('be.visible').click(); + } + + verifyPageIsActive(pageNumber) { + const pageStr = pageNumber.toString(); cy.get(el.paginationNumber) .contains(pageStr) @@ -197,21 +240,17 @@ class Notice { updateDataAboutProcess(newInstrumentType, newManagerEmail) { const instrumentType = newInstrumentType.toString(); - // Update Instrument Type cy.get(el.instrumentTypeDetail).children().eq(1).click(); this.selectDropdownOption(el.instrumentTypeDetail, instrumentType); - // Update Manager Email cy.get(el.managerEmailDetail).children().eq(1).click(); cy.get(el.noticeEditTextField).find('input').should('be.visible').clear(); cy.get(el.noticeEditTextField).find('input').should('be.visible').type(newManagerEmail); - // Click in Update Button cy.get(el.updateDataButton).click({ force: true }); } - verifySuccessMessageUpdateNoiceData() { - // Verify success message + verifySuccessMessageUpdateNoticeData() { cy.get(el.successAlert, { timeout: 20000 }).contains('Dados atualizados com sucesso').should('be.visible'); } @@ -237,11 +276,24 @@ class Notice { }); } + validateNoticesByStatus(status) { + cy.get(`${el.noticeListTable} tbody tr`).each(($row) => { + cy.wrap($row).should('contain.text', status); + }); + } + + validateNoticesByInstrumentType(instrumentType) { + cy.get(`${el.noticeListTable} tbody tr`).each(($row) => { + cy.wrap($row).should('contain.text', instrumentType); + }); + } + clickUploadPaymentsReportButton() { cy.get(el.uploadBPaymentsReportButton) .should('be.visible') .and('not.be.disabled') - .contains('Subir relatório de pagamentos'); + .contains('Subir relatório de pagamentos') + .click(); } uploadPaymentsReport() { diff --git a/cypress/pages/notice/elements.js b/cypress/pages/notice/elements.js index 6dc5100c..95e83e35 100644 --- a/cypress/pages/notice/elements.js +++ b/cypress/pages/notice/elements.js @@ -1,5 +1,3 @@ -import project from '../project/ProjectPage'; - export const elements = { // appContainer: '#app', @@ -10,6 +8,7 @@ export const elements = { userAvatarButton: '[data-cy=btnUserAvatar]', // Tables + noticeTotalCount: '[data-cy=notice-total-count]', noticeListTable: '[data-cy=table-notice-list]', noticeTableRow: '[data-cy=row-table-notice-list]', noticeNupNoticesList: '[data-cy=notice-nup-notices-list]', @@ -27,13 +26,21 @@ export const elements = { paginationNumber: '[data-cy=pagination-number-notice-list]', // Identification Data Form + identificationDataForm: '[data-cy=identification-data-form]', identificationDataFormButton: '[data-cy=access-identification-data-form-button]', noticeNupInput: '[data-cy=notice-nup-identification-data-form]', instrumentTypeSelect: '[data-cy=instrument-type-identification-data-form-select]', totalAmountInput: '[data-cy=total-amount-notice-identification-data-form]', + amountInFullIdentificationData: '[data-cy=amount-in-full-information-data]', noticeManagerInput: '[data-cy=notice-manager-accompaniment-identification-data-form]', managerEmailInput: '[data-cy=manager-email-identification-data-form]', quotaNumberInput: '[data-cy=quota-number-identification-data-form]', + publicPolicySelect: '[data-cy=public-policy-identification-data-form-select]', + budgeAllocationNupInput: '[data-cy="budget-allocation-nup"]', + budgetAllocationRequestDateInput: '[data-cy="budget-allocation-request-date"]', + creditorRegistrationNup: '[data-cy="creditor-retistration-nup"]', + creditorRegistratioRequestDate: '[data-cy="creditor-registration-request-date"]', + closeIdentificationDataButton: '[data-cy="close-idetification-data-button"]', submitFormButton: '[data-cy=add-data-identification-data-form-button]', // List actions diff --git a/cypress/support/workflows/NoticeWorkflow.js b/cypress/support/workflows/NoticeWorkflow.js index 6531f706..e1175c99 100644 --- a/cypress/support/workflows/NoticeWorkflow.js +++ b/cypress/support/workflows/NoticeWorkflow.js @@ -7,6 +7,14 @@ class NoticeWorkflow { Notice.verifyPageLoaded(); } + validateDashboardCardsAreVisible() { + Notice.verifyDashboardCardsAreVisible(); + } + + validateAllDashBoardMetrics() { + Notice.verifyAllDashboardMetrics(); + } + accessNoticeDetails(nup) { Notice.searchNoticeByNup(nup); Notice.findNoticeByNup(nup); @@ -14,19 +22,31 @@ class NoticeWorkflow { cy.url().should('match', /\/editais\/\d+\/projetos$/); } + fillRequiredNoticeIdentificationData(notice) { + Notice.openIdentificationDataForm(); + + Notice.fillRequiredIdentificationDataFields({ + noticeNup: notice.noticeNup, + instrumentType: notice.instrumentType, + totalAmount: notice.totalAmount, + quotaNumber: notice.quotaNumber, + }); + } + fillNoticeIdentificationData(notice) { + this.gotToNoticePage(); + + Notice.searchNoticeByTitle(notice.title); Notice.openIdentificationDataForm(); Notice.fillIdentificationDataForm({ noticeNup: notice.noticeNup, - instrumentType: notice.noticeInstrumentType, - totalAmount: notice.noticeTotalValue, - noticeManager: notice.noticeAccompanimentManager, - managerEmail: notice.noticeManagerEmail, + instrumentType: notice.instrumentType, + totalAmount: notice.totalAmount, + accompanimentManager: notice.accompanimentManager, + managerEmail: notice.managerEmail, quotaNumber: notice.quotaNumber, }); - - Notice.verifySuccessMessageIdentificationDataForm(); } updateNoticeData(currentNotice, newNotice) { @@ -50,9 +70,30 @@ class NoticeWorkflow { Notice.uploadPaymentsReport(); } + getInitialNoticeTotal() { + return Notice.getTotalNotices(); + } + + openIdentificationDataForm() { + Notice.openIdentificationDataForm(); + } + validatePaymentReportUpload() { Notice.displaySuccessMessagePaymentReportUploaded(); } + + validateIdentificationDataFormIsVisible() { + Notice.verifyIdentificationDataFormIsVisible(); + } + + validateAllNoticesAreDisplayed(notice) { + Notice.getTotalNotices().then((totalNotices) => { + Notice.searchNoticeByNup(notice.noticeNup); + Notice.clearNoticeSearch(); + + Notice.validateAllNoticesAreDisplayed(totalNotices); + }); + } } export default new NoticeWorkflow(); diff --git a/database/seeders/CypressRoleSeeder.php b/database/seeders/CypressRoleSeeder.php new file mode 100644 index 00000000..a18331c2 --- /dev/null +++ b/database/seeders/CypressRoleSeeder.php @@ -0,0 +1,27 @@ + Role::FOMENTATION->value, + 'glaucivane.portela@secult.ce.gov.br' => Role::LEGAL_ANALYSIS->value, + 'jferreira@secult.ce.gov.br' => Role::BUDGETARY->value, + 'claudia.moreira@secult.ce.gov.br' => Role::FINANCIAL->value, + 'cicero.gondim@secult.ce.gov.br' => Role::COORD_MONITORING->value, + ]; + + foreach ($users as $email => $role) { + $user = User::where('email', $email)->firstOrFail(); + + $user->syncRoles([$role]); + } + } +} diff --git a/database/seeders/CypressSeeder.php b/database/seeders/CypressSeeder.php new file mode 100644 index 00000000..4bf2ec46 --- /dev/null +++ b/database/seeders/CypressSeeder.php @@ -0,0 +1,15 @@ +call([ + CypressRoleSeeder::class, + ]); + } +} diff --git a/reset-fomento.sh b/reset-fomento.sh index ba639028..b50df088 100755 --- a/reset-fomento.sh +++ b/reset-fomento.sh @@ -8,3 +8,9 @@ docker compose up -d ## Rodar migrations e seeders docker compose exec app php artisan migrate:fresh --seed + +## Rodar migrations do Cypress +docker compose exec app php artisan db:seed --class="Database\Seeders\CypressSeeder" + +## Rodar sincronismo do Edital do Mapa Cultural +docker compose exec app php artisan tinker --execute="SyncNoticesJob::dispatch()" diff --git a/resources/js/Pages/Notices/NoticesListPage.vue b/resources/js/Pages/Notices/NoticesListPage.vue index 86bebac6..0ee84688 100644 --- a/resources/js/Pages/Notices/NoticesListPage.vue +++ b/resources/js/Pages/Notices/NoticesListPage.vue @@ -240,7 +240,7 @@ async function handleFileUpload(event) {

Total de editais encontrados: - {{ total }} + {{ total }}

diff --git a/resources/js/Pages/Notices/NupDialog.vue b/resources/js/Pages/Notices/NupDialog.vue index 6897ae5b..0d7950a2 100644 --- a/resources/js/Pages/Notices/NupDialog.vue +++ b/resources/js/Pages/Notices/NupDialog.vue @@ -80,7 +80,7 @@ const valorExtenso = computed(() => {