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

bulk upload results e2e scaffolding #8281

Closed
wants to merge 1 commit into from
Closed
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
1 change: 0 additions & 1 deletion cypress/e2e/02a-bulk_upload_patient.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ describe("Bulk upload patients", () => {
cy.get(".prime-edit-patient").contains("Set up your spreadsheet");
cy.injectSRAxe();
cy.checkAccessibility(); // Bulk upload patient form

// uploads csv file of patients
const csvFileContent =
"last_name,first_name,middle_name,suffix,race,date_of_birth,biological_sex,ethnicity,street,street2,city,county,state,zip_code,country,phone_number,phone_number_type,employed_in_healthcare,resident_congregate_setting,role,email\n" +
Expand Down
59 changes: 59 additions & 0 deletions cypress/e2e/11-bulk_upload_results.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { generatePatient, loginHooks, testNumber } from "../support/e2e";
import {
cleanUpPreviousRunSetupData,
cleanUpRunOktaOrgs,
setupRunData,
} from "../utils/setup-utils";

const patients = [generatePatient(), generatePatient()];

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable patients.
const specRunName = "spec02a";
const currentSpecRunVersionName = `${testNumber()}-cypress-${specRunName}`;

const patientToCsv = (patient) => {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable patientToCsv.
return `${patient.lastName},${patient.firstName},,,unknown,5/11/1933,unknown,unknown,123 Main Street,,Washington,,DC,20008,USA,565-666-7777,MOBILE,No,No,VISITOR,[email protected]`;
};

describe("Bulk upload patients", () => {
before("setup data", () => {
loginHooks();

cy.task("getSpecRunVersionName", specRunName)
.then((prevSpecRunVersionName) => {
if (prevSpecRunVersionName) {
cleanUpPreviousRunSetupData(prevSpecRunVersionName);
// putting this here as well as in the after hook to guarantee
// the cleanup function runs even if the test gets interrupted
cleanUpRunOktaOrgs(prevSpecRunVersionName);
}
})
.then(() => {
let data = {
specRunName: specRunName,
versionName: currentSpecRunVersionName,
};
cy.task("setSpecRunVersionName", data);
setupRunData(currentSpecRunVersionName);
});
});

after(() => {
cleanUpRunOktaOrgs(currentSpecRunVersionName);
});

beforeEach(() => {
loginHooks();
});

it("navigates to the result bulk upload page", () => {
cy.visit("/");
cy.get(".usa-nav-container");
cy.get("#desktop-results-nav-link").click();
cy.get(".prime-secondary-nav");
cy.contains("Upload spreadsheet").click();
cy.get("#upload_add-patient").click();
cy.get(".prime-edit-patient").contains("Set up your spreadsheet");

});


});
Loading