Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding pre-validation Cypress test #1806

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions backend/cypress/e2e/full-submission.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { testCrossValidation } from '../support/cross-validation.js';
import { testLoginGovLogin } from '../support/login-gov.js';
import { testValidAccess } from '../support/check-access.js';
import { testValidEligibility } from '../support/check-eligibility.js';
Expand Down Expand Up @@ -57,15 +58,18 @@ describe('Full audit submission', () => {
cy.get(".usa-link").contains("Additional UEIs").click();
testWorkbookAdditionalUEIs(false); // don't intercept

cy.get(".usa-link").contains("Pre-submission validation").click();
testCrossValidation();

// Uncomment this block when ready to implement the certification steps.
/*
// These aren't enabled because the previous steps didn't actually upload anything. Our upload responses are mocked.

// These aren't enabled because the previous steps didn't actually upload anything. Our upload responses are mocked.
// First step, pre-validation.
cy.get(".usa-link").contains("Pre-submission validation").click();
cy.url().should('match', /\/audit\/ready-for-certification\/[0-9A-Z]{17}/);
// Mock a prositive response on validation, then it comes back to the checklist

// Second, auditor certification
cy.get(".usa-link").contains("Auditor Certification").click();
// Two pages:
Expand All @@ -79,7 +83,7 @@ describe('Full audit submission', () => {
// Finally, submit for processing.
cy.get(".usa-link").contains("Submit to the FAC for processing").click();
// This will probably take you back to the homepage, where the audit is now oof status "submitted".

*/
});
});
8 changes: 8 additions & 0 deletions backend/cypress/support/cross-validation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export function testCrossValidation() {
cy.url().should('match', /\/audit\/cross-validation\/[0-9A-Z]{17}/);
cy.get(".usa-button").contains("Begin Validation").click();
cy.get('.usa-fieldset').contains('Looks good!');

const reportTestId = '2023AUG0001000010';
cy.visit(`/audit/submission-progress/${reportTestId}`);
}