Skip to content

Commit

Permalink
Add extra provider type tests.
Browse files Browse the repository at this point in the history
Issue #1050: Add more integration tests
  • Loading branch information
Frank Duncan committed Aug 28, 2018
1 parent a40eac9 commit ecf670a
Show file tree
Hide file tree
Showing 8 changed files with 331 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ public class EnrollmentStepDefinitions {
@Given("^I have started an enrollment$")
public void i_have_started_an_enrollment() {
generalSteps.login("p1", "p1");
enrollmentSteps.prepareSpeechLanguagePathologistEnrollment();
enrollmentSteps.createEnrollment();
}

@When("^I am on the organization page$")
public void i_am_on_the_organization_page() {
enrollmentSteps.selectOrganizationalProviderType();
enrollmentSteps.prepareHeadStart();
enrollmentSteps.selectProviderType();
}

@When("^I am on the facility credentials page$")
Expand Down Expand Up @@ -185,4 +187,78 @@ public void i_update_individual_enrollment(String npi) {
public void i_update_organizational_enrollment(String npi) {
enrollmentSteps.updateOrganizationalEnrollment(npi);
}

@Given("^I am going to use NPI '(.+)'$")
public void i_am_going_to_use_NPI(String npi) {
enrollmentSteps.setNpi(npi);
}

@Given("^I am going to enroll as a Durable Medical Equipment provider$")
public void i_am_going_to_enroll_as_a_durable_medical_equipment_provider() {
enrollmentSteps.prepareDurableMedicalEquipment();
}

@Given("^I am going to enroll as a County Contracted Mental Health Rehab$")
public void i_am_going_to_enroll_as_a_county_contracted_mental_health_rehab() {
enrollmentSteps.prepareCountyContractedMentalHealthRehab();
}

@When("^I create and submit an enrollment using the generic organization workflow$")
public void i_create_and_submit_an_enrollment_using_the_generic_organization_workflow() throws IOException {
generalSteps.login("p1", "p1");
enrollmentSteps.createEnrollment();
enrollmentSteps.selectProviderType();
enrollmentSteps.enterOrganizationInfo();
enrollmentSteps.enterContactInfo();
enrollmentSteps.advanceFromOrganizationInfoToOwnershipInfo();
enrollmentSteps.enterOrganizationOwnershipInfo();
enrollmentSteps.setNoToAllDisclosures();
enrollmentSteps.advanceFromOrganizationOwnershipInfoToSummaryPage();
enrollmentSteps.advanceFromOrganizationSummaryToProviderStatementPage();
enrollmentSteps.signProviderStatement();
enrollmentSteps.submitEnrollment();
}

@Given("^I am going to enroll as a Child and Teen Checkup Clinic")
public void i_am_going_to_enroll_as_a_child_and_teen_checkup_clinic() {
enrollmentSteps.prepareChildTeenCheckupClinic();
}

@When("^I create and submit an enrollment using the organization with healthboard workflow$")
public void i_create_and_submit_an_enrollment_using_the_organization_with_healthboard_workflow() throws IOException {
generalSteps.login("p1", "p1");
enrollmentSteps.createEnrollment();
enrollmentSteps.selectProviderType();
enrollmentSteps.enterOrganizationInfo();
enrollmentSteps.enterContactInfo();
enrollmentSteps.advanceFromOrganizationInfoToLicenseInfo();
enrollmentSteps.checkCommunityHealthboard();
enrollmentSteps.advanceFromLicenseInfoToOwnershipInfo();
enrollmentSteps.enterOrganizationOwnershipInfo();
enrollmentSteps.setNoToAllDisclosures();
enrollmentSteps.advanceFromOrganizationOwnershipInfoToSummaryPage();
enrollmentSteps.advanceFromOrganizationSummaryToProviderStatementPage();
enrollmentSteps.signProviderStatement();
enrollmentSteps.submitEnrollment();
}

@When("^I create and submit an enrollment using the county contracted mental health rehab workflow$")
public void i_create_and_submit_an_enrollment_using_the_county_contracted_mental_health_rehab_workflow() throws IOException {
generalSteps.login("p1", "p1");
enrollmentSteps.createEnrollment();
enrollmentSteps.selectProviderType();
enrollmentSteps.enterOrganizationInfo();
enrollmentSteps.enterContactInfo();
enrollmentSteps.advanceFromOrganizationInfoToLicenseInfo();
enrollmentSteps.enterCcmhrInfo();
enrollmentSteps.advanceFromOrganizationLicenseInfoToIndividualMemberInfo();
enrollmentSteps.enterIndividualMember();
enrollmentSteps.advanceFromOrganizationIndividualMemberInfoToOwnershipInfo();
enrollmentSteps.enterOrganizationOwnershipInfo();
enrollmentSteps.setNoToAllDisclosures();
enrollmentSteps.advanceFromOrganizationOwnershipInfoToSummaryPage();
enrollmentSteps.advanceFromOrganizationSummaryToProviderStatementPage();
enrollmentSteps.signProviderStatement();
enrollmentSteps.submitEnrollment();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package gov.medicaid.features.enrollment.steps;

import gov.medicaid.features.enrollment.ui.CcmhrCredentialsPage;
import gov.medicaid.features.enrollment.ui.CtccCredentialsPage;
import gov.medicaid.features.enrollment.ui.EnrollmentDetailsPage;
import gov.medicaid.features.enrollment.ui.EnrollmentPage;
import gov.medicaid.features.enrollment.ui.IndividualInfoPage;
Expand All @@ -8,6 +10,7 @@
import gov.medicaid.features.enrollment.ui.OrganizationInfoPage;
import gov.medicaid.features.enrollment.ui.OrganizationSummaryPage;
import gov.medicaid.features.enrollment.ui.OwnershipInfoPage;
import gov.medicaid.features.enrollment.ui.PersonalCareAssistantAgencyInfoPage;
import gov.medicaid.features.enrollment.ui.PersonalCareAssistantPersonalInfoPage;
import gov.medicaid.features.enrollment.ui.PersonalInfoPage;
import gov.medicaid.features.enrollment.ui.PracticeInfoPage;
Expand All @@ -33,7 +36,6 @@ public class EnrollmentSteps {
private static final String FIRST_NAME = "FirstName";
private static final String MIDDLE_NAME = "MiddleName";
private static final String LAST_NAME = "LastName";
private static final String NPI = "0000000006";
private static final String SSN = "000-00-0000";
private static final LocalDate DATE_OF_BIRTH =
LocalDate.of(1970, 1, 1);
Expand Down Expand Up @@ -72,8 +74,6 @@ public class EnrollmentSteps {
private static final String RESIDENTIAL_ZIP = "55802";
private static final String RESIDENTIAL_COUNTY = "St. Louis";



private LoginPage loginPage;
private MyProfilePage myProfilePage;
private AllEnrollmentsPage allEnrollmentsPage;
Expand All @@ -82,6 +82,7 @@ public class EnrollmentSteps {
private OrganizationInfoPage organizationInfoPage;
private IndividualInfoPage individualInfoPage;
private PersonalCareAssistantPersonalInfoPage personCareAssistantPersonalInfoPage;
private PersonalCareAssistantAgencyInfoPage personCareAssistantAgencyInfoPage;
private PersonalInfoPage personalInfoPage;
private LicenseInfoPage licenseInfoPage;
private PracticeInfoPage practiceInfoPage;
Expand All @@ -90,28 +91,52 @@ public class EnrollmentSteps {
private OrganizationSummaryPage organizationSummaryPage;
private ProviderStatementPage providerStatementPage;
private EnrollmentDetailsPage enrollmentDetailsPage;
private CtccCredentialsPage ctccCredentialsPage;
private CcmhrCredentialsPage ccmhrCredentialsPage;

private SimpleDateFormat formFieldDateFormat = new SimpleDateFormat("MMddyyyy");

public void createEnrollment() {
allEnrollmentsPage.clickOnNewEnrollment();
private String providerType;
private String npi = "0000000006";

public void setNpi(String npi) {
this.npi = npi;
}

public void selectOrganizationalProviderType() {
selectProviderTypePage.selectProviderType("Head Start");
licenseType = "Head Start Agency Certification";
selectProviderTypePage.clickNext();
public void createEnrollment() {
allEnrollmentsPage.clickOnNewEnrollment();
}

public void selectIndividualProviderType() {
selectProviderTypePage.selectProviderType("Speech Language Pathologist");
public void prepareSpeechLanguagePathologistEnrollment() {
licenseType = "Speech Language Pathologist";
selectProviderTypePage.clickNext();
providerType = "Speech Language Pathologist";
}

public void selectPersonalCareAssistantlProviderType() {
selectProviderTypePage.selectProviderType("Personal Care Assistant");
public void preparePersonalCareAssistantEnrollment() {
providerType = "Personal Care Assistant";
licenseType = "Personal Care Assistant";
}

public void prepareDurableMedicalEquipment() {
providerType = "Durable Medical Equipment";
}

public void prepareChildTeenCheckupClinic() {
providerType = "Child And Teen Checkup Clinic";
}

public void prepareCountyContractedMentalHealthRehab() {
providerType = "County Contracted Mental Health Rehab";
}

public void prepareHeadStart() {
npi = "1234567893";
providerType = "Head Start";
licenseType = "Head Start Agency Certification";
}

public void selectProviderType() {
selectProviderTypePage.selectProviderType(providerType);
selectProviderTypePage.clickNext();
}

Expand All @@ -120,7 +145,7 @@ void enterIndividualPersonalInfo() {
personalInfoPage.enterFirstName(FIRST_NAME);
personalInfoPage.enterMiddleName(MIDDLE_NAME);
personalInfoPage.enterLastName(LAST_NAME);
personalInfoPage.enterNPI(NPI);
personalInfoPage.enterNPI(npi);
personalInfoPage.enterSSN(SSN);
personalInfoPage.enterDOB(DATE_OF_BIRTH);
personalInfoPage.enterEmail(EMAIL);
Expand All @@ -144,6 +169,18 @@ void enterPersonCareAssistantIndividualPersonalInfo() {
personCareAssistantPersonalInfoPage.clickNext();
}

@Step
void enterPersonCareAssistantAgencyInfo() {
personCareAssistantAgencyInfoPage.enterAgencyName("Test Agency");
personCareAssistantAgencyInfoPage.enterAgencyId(MIDDLE_NAME);
personCareAssistantAgencyInfoPage.enterAgencyNpi("1111111112");
personCareAssistantAgencyInfoPage.enterFaxNumber("123", "456", "7890");
personCareAssistantAgencyInfoPage.enterAgencyContactName("Agency Contact Name");
personCareAssistantAgencyInfoPage.enterBackgroundStudyId("Study Id");
personCareAssistantAgencyInfoPage.enterClearanceDate(LocalDate.of(2000, 1, 1));
personCareAssistantAgencyInfoPage.clickNext();
}

@Step
void advanceFromIndividualPersonalInfoToLicenseInfo() {
personalInfoPage.clickNext();
Expand All @@ -156,13 +193,19 @@ void advanceFromOrganizationInfoToLicenseInfo() {
assertThat(organizationInfoPage.getTitle()).contains("Facility Credentials");
}

@Step
void advanceFromOrganizationInfoToOwnershipInfo() {
organizationInfoPage.clickNext();
assertThat(ownershipInfoPage.getTitle()).contains("Ownership Information");
}

@Step
void clickAddLicense() {
licenseInfoPage.addLicense();
}

public void enterOrganizationInfo() {
organizationInfoPage.setNPI("1234567893");
organizationInfoPage.setNPI(npi);
organizationInfoPage.setEffectiveDate(generateEffectiveDate());
organizationInfoPage.setDoingBusinessAs("Test DBA");
organizationInfoPage.setLegalName("Test Name");
Expand Down Expand Up @@ -233,6 +276,24 @@ public void enterLicenseInfo() {
licenseInfoPage.enterIssueState(LICENSE_ISSUING_STATE_FULL);
}

@Step
public void checkCommunityHealthboard() throws IOException {
ctccCredentialsPage.checkCommunityHealthBoard();
ctccCredentialsPage.uploadSampleFile();
}

@Step
public void enterCcmhrInfo() throws IOException {
ccmhrCredentialsPage.addCTSSCertification(
LICENSE_ISSUE_DATE,
LICENSE_RENEWAL_DATE
);
ccmhrCredentialsPage.addCrisisStabilizationContract(
LICENSE_ISSUE_DATE,
LICENSE_RENEWAL_DATE
);
}

@Step
public void enterPersonCareAssistantLicenseInfoWithRenewalDate() {
licenseInfoPage.addLicense();
Expand Down Expand Up @@ -364,6 +425,12 @@ void advanceFromOrganizationIndividualMemberInfoToOwnershipInfo() {
assertThat(ownershipInfoPage.getTitle()).contains("Ownership Information");
}

@Step
void advanceFromLicenseInfoToOwnershipInfo() {
licenseInfoPage.clickNext();
assertThat(ownershipInfoPage.getTitle()).contains("Ownership Information");
}

@Step
void addIndividualOwnership() {
ownershipInfoPage.addIndividualOwnership();
Expand All @@ -388,7 +455,7 @@ void validatePersonalSummaryInformation() {
assertThat(individualSummaryPage.getLastName())
.isEqualToIgnoringWhitespace(LAST_NAME);
assertThat(individualSummaryPage.getNPI())
.isEqualToIgnoringWhitespace(NPI);
.isEqualToIgnoringWhitespace(npi);
assertThat(individualSummaryPage.getSSN())
.isEqualToIgnoringWhitespace(SSN);
assertThat(individualSummaryPage.getDOB())
Expand Down Expand Up @@ -474,6 +541,7 @@ void checkNoOnProviderDisclosureQuestions() {

@Step
void signProviderStatement() {
providerStatementPage.acceptAllAgreements();
providerStatementPage.enterProviderName(LAST_NAME);
providerStatementPage.enterProviderTitle("Title");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package gov.medicaid.features.enrollment.steps;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;

import gov.medicaid.features.general.steps.GeneralSteps;

import net.thucydides.core.annotations.Steps;

import java.io.IOException;

@SuppressWarnings("unused")
public class IndividualEnrollmentStepDefinitions {
@Steps
EnrollmentStepDefinitions enrollmentStepDefinitions;

@Steps
EnrollmentSteps enrollmentSteps;

Expand All @@ -16,13 +22,8 @@ public class IndividualEnrollmentStepDefinitions {

@When("^I am on the personal info page$")
public void i_am_on_the_personal_info_page() {
enrollmentSteps.selectIndividualProviderType();
}

@When("^I am on the personal assistant enrollment page$")
public void i_am_on_the_personal_care_assistant_enrollment_page() {
enrollmentSteps.selectPersonalCareAssistantlProviderType();
enrollmentSteps.enterPersonCareAssistantIndividualPersonalInfo();
enrollmentSteps.prepareSpeechLanguagePathologistEnrollment();
enrollmentSteps.selectProviderType();
}

@When("I am on the individual provider license info page")
Expand Down Expand Up @@ -88,4 +89,23 @@ public void i_am_on_the_individual_provider_statement_page() throws IOException
i_am_on_the_individual_summary_page();
enrollmentSteps.advanceFromIndividualSummaryToProviderStatementPage();
}

@Given("^I am going to enroll as a Personal Care Assistant$")
public void i_am_going_to_enroll_as_a_Personal_Care_Assistant() {
enrollmentSteps.preparePersonalCareAssistantEnrollment();
}

@When("^I create and submit an enrollment using the PCA workflow$")
public void i_create_and_submit_an_enrollment_using_the_pca_workflow() throws IOException {
enrollmentStepDefinitions.i_have_started_an_enrollment();
enrollmentSteps.selectProviderType();
enrollmentSteps.enterPersonCareAssistantIndividualPersonalInfo();
enrollmentSteps.enterPersonCareAssistantLicenseInfoWithRenewalDate();
enrollmentSteps.uploadLicense();
enrollmentSteps.advanceFromPersonalCareAssistantLicenseInfoToPracticeInfo();
enrollmentSteps.enterPersonCareAssistantAgencyInfo();
enrollmentSteps.advanceFromIndividualSummaryToProviderStatementPage();
enrollmentStepDefinitions.i_enter_my_provider_statement();
enrollmentSteps.submitEnrollment();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package gov.medicaid.features.enrollment.ui;

import gov.medicaid.features.PsmPage;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.time.LocalDate;

public class CcmhrCredentialsPage extends PsmPage {
public void addCTSSCertification(LocalDate beginDate, LocalDate endDate) throws IOException {
$("[name=_34_certificateInd_1]").click();
$("[name=_34_beginDate_1]").type(format(beginDate));
$("[name=_34_endDate_1]").type(format(endDate));
uploadSampleFile("Certification", "_34_attachment_1");
}

public void addCrisisStabilizationContract(LocalDate beginDate, LocalDate endDate) throws IOException {
$("[name=_34_certificateInd_3]").click();
$("[name=_34_beginDate_3]").type(format(beginDate));
$("[name=_34_endDate_3]").type(format(endDate));
uploadSampleFile("Certification", "_34_attachment_3");
}

private void uploadSampleFile(String typeName, String formName) throws IOException {
File temporaryFile = File.createTempFile(typeName + ".", ".txt");
try (PrintWriter writer = new PrintWriter(
new FileOutputStream(temporaryFile))) {
writer.println(typeName);
}
upload(temporaryFile.getAbsolutePath()).to($("[name=" + formName + "]"));
temporaryFile.deleteOnExit();
}
}
Loading

0 comments on commit ecf670a

Please sign in to comment.