Summary Table
Categories |
Total Count |
PII |
0 |
URL |
1 |
DNS |
2 |
EKL |
0 |
IP |
0 |
PORT |
1 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
package automation.Pages;
import java.io.IOException;
import java.util.List;
import org.junit.Assert;
import automation.ExplorerSuite;
import automation.SharedCodeClass;
import po.EDI_PDILookupPO;
import po.EDI_WebViewerDentalPO;
import po.LoginPO;
/***
*
* @author EKutsenko,
* @version 1.0
*/
public class EDI_WebViewerPDILookup extends ExplorerSuite {
EDI_PDILookupPO ediWebViewerLookup;
EDI_WebViewerDentalPO ediWebViewerClaimInfo;
LoginPO selectLogin;
public void localRunner() throws IOException, InterruptedException{
//driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
ediWebViewerLookup = new EDI_PDILookupPO(driver);
ediWebViewerClaimInfo = new EDI_WebViewerDentalPO(driver);
loadPage();
testTitle();
testInputPositiveDental();
testInputPositiveInstit();
testInputPositiveProf();
testResetButton();
testInputNegativeDental();
}
public void loadPage() throws InterruptedException {
selectLogin = new LoginPO(driver);
//driver.get("https://
DNS.URL:PORT
/"); // Running on QA env
selectLogin.selectUserNameDropDown("
DNS
");
selectLogin.acceptBtnClick();
ediWebViewerLookup.EDIsearchClk();
// selectLogin.submitBtnClick();
}
//Test a Title, it should be "EDI Web Viewer"
public void testTitle() throws IOException, InterruptedException{
String expecteds = "EDI Web Viewer";
try {
String actuals = ediWebViewerLookup.getTitle();
// Thread.sleep(3000);
Assert.assertEquals("Title is wrong!", expecteds, actuals);
System.out.println("Verify a title is passed");
SharedCodeClass.addReport("Verify a title is passed");
} catch (AssertionError | Exception e) {
System.out.println("Verify a title is FAILED with a error: " + e);
SharedCodeClass.addReport("Verify a title is FAILED with a error: " + e.getMessage());
SharedCodeClass.addReport("***********************************************************");
}
}
//Verify that a dental pdi brings a user to a EDI Web Viewer Dental claim page
public void testInputPositiveDental() throws IOException, InterruptedException{
String pdiDental = "200617203000952";
char actual;
char expected = 'D';
try {
ediWebViewerLookup.setPDINumber(pdiDental);
ediWebViewerLookup.clickButtonRetrieve();
actual = ediWebViewerClaimInfo.getClaimType();
Assert.assertEquals("Claim Type is wrong!", expected, actual);
System.out.println("Verify a dental pdi is passed");
SharedCodeClass.addReport("Verify a dental pdi is passed");
} catch (AssertionError | Exception e) {
System.out.println("Verify a a dental pdi is FAILED with a error: " + e);
SharedCodeClass.addReport("Verify a a dental pdi is FAILED with a error: " + e.getMessage());
}
}
//Verify that a Inst pdi brings a user to a EDI Web Viewer Institutional claim page
public void testInputPositiveInstit() throws IOException, InterruptedException{
ediWebViewerLookup.EDIsearchClk();
String pdi = "200617203000830";
char actual;
char expected = 'I';
try {
ediWebViewerLookup.setPDINumber(pdi);
ediWebViewerLookup.clickButtonRetrieve();
actual = ediWebViewerClaimInfo.getClaimType();
Assert.assertEquals("Claim Type is wrong!", expected, actual);
System.out.println("Verify an Inst pdi is passed");
SharedCodeClass.addReport("Verify a Inst pdi is passed");
} catch (AssertionError | Exception e) {
System.out.println("Verify an Inst pdi is FAILED with a error: " + e);
SharedCodeClass.addReport("Verify an Instit pdi is FAILED with a error: " + e.getMessage());
}
}
//Verify that a Prof pdi brings a user to a EDI Web Viewer Institutional claim page
public void testInputPositiveProf() throws IOException, InterruptedException{
ediWebViewerLookup.EDIsearchClk();
String pdi = "200617203000824";
char actual;
char expected = 'P';
try {
ediWebViewerLookup.setPDINumber(pdi);
ediWebViewerLookup.clickButtonRetrieve();
actual = ediWebViewerClaimInfo.getClaimType();
Assert.assertEquals("Claim Type is wrong!", expected, actual);
System.out.println("Verify an Prof pdi is passed");
SharedCodeClass.addReport("Verify a Prof pdi is passed");
} catch (AssertionError | Exception e) {
System.out.println("Verify an Prof pdi is FAILED with a error: " + e);
SharedCodeClass.addReport("Verify an Prof pdi is FAILED with a error: " + e.getMessage());
}
}
//Verify that a Retrieve button is inactive until user enters 15 digits
public void testInputNegativeDental() throws IOException, InterruptedException{
ediWebViewerLookup.EDIsearchClk();
String pdiDental = "20061720300095";
try {
ediWebViewerLookup.setPDINumber(pdiDental);
Assert.assertTrue(ediWebViewerLookup.isDisabledButtonRetrieve());
System.out.println("Verify that Retrieve button is inactive until user enters 15 digits is passed");
} catch (AssertionError | Exception e) {
System.out.println("Verify that Retrieve button is inactive until user enters 15 digits is FAILED with a error: " + e);
SharedCodeClass.addReport("Verify that Retrieve button is inactive until user enters 15 digits FAILED with an error: " + e.getMessage());
}
}
// Verify a Reset button
public void testResetButton() throws IOException, InterruptedException{
ediWebViewerLookup.EDIsearchClk();
String pdiDental = "20061720300095";
ediWebViewerLookup.clickButtonResetForm();
try {
Assert.assertTrue(ediWebViewerLookup.isInputClean());
System.out.println("Verify Reset button is passed");
} catch (AssertionError | Exception e) {
System.out.println("Reset button FAILED with a error: " + e);
SharedCodeClass.addReport("Verify Reset button FAILED with an error: " + e.getMessage());
}
}
/*
public void testTable() {
driver.findElement(By.id("searchButton")).click();
// WebElement wait = (new WebDriverWait(driver, 10))
// .until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath("//table/thead/tr/th")));
List<WebElement> headers = driver.findElements(By.xpath("//table/thead/tr/th"));
for(WebElement header: headers) {
System.out.println(header.getText());
}
} */
}