Automatiza teste que tramita o processo para a fase de Orçamento - #448
Automatiza teste que tramita o processo para a fase de Orçamento#448jgaguiarm wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
cypress/pages/project/ProjectPage.js (1)
60-79: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winNormalize both sides of the NUP comparison, on both branches, for consistency.
Line 64 duplicates
Notice.normalizeNup's logic (text.replace(/\D/g, '')) instead of reusing it. Line 65 then compares the normalizedformattedNupagainst the rawprojectNupparameter without normalizing it. If a caller passes a formatted NUP (with separators), this assertion fails even though the values represent the same NUP.The
elsebranch (line 76) does the opposite: it normalizes only the expected side (Notice.normalizeNup(projectNup)) and matches it as a substring against the rendered DOM text viacy.contains, which depends on the DOM text also being digit-only.Use
Notice.normalizeNupconsistently on both sides of both comparisons.♻️ Suggested fix
cy.get(el.projectList).within(() => { cy.get(el.projectNupProjectList, { timeout: TIMEOUTS.SEARCH }) .invoke('text') .then((text) => { - const formattedNup = text.replace(/\D/g, ''); - expect(formattedNup).to.equal(projectNup); + expect(Notice.normalizeNup(text)).to.equal(Notice.normalizeNup(projectNup)); }); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cypress/pages/project/ProjectPage.js` around lines 60 - 79, Update both NUP assertions in the project-list flow to normalize the rendered value and expected projectNup with Notice.normalizeNup before comparing them. Replace the duplicated text.replace logic in the first branch, and ensure the else branch compares normalized values rather than relying on cy.contains against raw DOM text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cypress/e2e/efomento/projects/formalization.cy.js`:
- Around line 69-75: The “should tramit process to budget successfully” test
must start with the original Formalization project state, because the preceding
workflow mutates backend state. Reset or reseed the project in an appropriate
hook before invoking FormalizationWorkflow.tramitProcessWithSuccessToBudget, or
switch this test to an isolated fixture; preserve the existing workflow and test
data setup otherwise.
In `@cypress/pages/project/formalizationTab/FormalizationTab.js`:
- Around line 20-40: Add officialGazetteFile to the destructured parameters in
the fillRequiredFields method signature so that the test's configured gazette
file value is captured. Then update the gazette file upload logic within
fillRequiredFields to use the officialGazetteFile parameter instead of the
hardcoded cypress/fixtures/teste.pdf path, ensuring the method respects the
fixture value passed by the caller.
In `@cypress/pages/project/ProjectPage.js`:
- Around line 15-29: Update goToProjectDetailsPage to stop queuing clicks inside
the .each() callback: identify the matching row through the
cy.get(el.projectNupProjectList) chain using jQuery/Cypress filtering, then call
cy.wrap(...).click() exactly once on that row before the existing URL assertion.
Remove the misleading early-return comment and preserve Notice.normalizeNup
comparisons.
---
Nitpick comments:
In `@cypress/pages/project/ProjectPage.js`:
- Around line 60-79: Update both NUP assertions in the project-list flow to
normalize the rendered value and expected projectNup with Notice.normalizeNup
before comparing them. Replace the duplicated text.replace logic in the first
branch, and ensure the else branch compares normalized values rather than
relying on cy.contains against raw DOM text.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9aad7fb3-f24b-450b-952d-ea6d03de8dfb
⛔ Files ignored due to path filters (1)
cypress/fixtures/teste.pdfis excluded by!**/*.pdf
📒 Files selected for processing (7)
cypress/e2e/efomento/projects/formalization.cy.jscypress/fixtures/projects.jsoncypress/pages/project/ProjectPage.jscypress/pages/project/formalizationTab/FormalizationTab.jscypress/support/workflows/FormalizationWorkflow.jsresources/js/Components/ReturnProcessAction.vueresources/js/Pages/ProjectDetails/Partials/Tabs/Actions/TramitButton.vue
💤 Files with no reviewable changes (1)
- resources/js/Pages/ProjectDetails/Partials/Tabs/Actions/TramitButton.vue
| fillRequiredFields({ | ||
| asjurFinalisticProcessingDate, | ||
| asjurProcessReceivedDate, | ||
| processAssignedTo, | ||
| reportStatusSelected, | ||
| eparceriasCertificateDate, | ||
| asjurProcessingDate, | ||
| responsibleAtAsjur, | ||
| termNumber, | ||
| termSignatureSentAt, | ||
| termSignedAt, | ||
| sentToOfficeAt, | ||
| signedByOfficeAt, | ||
| saccNumber, | ||
| cgeAtendeTicket, | ||
| deliberationOption, | ||
| sentToChiefOfStaffAt, | ||
| officialGazettePublishedAt, | ||
| instrumentValidityStartAt, | ||
| instrumentValidityEndAt, | ||
| }) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use the configured gazette file.
fillRequiredFields drops officialGazetteFile and always uploads cypress/fixtures/teste.pdf. tramitProcessWithSuccessToBudget passes project.officialGazetteFile, but the test never uses that fixture value.
Proposed fix
officialGazettePublishedAt,
+ officialGazetteFile,
instrumentValidityStartAt,
instrumentValidityEndAt,
}) {
...
- cy.get(el.officialGazetteFileInput).selectFile('cypress/fixtures/teste.pdf', { force: true });
+ cy.get(el.officialGazetteFileInput).selectFile(officialGazetteFile, { force: true });Also applies to: 79-79
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cypress/pages/project/formalizationTab/FormalizationTab.js` around lines 20 -
40, Add officialGazetteFile to the destructured parameters in the
fillRequiredFields method signature so that the test's configured gazette file
value is captured. Then update the gazette file upload logic within
fillRequiredFields to use the officialGazetteFile parameter instead of the
hardcoded cypress/fixtures/teste.pdf path, ensuring the method respects the
fixture value passed by the caller.
✅ Descrição do propósito desse Pull Request
Automatiza teste que tramita o processo para a fase de Orçamento
🧭 Referência a Issue
#447
#445
❓ O que foi feito para atingir isso?
🏃♀️ Tipo de mudança
Marque as opções relevantes:
🕵️ Como foi testado?
Checklist: ✔️
Observação:
Summary by CodeRabbit
New Features
Bug Fixes
Tests