Skip to content

Commit

Permalink
MOSIP-33299 added revamp test cases (#1078)
Browse files Browse the repository at this point in the history
* MOSIP-34116

Signed-off-by: Anup Nehe <[email protected]>

* resolve conflicts

Signed-off-by: Anup Nehe <[email protected]>

* Update Kernel.properties

Signed-off-by: anup-nehe <[email protected]>

---------

Signed-off-by: Anup Nehe <[email protected]>
Signed-off-by: anup-nehe <[email protected]>
  • Loading branch information
anup-nehe authored Jan 9, 2025
1 parent 9e6fa7a commit d9f44d6
Show file tree
Hide file tree
Showing 18 changed files with 1,565 additions and 31 deletions.
4 changes: 2 additions & 2 deletions uitest-pmp/src/main/resources/config/Kernel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ splitdigit=7
jsonObjName=identity
bulkwait=10000
sbivalidDate=12/27/2022
sbiexpiryDate=12/27/2024
sbiexpiryDate=12/27/2026
policyData={\"authTokenType\":\"policy\",\"allowedKycAttributes\":[{\"attributeName\":\"fullName\"},{\"attributeName\":\"gender\"},{\"attributeName\":\"residenceStatus\"},{\"attributeName\":\"dateOfBirth\"},{\"attributeName\":\"photo\"},{\"attributeName\":\"civilRegistryNumber\"},{\"attributeName\":\"birthCertificateNumber\"},{\"attributeName\":\"flagidcs\"},{\"attributeName\":\"listCountry\"},{\"attributeName\":\"placeOfBirth\"},{\"attributeName\":\"flagb\"},{\"attributeName\":\"passportNumber\"},{\"attributeName\":\"referenceResidencyNumber\"},{\"attributeName\":\"resOuPass\"}],\"allowedAuthTypes\":[{\"authSubType\":\"IRIS\",\"authType\":\"bio\",\"mandatory\":false},{\"authSubType\":\"FINGER\",\"authType\":\"bio\",\"mandatory\":false},{\"authSubType\":\"\",\"authType\":\"otp\",\"mandatory\":false},{\"authSubType\":\"FACE\",\"authType\":\"bio\",\"mandatory\":false},{\"authSubType\":\"\",\"authType\":\"otp-request\",\"mandatory\":false},{\"authSubType\":\"\",\"authType\":\"kyc\",\"mandatory\":false},{\"authSubType\":\"\",\"authType\":\"demo\",\"mandatory\":false}]}
dataSharepolicyData={\"shareableAttributes\":[{\"attributeName\":\"fullName\",\"source\":[{\"attribute\":\"fullName\"}],\"encrypted\":true},{\"attributeName\":\"dateOfBirth\",\"source\":[{\"attribute\":\"dateOfBirth\"}],\"encrypted\":true},{\"attributeName\":\"gender\",\"source\":[{\"attribute\":\"gender\"}],\"encrypted\":true},{\"attributeName\":\"residenceStatus\",\"source\":[{\"attribute\":\"residenceStatus\"}],\"encrypted\":true},{\"attributeName\":\"phone\",\"source\":[{\"attribute\":\"phone\"}],\"encrypted\":true},{\"attributeName\":\"email\",\"source\":[{\"attribute\":\"email\"}],\"encrypted\":true},{\"attributeName\":\"dualCitizenshipAvailability\",\"source\":[{\"attribute\":\"dualCitizenshipAvailability\"}],\"encrypted\":true},{\"attributeName\":\"fatherName\",\"source\":[{\"attribute\":\"fatherName\"}],\"encrypted\":true},{\"attributeName\":\"shortenedPrintedName\",\"source\":[{\"attribute\":\"shortenedPrintedName\"}],\"encrypted\":true},{\"attributeName\":\"layName\",\"source\":[{\"attribute\":\"layName\"}],\"encrypted\":true},{\"attributeName\":\"nationalIdentityNumber\",\"source\":[{\"attribute\":\"nationalIdentityNumber\"}],\"encrypted\":true},{\"attributeName\":\"permanentAddress\",\"source\":[{\"attribute\":\"permanentAddress\"}],\"encrypted\":true},{\"attributeName\":\"temporaryAddress\",\"source\":[{\"attribute\":\"temporaryAddress\"}],\"encrypted\":true},{\"attributeName\":\"addressLine1\",\"source\":[{\"attribute\":\"addressLine1\"}],\"encrypted\":true},{\"attributeName\":\"addressLine2\",\"source\":[{\"attribute\":\"addressLine2\"}],\"encrypted\":true},{\"attributeName\":\"addressLine3\",\"source\":[{\"attribute\":\"addressLine3\"}],\"encrypted\":true},{\"attributeName\":\"region\",\"source\":[{\"attribute\":\"region\"}],\"encrypted\":true},{\"attributeName\":\"province\",\"source\":[{\"attribute\":\"province\"}],\"encrypted\":true},{\"attributeName\":\"profession\",\"source\":[{\"attribute\":\"profession\"}],\"encrypted\":true},{\"attributeName\":\"city\",\"source\":[{\"attribute\":\"city\"}],\"encrypted\":true},{\"attributeName\":\"postalCode\",\"source\":[{\"attribute\":\"postalCode\"}],\"encrypted\":true},{\"attributeName\":\"zone\",\"source\":[{\"attribute\":\"zone\"}],\"encrypted\":true},{\"attributeName\":\"preferredLang\",\"source\":[{\"attribute\":\"preferredLang\"}],\"encrypted\":false},{\"attributeName\":\"individualBiometrics\",\"group\":\"CBEFF\",\"source\":[{\"attribute\":\"individualBiometrics\"}],\"encrypted\":true,\"format\":\"extraction\"}],\"dataSharePolicies\":{\"typeOfShare\":\"Data Share\",\"validForInMinutes\":\"30\",\"transactionsAllowed\":\"2\",\"encryptionType\":\"Partner Based\",\"shareDomain\":\"datashare.datashare\",\"source\":\"IDRepository\"}}
publicKey=ZAEACwACAHIAIINxl2dEhLP4GpDMjUal1yT9UtduBlILZPKh2hszFGmqABAAFwALCAAAAQABAQDCHegKJ3vRn__8h1knXKiLA8qfO5LebzBlRO2tAcI3HvLyL9rPkVrXWYQ6wAn4VQk015C1hViU-7k752dYE5WUAUbgsxOHvvDPH1t72CNHNj9dyE86wGqR9AtK3yz0yf1IP_xgtWpiaQ2V9t2d3LtgPYWnRuPJbcl97nLXXL6PGfh1mRwsQUi94coEBPMZ9YLLOAFckPuDZt-lEcXIMkj8r0uNwAZUSEvGifTNWbLjC5BRlJBmvScIlptXqIwBaq2kSMVK2X1KbQ6TM8zkA_co4LEAIZfcpMgPn6RdW0yFtcx24HqrCY8v0DHregwoCPPpw8HvB-r5aR09mXG64zsJ
signPublicKey=AAZABAAEAHIAAAAQABQACwgAAAEAAQEAr93rKokeZGIzcCtFX3iyCvwpmfnd9jz0nF__0bxWr0mH8Zs0rhlG6vKRagx31I4CdrLAECOwMZ0r7Y3utTqHqelQE3MJLtboKITOqYRpBkqHSm1jGaEb8a1E9yoJri3tZrBCrAShimrN_SbtS1uKbJUG3cuVuE0gtGLI1d5wMfS_4PSz3RwvZtGHisEb3zbV6SLcJkgcDeMbUD7P25SVJd1xrJybuGIgyeSZxOgLzy1P-qHCiOXiAO9o06fwyIhIYbeZYz5th4rq7Rb6mRK9EWFpLrLvBL0F6USiidl8qNCxxZZFUp3W5xFANVYfRvgLKI33zBYniZ7aTE8PgrYa2w
headless=yes
docker=yes
langcode=[{"language":"tam","value":"தமிழà¯\uFFFD"},{"language":"kan","value":"à²\u2022ನà³\uFFFDನಡ"},{"language":"hin","value":"hin"},{"language":"eng1","value":"English"},{"language":"eng","value":"English"},{"language":"fra","value":"Français"},{"language":"ara","value":"Arabic"}]
langcode=[{"language":"tam","value":"தமிழà¯\uFFFD"},{"language":"kan","value":"à²\u2022ನà³\uFFFDನಡ"},{"language":"hin","value":"hin"},{"language":"eng1","value":"English"},{"language":"eng","value":"English"},{"language":"fra","value":"Français"},{"language":"ara","value":"Arabic"}]
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,16 @@ public static void createUsers() {
moduleSpecificUser = needsToBeCreatedUser;
} else if (needsToBeCreatedUser.equals("nocert")) {
moduleSpecificUser = needsToBeCreatedUser;
} else if (needsToBeCreatedUser.equals("device")) {
}else if (needsToBeCreatedUser.equals("device")) {
moduleSpecificUser = needsToBeCreatedUser;
}
else if (needsToBeCreatedUser.equals("ftm")) {
moduleSpecificUser = needsToBeCreatedUser;
}else if (needsToBeCreatedUser.equals("ftmnocert")) {
moduleSpecificUser = needsToBeCreatedUser;
}



else {
moduleSpecificUser = BaseTestCaseFunc.currentModule + "-" + needsToBeCreatedUser;
Expand Down Expand Up @@ -140,7 +147,6 @@ public static void createUsers() {
}
userResource.roles().realmLevel() //
.add((availableRoles.isEmpty() ? allRoles : availableRoles));

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,23 @@ protected boolean isElementDisplayed(WebElement element) {
return false;
}
}

protected boolean isElementDisabled(WebElement element) {
try {
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(20));
Thread.sleep(2000);
waitForElementToBeDisabled(element);
return true;
} catch (Exception e) {
try {
Reporter.log("<p><img src='data:image/png;base64," + Screenshot.ClickScreenshot(driver)
+ "' width='900' height='450'/></p>");
} catch (IOException e1) {
e1.printStackTrace();
}
return false;
}
}

protected boolean isElementEnabled(WebElement element) {
try {
Expand All @@ -219,6 +236,11 @@ private void waitForElementToBeVisible(WebElement element) {
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(40));
wait.until(ExpectedConditions.visibilityOf(element));
}

private void waitForElementToBeDisabled(WebElement element) {
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.invisibilityOfAllElements(element));
}

public static void wait(int wait) {
try {
Expand Down Expand Up @@ -276,6 +298,19 @@ public static String getTestData() {
return JsonUtil.readJsonFileText("TestData.json");
}


public void refreshThePage() {
driver.navigate().refresh();
}

public static void NavigateBack() {
driver.navigate().back();
}

public static void NavigateForword() {
driver.navigate().forward();
}

public void reload() {
driver.navigate().refresh();
}
Expand All @@ -296,6 +331,7 @@ public String cancelAlert() {
String alertText = alert.getText();
alert.dismiss();
return alertText;

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ public class DashboardPage extends BasePage {
@FindBy(xpath = "//*[text()='Partner - Policy Linking']")
private WebElement PartnerPolicyMappingTab;

@FindBy(id = "dashboard_partner_certificate_list_header")
private WebElement dashboardPartnerCertificateListHeader;

@FindBy(xpath = "//*[text()='FTM Chip']")
private WebElement FTMChipTab;

@FindBy(id = "dashboard_ftm_chip_provider_card_header")
private WebElement dashboardFtmChipproviderCardHeader;


public DashboardPage(WebDriver driver) {
super(driver);
}
Expand Down Expand Up @@ -236,6 +246,18 @@ public void clickOnPartnerPolicyMappingTab() {
clickOnElement(PartnerPolicyMappingTab);
}

public void clickOnDashboardPartnerCertificateListHeader() {
clickOnElement(dashboardPartnerCertificateListHeader);
}

public void clickOnFTMChipTab() {
clickOnElement(FTMChipTab);
}

public void clickOnDashboardFtmChipproviderCardHeader() {
clickOnElement(dashboardFtmChipproviderCardHeader);
}

public void clickOnHamburgerOpen() {
clickOnElement(hamburgerOpen);
}
Expand Down
Loading

0 comments on commit d9f44d6

Please sign in to comment.