From 8261be7306095fa632b4b0fbfcd7ae841caec8d3 Mon Sep 17 00:00:00 2001 From: Phil Dominguez <142051477+phildominguez-gsa@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:31:11 -0400 Subject: [PATCH] Reducing duplicated code for Cypress tests (#2568) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Cleaning up imports and whitespace * Refactoring with testInitializeAudit and testFederalAwards * Fixing testFileUploadMsg * Comment * Import fix --------- Co-authored-by: Phil Dominguez <“philip.dominguez@gsa.gov”> --- backend/cypress/e2e/additional-eins.cy.js | 59 +++------------- backend/cypress/e2e/additional-ueis.cy.js | 59 +++------------- backend/cypress/e2e/audit-findings-text.cy.js | 55 ++------------- backend/cypress/e2e/audit-findings.cy.js | 59 ++-------------- backend/cypress/e2e/audit-report-pdf.cy.js | 64 +++-------------- backend/cypress/e2e/check-access.cy.js | 9 ++- backend/cypress/e2e/check-eligibility.cy.js | 2 +- .../cypress/e2e/corrective-action-plan.cy.js | 56 ++------------- backend/cypress/e2e/createNewAudit.cy.js | 69 +++++++++---------- backend/cypress/e2e/display-submissions.cy.js | 2 +- backend/cypress/e2e/federal-awards.cy.js | 55 ++------------- backend/cypress/e2e/notes-to-sefa.cy.js | 55 ++------------- backend/cypress/e2e/ready-for-cert.cy.js | 40 +++++------ backend/cypress/e2e/secondary-auditors.cy.js | 57 ++------------- backend/cypress/e2e/workbook-uploads.cy.js | 2 - backend/cypress/support/audit-info-form.js | 50 +++++++------- .../cypress/support/auditee-certification.js | 34 ++++----- backend/cypress/support/federal-awards.js | 12 ++++ backend/cypress/support/file-uploaded-msg.js | 21 +++--- backend/cypress/support/full-submission.js | 33 +-------- backend/cypress/support/general-info.js | 10 +-- backend/cypress/support/initialize-audit.js | 30 ++++++++ backend/cypress/support/tribal-audit-form.js | 23 +++---- 23 files changed, 231 insertions(+), 625 deletions(-) create mode 100644 backend/cypress/support/federal-awards.js create mode 100644 backend/cypress/support/initialize-audit.js diff --git a/backend/cypress/e2e/additional-eins.cy.js b/backend/cypress/e2e/additional-eins.cy.js index 2794a398a2..38e63ed8fe 100644 --- a/backend/cypress/e2e/additional-eins.cy.js +++ b/backend/cypress/e2e/additional-eins.cy.js @@ -1,65 +1,22 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - +import { testLoginGovLogin } from '../support/login-gov.js'; import { - testWorkbookAdditionalEINs, - testWorkbookFederalAwards, + testWorkbookAdditionalEINs, } from '../support/workbook-uploads.js'; -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); - describe('Additional EINs page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Additional EINs uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Additional EINs uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Additional EINs").click(); testWorkbookAdditionalEINs(false); - }); - - it('Displays message if file has already been uploaded', () => { testFileUploadMsg('Edit the Additional EINs'); }); - -}); \ No newline at end of file +}); diff --git a/backend/cypress/e2e/additional-ueis.cy.js b/backend/cypress/e2e/additional-ueis.cy.js index 9af561c301..da8e22e93d 100644 --- a/backend/cypress/e2e/additional-ueis.cy.js +++ b/backend/cypress/e2e/additional-ueis.cy.js @@ -1,65 +1,22 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - +import { testLoginGovLogin } from '../support/login-gov.js'; import { - testWorkbookAdditionalUEIs, - testWorkbookFederalAwards, + testWorkbookAdditionalUEIs, } from '../support/workbook-uploads.js'; -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); - describe('Additional UEIs page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Additional UEIs uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Additional UEIs uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Additional UEIs").click(); testWorkbookAdditionalUEIs(false); - }); - - it('Displays message if file has already been uploaded', () => { testFileUploadMsg('Edit the Additional UEIs'); }); - -}); \ No newline at end of file +}); diff --git a/backend/cypress/e2e/audit-findings-text.cy.js b/backend/cypress/e2e/audit-findings-text.cy.js index 37ac483b79..27637644f1 100644 --- a/backend/cypress/e2e/audit-findings-text.cy.js +++ b/backend/cypress/e2e/audit-findings-text.cy.js @@ -1,65 +1,22 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - +import { testLoginGovLogin } from '../support/login-gov.js'; import { - testWorkbookFederalAwards, testWorkbookFindingsText, } from '../support/workbook-uploads.js'; -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); - describe('Audit Findings Text page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Audit Findings Text uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Audit Findings Text uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Federal Awards Audit Findings Text").click(); testWorkbookFindingsText(false); - }); - - it('Displays message if file has already been uploaded', () => { testFileUploadMsg('Edit the Federal Awards Audit Findings Text'); }); - }); diff --git a/backend/cypress/e2e/audit-findings.cy.js b/backend/cypress/e2e/audit-findings.cy.js index f4a3445f21..b48874d9cc 100644 --- a/backend/cypress/e2e/audit-findings.cy.js +++ b/backend/cypress/e2e/audit-findings.cy.js @@ -1,69 +1,22 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - +import { testLoginGovLogin } from '../support/login-gov.js'; import { - testWorkbookFederalAwards, testWorkbookFindingsUniformGuidance, } from '../support/workbook-uploads.js'; -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); - describe('Audit Findings page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Audit Findings uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get('.usa-link').contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Audit Findings uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Federal Awards Audit Findings").click(); testWorkbookFindingsUniformGuidance(false); - - }); - - it('Displays message if file has already been uploaded', () => { testFileUploadMsg('Edit the Federal Awards Audit Findings'); }); - }); - - - diff --git a/backend/cypress/e2e/audit-report-pdf.cy.js b/backend/cypress/e2e/audit-report-pdf.cy.js index 4e00a002a7..caca017506 100644 --- a/backend/cypress/e2e/audit-report-pdf.cy.js +++ b/backend/cypress/e2e/audit-report-pdf.cy.js @@ -1,66 +1,20 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; +import { testFederalAwards } from '../support/federal-awards.js'; +import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testPdfAuditReport } from '../support/report-pdf.js'; - -import { - testWorkbookFederalAwards, -} from '../support/workbook-uploads.js'; - -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); +import { testPdfAuditReport } from '../support/report-pdf.js'; describe('Audit report PDF page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Audit report PDF uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Audit report PDF uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Audit report PDF").click(); testPdfAuditReport(false); + testFileUploadMsg('Edit the Audit report PDF'); }); - - it('Displays message if file has already been uploaded', () => { - cy.visit(`/audit/`); - cy.url().should('match', /\/audit\//); - cy.get(':nth-child(4) > .usa-table > tbody > tr').last().find('td:nth-child(1)>.usa-link').click(); - cy.get('.usa-link').contains('Edit the Audit report PDF').click(); - cy.get('#already-submitted') - .invoke('text') - .then((text) => { - const expectedText = 'A file has already been uploaded for this section. A successful reupload will overwrite your previous submission.'; - expect(text.trim()).to.equal(expectedText); - }); - }); - - }); \ No newline at end of file +}); diff --git a/backend/cypress/e2e/check-access.cy.js b/backend/cypress/e2e/check-access.cy.js index 388f1ce5b1..5fc0c60dce 100644 --- a/backend/cypress/e2e/check-access.cy.js +++ b/backend/cypress/e2e/check-access.cy.js @@ -3,7 +3,6 @@ import { testValidAuditeeInfo } from '../support/auditee-info.js'; import { addValidInfo, testValidAccess } from '../support/check-access.js'; describe('Create New Audit', () => { - beforeEach(() => { // contents of session are only called once cy.session('loginSession', () => { @@ -136,7 +135,7 @@ describe('Create New Audit', () => { }); describe('Auditor certifying official', () => { - + describe('Full name', () => { it('should display an error message when left blank', () => { cy.get('#certifying_auditor_contact_fullname').click().blur(); @@ -238,7 +237,7 @@ describe('Create New Audit', () => { }); describe('Auditee contacts', () => { - + describe('Full name', () => { it('should display an error message when left blank', () => { cy.get('#auditee_contacts_fullname').click().blur(); @@ -346,7 +345,7 @@ describe('Create New Audit', () => { }); describe('Auditor contacts', () => { - + describe('Full name', () => { it('should display an error message when left blank', () => { cy.get('#auditor_contacts_fullname').click().blur(); @@ -372,7 +371,7 @@ describe('Create New Audit', () => { cy.get('button').contains('Create').should('not.be.disabled'); }); }); - + describe('Email Address', () => { it('should display an error message when left blank', () => { cy.get('#auditor_contacts_email').click().blur(); diff --git a/backend/cypress/e2e/check-eligibility.cy.js b/backend/cypress/e2e/check-eligibility.cy.js index f5949403d2..957692ec4f 100644 --- a/backend/cypress/e2e/check-eligibility.cy.js +++ b/backend/cypress/e2e/check-eligibility.cy.js @@ -1,4 +1,4 @@ -import { selectValidEntries, testValidEligibilty } from '../support/check-eligibility.js'; +import { selectValidEntries } from '../support/check-eligibility.js'; describe('Create New Audit', () => { beforeEach(() => { diff --git a/backend/cypress/e2e/corrective-action-plan.cy.js b/backend/cypress/e2e/corrective-action-plan.cy.js index 06a8086ec1..a4ae944966 100644 --- a/backend/cypress/e2e/corrective-action-plan.cy.js +++ b/backend/cypress/e2e/corrective-action-plan.cy.js @@ -1,66 +1,22 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - +import { testLoginGovLogin } from '../support/login-gov.js'; import { - testWorkbookFederalAwards, testWorkbookCorrectiveActionPlan, } from '../support/workbook-uploads.js'; -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); - describe('Corrective Action Plan page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Corrective Action Plan uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Corrective Action Plan uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Corrective Action Plan").click(); testWorkbookCorrectiveActionPlan(false); - }); - - it('Displays message if file has already been uploaded', () => { testFileUploadMsg('Edit the Corrective Action Plan'); }); - }); - diff --git a/backend/cypress/e2e/createNewAudit.cy.js b/backend/cypress/e2e/createNewAudit.cy.js index 8525be65be..d15a496b96 100644 --- a/backend/cypress/e2e/createNewAudit.cy.js +++ b/backend/cypress/e2e/createNewAudit.cy.js @@ -1,43 +1,42 @@ import { testValidGeneralInfo } from '../support/general-info.js'; describe('Create new audit', () => { - //const reportTestId = '2023MAY0001000001'; + before(() => { + cy.visit('http://localhost:8000/report_submission/eligibility/'); + }); - before(() => { - cy.visit('http://localhost:8000/report_submission/eligibility/'); - }); - //got the page elements from Cypress Desktop - it('Fills out the Submission criteria check and clicks items', () => { - cy.get(':nth-child(3) > :nth-child(2) > .usa-radio__label').click(); - cy.get(':nth-child(4) > :nth-child(2) > .usa-radio__label').click(); - cy.get(':nth-child(5) > :nth-child(2) > .usa-radio__label').click(); - cy.get('#continue').click(); - cy.url().should('contain', '/report_submission/auditeeinfo/'); - }); + // Got the page elements from Cypress Desktop + it('Fills out the Submission criteria check and clicks items', () => { + cy.get(':nth-child(3) > :nth-child(2) > .usa-radio__label').click(); + cy.get(':nth-child(4) > :nth-child(2) > .usa-radio__label').click(); + cy.get(':nth-child(5) > :nth-child(2) > .usa-radio__label').click(); + cy.get('#continue').click(); + cy.url().should('contain', '/report_submission/auditeeinfo/'); + }); - it('Fills out the Auditee Information', () => { - cy.get('#auditee_uei').type('CMBSGK6P7BE1'); - cy.get('#auditee_uei-btn').click(); - cy.get('auditee_fiscal_period_start').type('05/08/2023'); - cy.get('auditee_fiscal_period_end').type('05/08/2024'); - cy.get('#continue').click(); - cy.url().should('contain', '/report_submission/accessandsubmission/'); -}); + it('Fills out the Auditee Information', () => { + cy.get('#auditee_uei').type('CMBSGK6P7BE1'); + cy.get('#auditee_uei-btn').click(); + cy.get('auditee_fiscal_period_start').type('05/08/2023'); + cy.get('auditee_fiscal_period_end').type('05/08/2024'); + cy.get('#continue').click(); + cy.url().should('contain', '/report_submission/accessandsubmission/'); + }); - it('Fills out the Audit submission access', () => { - cy.get('#certifying_auditee_contact_fullname').type('Real Full Name'); - cy.get('#certifying_auditee_contact_email').type('va@test'); - cy.get('#certifying_auditor_contact_email').type('qualified.human.accountant@auditor.com'); - cy.get('#certifying_auditor_contact_fullname').type('A. Humanbeing'); - cy.get('#auditee_contacts_fullname').type('Doe A. Deer'); - cy.get('#auditee_contacts_email').type('a@a.com'); - cy.get('#auditor_contacts_fullname').type('Percy Person'); - cy.get('#auditor_contacts_email').type('c@c.com'); - cy.get('#create').click(); - cy.url().should('contain', '/report_submission/general-information/2023MAY0001000001'); - }); + it('Fills out the Audit submission access', () => { + cy.get('#certifying_auditee_contact_fullname').type('Real Full Name'); + cy.get('#certifying_auditee_contact_email').type('va@test'); + cy.get('#certifying_auditor_contact_email').type('qualified.human.accountant@auditor.com'); + cy.get('#certifying_auditor_contact_fullname').type('A. Humanbeing'); + cy.get('#auditee_contacts_fullname').type('Doe A. Deer'); + cy.get('#auditee_contacts_email').type('a@a.com'); + cy.get('#auditor_contacts_fullname').type('Percy Person'); + cy.get('#auditor_contacts_email').type('c@c.com'); + cy.get('#create').click(); + cy.url().should('contain', '/report_submission/general-information/2023MAY0001000001'); + }); - it('Fills out the General Information Form', () => { - testValidGeneralInfo(); - }); + it('Fills out the General Information Form', () => { + testValidGeneralInfo(); + }); }); diff --git a/backend/cypress/e2e/display-submissions.cy.js b/backend/cypress/e2e/display-submissions.cy.js index e7cafc156c..d855d86d0d 100644 --- a/backend/cypress/e2e/display-submissions.cy.js +++ b/backend/cypress/e2e/display-submissions.cy.js @@ -2,6 +2,7 @@ describe('Display my audit submissions', () => { before(() => { cy.visit('/submissions'); }); + describe('On correct page.', () => { it('does not display the submissions table', () => { cy.get('h1').should('have.text', 'My audit submissions'); @@ -19,7 +20,6 @@ describe('Display my audit submissions', () => { ).as('hasNoData'); cy.visit('/submissions/'); cy.wait('@hasNoData').then((interception) => { - // console.log(interception); cy.get('.usa-table-container') .should('have.attr', 'class') .and('contain', 'display-none'); diff --git a/backend/cypress/e2e/federal-awards.cy.js b/backend/cypress/e2e/federal-awards.cy.js index daaef88359..ea59622a4d 100644 --- a/backend/cypress/e2e/federal-awards.cy.js +++ b/backend/cypress/e2e/federal-awards.cy.js @@ -1,62 +1,17 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - -import { - testWorkbookFederalAwards, -} from '../support/workbook-uploads.js'; - -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); +import { testLoginGovLogin } from '../support/login-gov.js'; describe('Federal awards page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Federal Awards uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); - - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); + testLoginGovLogin(); }); - it('Displays message if file has already been uploaded', () => { + it('Federal Awards uploads successfully', () => { + testFederalAwards(); testFileUploadMsg('Edit the Federal Awards'); }); - }); - diff --git a/backend/cypress/e2e/notes-to-sefa.cy.js b/backend/cypress/e2e/notes-to-sefa.cy.js index 86eee54d3b..b5cc9d0f25 100644 --- a/backend/cypress/e2e/notes-to-sefa.cy.js +++ b/backend/cypress/e2e/notes-to-sefa.cy.js @@ -1,65 +1,22 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - +import { testLoginGovLogin } from '../support/login-gov.js'; import { - testWorkbookFederalAwards, testWorkbookNotesToSEFA } from '../support/workbook-uploads.js'; -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); - describe('Notes to SEFA page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Notes to SEFA uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Notes to SEFA uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Notes to SEFA").click(); testWorkbookNotesToSEFA(false); - }); - - it('Displays message if file has already been uploaded', () => { testFileUploadMsg('Edit the Notes to SEFA'); }); - }); diff --git a/backend/cypress/e2e/ready-for-cert.cy.js b/backend/cypress/e2e/ready-for-cert.cy.js index c80e43e8b3..1e15307de0 100644 --- a/backend/cypress/e2e/ready-for-cert.cy.js +++ b/backend/cypress/e2e/ready-for-cert.cy.js @@ -1,25 +1,23 @@ - describe('Ready for SF-SAC Certification', () => { - //replace with your own report ID - const reportTestId = '2023MAY0001000001' - - before(() => { - cy.visit(`/audit/submission-progress/${reportTestId}`); - }); - - it('Page loads successfully', () => { - cy.url().should('include', `/audit/submission-progress/${reportTestId}`); - }); + // Replace with your own report ID + const reportTestId = '2023MAY0001000001' + + before(() => { + cy.visit(`/audit/submission-progress/${reportTestId}`); + }); - it('clicks Ready for SF-SAC Certification button', () => { - cy.visit(`/audit/submission-progress/${reportTestId}`); - cy.get('[href="/audit/ready-for-certification/2023MAY0001000001"] > .usa-button').click(); - cy.url().should('include', `/audit/ready-for-certification/${reportTestId}`); - }); + it('Page loads successfully', () => { + cy.url().should('include', `/audit/submission-progress/${reportTestId}`); + }); - it('clicks Submit for Certification', () => { - cy.visit(`/audit/ready-for-certification/${reportTestId}`); - cy.get('#continue').click(); - }) + it('clicks Ready for SF-SAC Certification button', () => { + cy.visit(`/audit/submission-progress/${reportTestId}`); + cy.get('[href="/audit/ready-for-certification/2023MAY0001000001"] > .usa-button').click(); + cy.url().should('include', `/audit/ready-for-certification/${reportTestId}`); + }); -}); \ No newline at end of file + it('clicks Submit for Certification', () => { + cy.visit(`/audit/ready-for-certification/${reportTestId}`); + cy.get('#continue').click(); + }) +}); diff --git a/backend/cypress/e2e/secondary-auditors.cy.js b/backend/cypress/e2e/secondary-auditors.cy.js index 6bb7ec3719..7b5bf554ec 100644 --- a/backend/cypress/e2e/secondary-auditors.cy.js +++ b/backend/cypress/e2e/secondary-auditors.cy.js @@ -1,65 +1,22 @@ import 'cypress-file-upload'; -import { testCrossValidation } from '../support/cross-validation.js'; -import { testLoginGovLogin } from '../support/login-gov.js'; -//import { testLogoutGov } from '../support/logout-gov.js'; -import { testValidAccess } from '../support/check-access.js'; -import { testValidEligibility } from '../support/check-eligibility.js'; -import { testValidAuditeeInfo } from '../support/auditee-info.js'; -import { testValidGeneralInfo } from '../support/general-info.js'; -import { testReportIdFound, testReportIdNotFound } from '../support/dissemination-table.js'; +import { testFederalAwards } from '../support/federal-awards.js'; import { testFileUploadMsg } from '../support/file-uploaded-msg.js'; - +import { testLoginGovLogin } from '../support/login-gov.js'; import { testWorkbookSecondaryAuditors, - testWorkbookFederalAwards, } from '../support/workbook-uploads.js'; -const LOGIN_TEST_EMAIL_AUDITEE = Cypress.env('LOGIN_TEST_EMAIL_AUDITEE'); -const LOGIN_TEST_PASSWORD_AUDITEE = Cypress.env('LOGIN_TEST_PASSWORD_AUDITEE'); -const LOGIN_TEST_OTP_SECRET_AUDITEE = Cypress.env('LOGIN_TEST_OTP_SECRET_AUDITEE'); - describe('Secondary Auditors page', () => { before(() => { - cy.session('login-session', () => { - cy.visit('/'); - cy.login(); - }); - }); - - it('Secondary auditors uploads successfully', () => { cy.visit('/'); - cy.url().should('include', '/'); + testLoginGovLogin(); + }); - cy.get('label[for=check-start-new-submission]').click(); - - cy.get('.usa-button').contains('Accept and start').click(); - - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - testValidEligibility(); - - testValidAuditeeInfo(); - - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - testValidGeneralInfo(); - - cy.get(".usa-link").contains("Federal Awards").click(); - testWorkbookFederalAwards(false); - + it('Secondary auditors uploads successfully', () => { + testFederalAwards(); cy.get(".usa-link").contains("Secondary Auditors").click(); testWorkbookSecondaryAuditors(false); - }); - - it('Displays message if file has already been uploaded', () => { testFileUploadMsg('Edit the Secondary Auditors'); }); - -}); \ No newline at end of file +}); diff --git a/backend/cypress/e2e/workbook-uploads.cy.js b/backend/cypress/e2e/workbook-uploads.cy.js index 88b91f38de..7aba6229cd 100644 --- a/backend/cypress/e2e/workbook-uploads.cy.js +++ b/backend/cypress/e2e/workbook-uploads.cy.js @@ -1,6 +1,4 @@ import 'cypress-file-upload'; -//require("@4tw/cypress-drag-drop"); - import { testWorkbookFederalAwards, testWorkbookFindingsUniformGuidance, diff --git a/backend/cypress/support/audit-info-form.js b/backend/cypress/support/audit-info-form.js index 623b9c85e6..2e9a377a02 100644 --- a/backend/cypress/support/audit-info-form.js +++ b/backend/cypress/support/audit-info-form.js @@ -2,36 +2,36 @@ Re-useable code for silling out the audit information form. */ export function testAuditInformationForm() { - // Select everything for the GAAP multiple choice checkboxes. - // Will pop the three conditional non-GAAP questions. - cy.get('[id^=gaap_results--]').each((item) => { - cy.get(item).click({force: true}); - }); + // Select everything for the GAAP multiple choice checkboxes. + // Will pop the three conditional non-GAAP questions. + cy.get('[id^=gaap_results--]').each((item) => { + cy.get(item).click({force: true}); + }); - // Select everything for question i - cy.get('[id^=sp_framework_basis--]').each((item) => { - cy.get(item).click({force: true}); - }); + // Select everything for question i + cy.get('[id^=sp_framework_basis--]').each((item) => { + cy.get(item).click({force: true}); + }); - // Question ii is a true/false, and is covered below + // Question ii is a true/false, and is covered below - // Select everything for question iii - cy.get('[id^=sp_framework_opinions--]').each((item) => { - cy.get(item).click({force: true}); - }); + // Select everything for question iii + cy.get('[id^=sp_framework_opinions--]').each((item) => { + cy.get(item).click({force: true}); + }); - // Answer 'Yes' to all Yes/No questions. - cy.get('[id$=--true]').each((item) => { - cy.get(item).click({force: true}); - }); + // Answer 'Yes' to all Yes/No questions. + cy.get('[id$=--true]').each((item) => { + cy.get(item).click({force: true}); + }); - // Enter 750000 into the dollar theshold number field. - cy.get('#dollar_threshold').type('750000').blur(); + // Enter 750000 into the dollar theshold number field. + cy.get('#dollar_threshold').type('750000').blur(); - // Select 0 and 1 for the multiple select agencies field. - cy.get('#agencies').select(['00', '01']).blur(); + // Select 0 and 1 for the multiple select agencies field. + cy.get('#agencies').select(['00', '01']).blur(); - cy.get('.usa-button').contains('Save and continue').click({force: true}); + cy.get('.usa-button').contains('Save and continue').click({force: true}); - cy.url().should('match', /\/audit\/submission-progress\/[0-9]{4}-[0-9]{2}-GSAFAC-[0-9]{10}/); -} \ No newline at end of file + cy.url().should('match', /\/audit\/submission-progress\/[0-9]{4}-[0-9]{2}-GSAFAC-[0-9]{10}/); +} diff --git a/backend/cypress/support/auditee-certification.js b/backend/cypress/support/auditee-certification.js index 41c733959d..bf3d830339 100644 --- a/backend/cypress/support/auditee-certification.js +++ b/backend/cypress/support/auditee-certification.js @@ -1,18 +1,18 @@ export function testAuditeeCertification() { - // 1. Click all the checkboxes to agree, submit and go to page 2 - cy.get('label[for=has_no_PII]').click(); - cy.get('label[for=has_no_BII]').click(); - cy.get('label[for=meets_2CFR_specifications]').click(); - cy.get('label[for=is_2CFR_compliant]').click(); - cy.get('label[for=is_complete_and_accurate]').click(); - cy.get('label[for=has_engaged_auditor]').click(); - cy.get('label[for=is_issued_and_signed]').click(); - cy.get('label[for=is_FAC_releasable]').click(); - cy.get('.usa-button').contains('Agree to auditee certification').click(); - - // 2. Sign and date, submit and go back to checklist - cy.get('#auditee_name').type('John Doe'); - cy.get('#auditee_title').type('Auditee'); - cy.get('#auditee_certification_date_signed').type("01/01/2022"); - cy.get('.usa-button').contains('Agree to auditee certification').click(); - } \ No newline at end of file + // 1. Click all the checkboxes to agree, submit and go to page 2 + cy.get('label[for=has_no_PII]').click(); + cy.get('label[for=has_no_BII]').click(); + cy.get('label[for=meets_2CFR_specifications]').click(); + cy.get('label[for=is_2CFR_compliant]').click(); + cy.get('label[for=is_complete_and_accurate]').click(); + cy.get('label[for=has_engaged_auditor]').click(); + cy.get('label[for=is_issued_and_signed]').click(); + cy.get('label[for=is_FAC_releasable]').click(); + cy.get('.usa-button').contains('Agree to auditee certification').click(); + + // 2. Sign and date, submit and go back to checklist + cy.get('#auditee_name').type('John Doe'); + cy.get('#auditee_title').type('Auditee'); + cy.get('#auditee_certification_date_signed').type("01/01/2022"); + cy.get('.usa-button').contains('Agree to auditee certification').click(); +} diff --git a/backend/cypress/support/federal-awards.js b/backend/cypress/support/federal-awards.js new file mode 100644 index 0000000000..bd14ad2e49 --- /dev/null +++ b/backend/cypress/support/federal-awards.js @@ -0,0 +1,12 @@ +import { testInitializeAudit } from './initialize-audit.js'; +import { + testWorkbookFederalAwards, +} from './workbook-uploads.js'; + +export function testFederalAwards(isTribal=false) { + testInitializeAudit(isTribal); + + // Upload all the workbooks. Don't intercept the uploads, which means a file will make it into the DB. + cy.get(".usa-link").contains("Federal Awards").click(); + testWorkbookFederalAwards(false); +} diff --git a/backend/cypress/support/file-uploaded-msg.js b/backend/cypress/support/file-uploaded-msg.js index 3235abc977..d4eb9b74a9 100644 --- a/backend/cypress/support/file-uploaded-msg.js +++ b/backend/cypress/support/file-uploaded-msg.js @@ -1,13 +1,10 @@ - +// Displays message if file has already been uploaded export function testFileUploadMsg(fileSectionName) { - cy.visit(`/audit/`); - cy.url().should('match', /\/audit\//); - cy.get(':nth-child(4) > .usa-table > tbody > tr').last().find('td:nth-child(1)>.usa-link').click(); - cy.get('.usa-link').contains(fileSectionName).click(); - cy.get('#already-submitted') - .invoke('text') - .then((text) => { - const expectedText = 'A file has already been uploaded for this section. A successful reupload will overwrite your previous submission.'; - expect(text.trim()).to.equal(expectedText); - }); - } \ No newline at end of file + cy.get('.usa-link').contains(fileSectionName).click(); + cy.get('#already-submitted') + .invoke('text') + .then((text) => { + const expectedText = 'A file has already been uploaded for this section. A successful reupload will overwrite your previous submission.'; + expect(text.trim()).to.equal(expectedText); + }); +} diff --git a/backend/cypress/support/full-submission.js b/backend/cypress/support/full-submission.js index 8fb0fe9874..b7fb1e4df1 100644 --- a/backend/cypress/support/full-submission.js +++ b/backend/cypress/support/full-submission.js @@ -1,17 +1,13 @@ import { testCrossValidation } from './cross-validation.js'; import { testLoginGovLogin } from './login-gov.js'; import { testLogoutGov } from './logout-gov.js'; -import { testValidAccess } from './check-access.js'; -import { testValidEligibility } from './check-eligibility.js'; -import { testValidAuditeeInfo } from './auditee-info.js'; -import { testValidGeneralInfo } from './general-info.js'; import { testAuditInformationForm } from './audit-info-form.js'; import { testPdfAuditReport } from './report-pdf.js'; import { testAuditorCertification } from './auditor-certification.js'; import { testAuditeeCertification } from './auditee-certification.js'; import { testReportIdFound, testReportIdNotFound } from './dissemination-table.js'; import { testTribalAuditPublic, testTribalAuditPrivate } from './tribal-audit-form.js'; - +import { testInitializeAudit } from './initialize-audit.js'; import { testWorkbookFederalAwards, testWorkbookNotesToSEFA, @@ -34,32 +30,7 @@ export function testFullSubmission(isTribal, isPublic) { // Logs in with Login.gov' testLoginGovLogin(); - // Moves on to the eligibility screen - // check the terms and conditions link and click "Accept and start..." - // - // this click actually goes to the "terms and conditions" link which - // brings up a modal - cy.get('label[for=check-start-new-submission]').click(); - cy.get('.usa-button').contains('Accept and start').click(); - cy.url().should('match', /\/report_submission\/eligibility\/$/); - - // Completes the eligibility screen - testValidEligibility(isTribal); - - // Now the auditee info screen - testValidAuditeeInfo(); - - // Now the accessandsubmission screen - testValidAccess(); - - // Report should not yet be in the dissemination table - cy.url().then(url => { - const reportId = url.split('/').pop(); - testReportIdNotFound(reportId); - }); - - // Fill out the general info form - testValidGeneralInfo(); + testInitializeAudit(isTribal); // Upload all the workbooks. Don't intercept the uploads, which means a file will make it into the DB. cy.get(".usa-link").contains("Federal Awards").click(); diff --git a/backend/cypress/support/general-info.js b/backend/cypress/support/general-info.js index 1f9eebbf31..f14b2bd6e8 100644 --- a/backend/cypress/support/general-info.js +++ b/backend/cypress/support/general-info.js @@ -1,7 +1,7 @@ // reusable code for filling out a valid general info form export function testValidGeneralInfo() { - // Fiscal period, pre-filled using info from the previous screen. + // Fiscal period, pre-filled using info from the previous screen. //cy.get('#auditee_fiscal_period_start').type('05/08/2023'); //cy.get('#auditee_fiscal_period_end').type('05/08/2024'); @@ -18,11 +18,11 @@ export function testValidGeneralInfo() { cy.get('#auditee_city').type('Richmond'); cy.get('#auditee_state').type('VA{enter}'); cy.get('#auditee_zip').type('23219'); - - // Auditee UEI is pre-filled and uneditable. + + // Auditee UEI is pre-filled and uneditable. // cy.get('#auditee_uei').type('CMBSGK6P7BE1'); cy.get('label[for=multiple-ueis-yes]').click(); - + // Auditee contact information cy.get('#auditee_contact_name').type('John Doe'); cy.get('#auditee_contact_title').type('Keymaster'); @@ -45,7 +45,7 @@ export function testValidGeneralInfo() { cy.get('#auditor_contact_title').type('Auditor'); cy.get('#auditor_phone').type('5555555555'); cy.get('#auditor_email').type('qualified.human.accountant@auditor'); - + cy.get('label[for=secondary_auditors-yes]').click(); cy.get('#continue').click(); diff --git a/backend/cypress/support/initialize-audit.js b/backend/cypress/support/initialize-audit.js new file mode 100644 index 0000000000..2c825c2837 --- /dev/null +++ b/backend/cypress/support/initialize-audit.js @@ -0,0 +1,30 @@ +import { testValidAccess } from './check-access.js'; +import { testValidEligibility } from './check-eligibility.js'; +import { testValidAuditeeInfo } from './auditee-info.js'; +import { testValidGeneralInfo } from './general-info.js'; +import { testReportIdNotFound } from './dissemination-table.js'; + +export function testInitializeAudit(isTribal=false) { + // Check the terms and conditions link and click "Accept and start..." + cy.get('label[for=check-start-new-submission]').click(); + cy.get('.usa-button').contains('Accept and start').click(); + cy.url().should('match', /\/report_submission\/eligibility\/$/); + + // Completes the eligibility screen + testValidEligibility(isTribal); + + // Now the auditee info screen + testValidAuditeeInfo(); + + // Now the accessandsubmission screen + testValidAccess(); + + // Report should not yet be in the dissemination table + cy.url().then(url => { + const reportId = url.split('/').pop(); + testReportIdNotFound(reportId); + }); + + // Fill out the general info form + testValidGeneralInfo(); +} diff --git a/backend/cypress/support/tribal-audit-form.js b/backend/cypress/support/tribal-audit-form.js index d3f6137fbb..59a33bc78a 100644 --- a/backend/cypress/support/tribal-audit-form.js +++ b/backend/cypress/support/tribal-audit-form.js @@ -1,16 +1,15 @@ - export function testTribalAuditPublic(){ - cy.get(`#is_tribal_information_authorized_to_be_public-yes`).click({force:true}); - cy.get('#tribal_authorization_certifying_official_name').type('John Wick'); - cy.get('#tribal_authorization_certifying_official_title').type('Offical'); - cy.get('#continue').click(); - cy.url().should('match', /\/audit\/submission-progress\/[0-9]{4}-[0-9]{2}-GSAFAC-[0-9]{10}$/); + cy.get(`#is_tribal_information_authorized_to_be_public-yes`).click({force:true}); + cy.get('#tribal_authorization_certifying_official_name').type('John Wick'); + cy.get('#tribal_authorization_certifying_official_title').type('Offical'); + cy.get('#continue').click(); + cy.url().should('match', /\/audit\/submission-progress\/[0-9]{4}-[0-9]{2}-GSAFAC-[0-9]{10}$/); } export function testTribalAuditPrivate(){ - cy.get(`#is_tribal_information_authorized_to_be_public-no`).click({force:true}); - cy.get('#tribal_authorization_certifying_official_name').type('Clint Eastwood'); - cy.get('#tribal_authorization_certifying_official_title').type('Official'); - cy.get('#continue').click(); - cy.url().should('match', /\/audit\/submission-progress\/[0-9]{4}-[0-9]{2}-GSAFAC-[0-9]{10}$/); -} \ No newline at end of file + cy.get(`#is_tribal_information_authorized_to_be_public-no`).click({force:true}); + cy.get('#tribal_authorization_certifying_official_name').type('Clint Eastwood'); + cy.get('#tribal_authorization_certifying_official_title').type('Official'); + cy.get('#continue').click(); + cy.url().should('match', /\/audit\/submission-progress\/[0-9]{4}-[0-9]{2}-GSAFAC-[0-9]{10}$/); +}