Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package automation.Pages;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import automation.ExplorerSuite;
import automation.SharedCodeClass;
import po.EDIWebViewerProfPO;
import po.EDI_PDILookupPO;
import po.EDI_Prof_Detail_PO;
import po.EDI_WebViewerDentalPO;
import po.LoginPO;

/***
*
* @author EKutsenko,
* @version 1.1
*/

public class EDI_PDIProf extends ExplorerSuite {

// LoginPO selectLogin;
EDIWebViewerProfPO ediWebViewer;
EDI_PDILookupPO ediWebViewerLookup;
EDI_Prof_Detail_PO profDetail;
String description;

public void localRunner() throws IOException, InterruptedException {

String pdi = "201710191000193"; // PDI for Prof Claim

ediWebViewer = new EDIWebViewerProfPO(driver);
ediWebViewerLookup = new EDI_PDILookupPO(driver);
profDetail = new EDI_Prof_Detail_PO(driver);

SharedCodeClass.loadEWVPage(pdi);
profDetail.clickDetailViewTab();



//verifyTitle("Title and a pdi number", pdi);
// verifyGeneralInfo("Upper card with general information");
// verifyPatientInfo("Patient Information section");
// verifyVendortInfo("Vendor Information section");
// verifyBillingInfo("Billing Information Section");
// verifyServiceLines("Service Lines Section");
/// verifyOHI("OHI section");
//verifyMiscellaneous("Miscellaneous Info section");
//validateRendProvNameNPITaxonomyCode("Validate Rendering provider Name, NPI, and taxonomy code"); //Story-01.11.22_TC004 To Verify Billing Misc detail view for all claim types displays Rendering provider Name, NPI, and taxonomy code


validateBillInfoFreqToolTip("Validate Billing Info Frequency ToolTip");

}




// Verify a title and a pdi number in the title
public void verifyTitle(String description, String pdi) throws IOException {
String expected = "EDI Web Viewer | " + pdi + " Original";
try {
String actual = ediWebViewer.getTitle();
Assert.assertEquals(description, expected, actual);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}
}

// Verify an upper card with general information
public void verifyGeneralInfo(String description) throws IOException {
List<String> expectedHeaders = Arrays.asList("Submission Type:", "Patient Name:", "Member:", "PDI:",
"Medicare Crossover:", "Billing NPI:", "TIN:", "PCN:");
List<String> expectedData = Arrays.asList("P(5010)", "CHPVAAAD,AAAA4", "666666664", "2006 172 03 000825", "N",
"1992882161", "005762224", "5383");

try {
ArrayList<String> actualHeaders = ediWebViewer.getGeneralInfoCardHeaders();
ArrayList<String> actualData = ediWebViewer.getGeneralInfoCardData();
Assert.assertEquals(description, expectedHeaders, actualHeaders);
Assert.assertEquals(description, expectedData, actualData);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}
}

// Verify a Patient Information
public void verifyPatientInfo(String description) throws IOException {
ediWebViewer.patientInfoClick();

List<String> expectedFields = Arrays.asList("Patient ID:", "Last Name:", "First Name:", "Date of Birth:",
"Gender:", "Date of Death:", "Address 1:", "Address 2:", "City:", "State:", "ZIP Code:", "Country:");
List<String> expectedData = Arrays.asList("666666664", "CHPVAAAD", "AAAA4", "03/03/2010", "F", "04/09/2018",
"4567 MAPLE", "DENVER", "DENVER", "CO", "802090000", "USA");

try {
ArrayList<String> actualFields = ediWebViewer.patientInfoFields();
ArrayList<String> actualData = ediWebViewer.patientInfoData();
Assert.assertEquals(description, expectedFields, actualFields);
Assert.assertEquals(description, expectedData, actualData);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}
}

/*****
* Vendor Info
********************************************************************/

public void verifyVendortInfo(String description) throws IOException {
ediWebViewer.vendorInfoClick();

List<String> expectedFields = Arrays.asList("Tax ID:", "Vendor:", "Address 1:", "Address 2:", "City:", "State:",
"ZIP Code:", "Country:", "NPI:");
List<String> expectedData1 = Arrays.asList("005762224", "MELNICK,SPENCER", "178 MIDDLE STREET, SUITE 501",
"PORTLAND", "PORTLAND", "ME", "041019998", "USA", "1992882161");
try {
Assert.assertEquals("Service Location Information", ediWebViewer.getServiceLocationHeader());
Assert.assertEquals("Billing Provider Information", ediWebViewer.getBillingProviderHeader());

ArrayList<String> actualFields = ediWebViewer.serviceLocationInfoFields();
Assert.assertEquals(description, expectedFields, actualFields);

ArrayList<String> actualData = ediWebViewer.serviceLocationInfoData();
Assert.assertEquals(description, expectedData1, actualData);

List<String> expectedData2 = Arrays.asList("005762224", "MELNICK,SPENCER", "178 MIDDLE STREET, SUITE 501",
"PORTLAND", "PORTLAND", "ME", "041019998", "USA", "1992882161");
ArrayList<String> actualData2 = ediWebViewer.billingProviderInfoData();
Assert.assertEquals(description, expectedData2, actualData2);

SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}
}

/***
* Billing Information
*********************************************************/

private void verifyBillingInfo(String description) throws IOException {
String expectedFields = "POS: 11 Frequency: 1";
List<String> expectedDx = Arrays.asList("DX:", "1:", "2:", "3:", "4:", "5:", "6:", "7:", "8:", "9:", "10:");
List<String> expectedDxData = Arrays.asList("F411", "518", "344", "262", "038", "486", "G56", "J56", "K56", "");
try {
String actualFields = ediWebViewer.getPOSandFreq();
List<String> actualDx = ediWebViewer.getDx();
List<String> actualDxData = ediWebViewer.getDxData();
// List<String> actualDxData = ediWebViewer.getDxData();
Assert.assertEquals(description, expectedFields, actualFields);
Assert.assertEquals(description, expectedDx, actualDx);
Assert.assertEquals(description, expectedDxData, actualDxData);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}

}

// Service Lines
private void verifyServiceLines(String description) throws IOException {
String expectedTotalCharges = "Total Charges: $180.00";
List<String> expectedServiceLinesHeaders = Arrays.asList("Line #", "Service From", "Service To", "POS",
"DX Pointer", "PROC/NDC", "Modifiers", "Qty. / Type", "Amount");
List<String> expectedServiceLinesData = Arrays.asList("1", "01/23/18", "01/23/18", "", "p1, p2, p3", "90837",
"", "1 UN", "180.00");
try {
List<String> actualServiceLinesHeaders = ediWebViewer.getServiceLinesHeaders();
List<String> actualServiceLinesData = ediWebViewer.getServiceLinesData();
Assert.assertEquals(description, expectedTotalCharges, ediWebViewer.getServiceLinesTotalCharges());
Assert.assertEquals(description, expectedServiceLinesHeaders, actualServiceLinesHeaders);
Assert.assertEquals(description, expectedServiceLinesData, actualServiceLinesData);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}
}

private void verifyOHI(String description) throws IOException {
List<String> expectedPrimary = Arrays.asList("Primary: MEDICAID COLORADO HEALTH",
"Seconday: MEDICAID COLORADO HEALTH", "Tertiary: Y");
List<String> expectedTableData1 = Arrays.asList(" ", "$1.00", "COA1", "$100.00", "$1.00", "COA1", "$100.00",
"$1.00", "[object Object]", "$100.00");
List<String> expectedTableHeader = Arrays.asList("Line #", "Svc. From", "Amount", "PROC", "Primary Paid",
"Adj.", "Adj. Amount", "Secondary Paid", "Adj.", "Adj. Amount", "Tertiary Paid", "Adj.", "Adj. Amount");
List<String> actualOHITableHeaders = ediWebViewer.getOHITableHeader();
Assert.assertEquals(description, expectedTableHeader, actualOHITableHeaders);

List<String> expectedTableData2 = Arrays.asList("Remittance Remark Codes:", "REM1, REM2, REM3, REM4, REM5,",
"REMARK1, REMARK2, REMARK3, REMARK4, REMARK5,", "REM1, REM2, REM3, REM4, REM5,");
try {
List<String> actualPrimary = ediWebViewer.getPrimarySecondaryTert();
Assert.assertEquals(description, expectedPrimary, actualPrimary);

List<String> actualOHITableData1 = ediWebViewer.getOHITableData1();
Assert.assertEquals(description, expectedTableData1, actualOHITableData1);

// List<String> actualOHITableData2 =
// ediWebViewer.getOHITableData2();
// List<String> expectedTableData2 = Arrays.asList("1","01/22/18",
// "95.00", "", "$", "", "$", "$", "", "$", "", "", "");
// Assert.assertEquals(description, expectedTableData2,
// actualOHITableData2);

List<String> actualOHITableData2 = ediWebViewer.getOHITableData2();
Assert.assertEquals(description, expectedTableData2, actualOHITableData2);

SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}
}

/*** Miscellaneous *********************************************************/

private void verifyMiscellaneous(String description) throws IOException {
String expected = "Miscellaneous";
List<String> expectedData = Arrays.asList("Provider Accepted Assignment: A", "Patient Paid: $ 1.00");
try {
String actual = ediWebViewer.getMiscellaneousLabel();
List<String> actualData = ediWebViewer.getMiscellaneousData();
Assert.assertEquals(description, expected, actual);
Assert.assertEquals(description, expectedData, actualData);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}

}


/*****
* Added 07/06/2018 for Story-01.11.22_TC004 To Verify Billing Misc detail view for all claim types displays Rendering provider Name, NPI, and taxonomy code
Build 6 Sprint 22
EKutsenko
* @throws IOException
****/

private void validateRendProvNameNPITaxonomyCode(String description) throws IOException {
String expectedRPN = "HALLBERG, JOHN A";
String expectedNPI = "1912971508";
String expectedTC = "207X00000X";

try {
String actualRPN = profDetail.get_billMiscRendProvName();
Assert.assertEquals(description, expectedRPN, actualRPN);

String actualNPI = profDetail.get_billMiscNpi();
Assert.assertEquals(description, expectedNPI, actualNPI);

String actualTC = profDetail.get_billMiscTaxCode();
Assert.assertEquals(description, expectedTC, actualTC);

SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e);
}
}

private void validateBillInfoFreqToolTip(String description) throws IOException {
String expected = "hidden";
String actual = profDetail.get_billInfoFrequencyToolTip_isNOTDisplayed();
try {
Assert.assertEquals(description, expected, actual);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e); }

expected = "visible";
actual = profDetail.get_billInfoFrequencyToolTip_isDisplayed();
try {
Assert.assertEquals(description, expected, actual);
SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e); }
}


}