diff --git a/pmptest/README.md b/pmptest/README.md
index 80b04d2eb..09cad99d6 100644
--- a/pmptest/README.md
+++ b/pmptest/README.md
@@ -1,4 +1,4 @@
-# Admin Automation
+# PMP Automation
## Overview
Selenium webdriver based Admin Portal Automation covers CRUD(create, read, update and delete) operation performed via UI with Chrome driver
@@ -11,35 +11,33 @@ Selenium webdriver based Admin Portal Automation covers CRUD(create, read, updat
## Configurations
1. Update below keys from `Config.properties`
* langcode:eng -- Admin login page language selection description placed in `TestData.json`
-* bulkwait:10000 -- Bulk upload wait
+
2. Update below keys from `TestData.json`
* setExcludedGroups:"" -- To run all the scenario mentioned below
* setExcludedGroups:"BL,CT" -- To exclude testcases execution based on below tags
-
+* To run in hardless mode "hedless":"yes"
+* To run it in regular "hedless": "no"
3. Chrome driver place under working directory inside folder name chromedriver
## Below tags with scenarios
-* blocklistedwordsCRUD: BL
-* bulkUploadCRUD: BU
-* centerCRUD: CTR
-* centerTypeCRUD: CT
-* deviceSpecCRUD: DS
-* deviceCRUD: D
-* deviceTypesCRUD: DT
-* documentCategoriesCRUD: DOC
-* documentTypesCRUD: DOCT
-* dynamicFieldCRUD: DF
-* holidaysCRUD: H
-* machineSpecCRUD: MS
-* machineCRUD: M
-* machineTypesCRUD: MT
-* templateCRUD: T
-
+*
+"1AdminAuthPolicyTest.class": "groups = AP, dependsOnGroups = PG ,
+"2AdminDataSharePolicyTest.class":"groups = DSP, dependsOnGroups = AP,
+"3AdminDeviceDetailsTest.class":"groups = DD, dependsOnGroups = SD,AP
+"4AdminFtmDetailsTest.class":"groups = FD, dependsOnGroups = RFTM ",
+"5AdminPartnerPolicyMappingTest.class":"groups = PPM, dependsOnGroups = RAC ",
+"6AdminPolicyGroupTest.class":"groups = PG, dependsOnGroups = UFCC ",
+"7AdminSbiDetailsTest.class":"groups = SD, dependsOnGroups = RSD ",
+"8AdminUploadCaCertTest.class":"groups = UFCC, dependsOnGroups = ",
+"9PartnerLoginAuthCredTest.class":"groups = PLAC, dependsOnGroups = PPM ",
+"10PartnerRegisterAuthCredTest.class":"groups = RAC, dependsOnGroups = UFCC,DSP ",
+"11PartnerRegisterFTMTest.class":"groups = RFTM, dependsOnGroups = UFCC ",
+"12PartnerRegisterSbiDeviceTest.class":"groups = RSD, dependsOnGroups = UFCC,DSP ",
## Execution result and logs
1. Verify the failure in the logs file `\logs\AutomationLogs.log`
-1. Execution results present under test-output folder file `emailable-report.html`
-
+2. Execution results present under test-output folder file `emailable-report.html`
+3. for extent reports find it in `partner-management-portal\pmptest\Reports`
## License
This project is licensed under the terms of [Mozilla Public License 2.0](../LICENSE).
diff --git a/pmptest/Reports/pmp0622175900.html b/pmptest/Reports/pmp0622175900.html
new file mode 100644
index 000000000..7f74d91ae
--- /dev/null
+++ b/pmptest/Reports/pmp0622175900.html
@@ -0,0 +1,1143 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Started
+
Jun 22, 2023 05:59:00 pm
+
+
+
+
+
Ended
+
Jun 22, 2023 06:44:02 pm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pmptest/Screenshots/1686766974064.png b/pmptest/Screenshots/1686766974064.png
new file mode 100644
index 000000000..284eacdc1
Binary files /dev/null and b/pmptest/Screenshots/1686766974064.png differ
diff --git a/pmptest/TestData.json b/pmptest/TestData.json
index 69efb16d3..05205e708 100644
--- a/pmptest/TestData.json
+++ b/pmptest/TestData.json
@@ -1,57 +1,66 @@
{
"identity": {
"BELOW_ARE_KEYWORDS_FOR_HELP": "Below Keys use to put in setExcludedGroups to exclude scenarios eg BL for blocklistedwordsCRUD to ignore this execution",
- "ALL": "AP,DP,SD,DD,FD,PG,PPM",
- "1blocklistedwordsCRUD": "BL",
- "2bulkUploadCRUD": "BU",
- "3centerCRUD": "CTR",
- "4centerTypeCRUD": "CT",
- "5deviceSpecCRUD": "DS",
- "6deviceCRUD": "D",
- "7deviceTypesCRUD": "DT",
- "8documentCategoriesCRUD": "DOC",
- "9documentTypesCRUD": "DOCT",
- "10dynamicFieldCRUD": "DF",
- "11holidaysCRUD": "H",
- "12machineSpecCRUD": "MS",
- "13machineCRUD": "M",
- "14machineTypesCRUD": "MT",
- "15templateCRUD": "T",
+ "ALL": "AP,DSP,DD,FD,PPM,PG,SD,UFCC,PLAC,RAC,RFTM,RSD,API",
+ "1AdminAuthPolicyTest.class": "groups = AP, dependsOnGroups = PG , Parameters = DSP,DD,FD,PPM,SD,PLAC,RAC,RFTM,RSD",
+ "2AdminDataSharePolicyTest.class":"groups = DSP, dependsOnGroups = AP, Parameters= DD,FD,PPM,SD,PLAC,RAC,RFTM,RSD",
+ "3AdminDeviceDetailsTest.class":"groups = DD, dependsOnGroups = SD,AP Parameters= FD,PPM,PLAC,RAC,RFTM ",
+ "4AdminFtmDetailsTest.class":"groups = FD, dependsOnGroups = RFTM ",
+ "5AdminPartnerPolicyMappingTest.class":"groups = PPM, dependsOnGroups = RAC ",
+ "6AdminPolicyGroupTest.class":"groups = PG, dependsOnGroups = UFCC ",
+ "7AdminSbiDetailsTest.class":"groups = SD, dependsOnGroups = RSD ",
+ "8AdminUploadCaCertTest.class":"groups = UFCC, dependsOnGroups = ",
+ "9PartnerLoginAuthCredTest.class":"groups = PLAC, dependsOnGroups = PPM ",
+ "10PartnerRegisterAuthCredTest.class":"groups = RAC, dependsOnGroups = UFCC,DSP ",
+ "11PartnerRegisterFTMTest.class":"groups = RFTM, dependsOnGroups = UFCC ",
+ "12PartnerRegisterSbiDeviceTest.class":"groups = RSD, dependsOnGroups = UFCC,DSP ",
+
+ "Kill Chrome exe": "taskkill /F /IM chrome.exe",
+ "Kill driver exe":"taskkill /F /IM chromedriver.exe",
+
+
"BELOW_ARE_STATIC_KEYWORDS": "We are using this setExcludedGroups to exclude scenarios",
- "setExcludedGroups": "AP,SD,DD,FD,PPM,PG",
+ "setExcludedGroups": "",
"holidayDateCenter": "27/12/2022",
"holidayDate": "12/27/2022",
"loginlang": "eng",
"jsonObjName": "identity",
"bulkwait": "10000",
+ "sbivalidDate":"12/27/2022",
+ "sbiexpiryDate":"12/27/2024",
"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\":\"biometrics\",\"source\":[{\"attribute\":\"registration-client\\/NEW\\/individualBiometrics\",\"filter\":[{\"type\":\"Iris\"}]},{\"attribute\":\"CNIE\\/verification\\/biometrics\",\"filter\":[{\"type\":\"Finger\"}]},{\"attribute\":\"CNIE\\/verification\\/biometrics\",\"filter\":[{\"type\":\"Face\"}]}],\"encrypted\":true,\"format\":\"extraction\"}],\"dataSharePolicies\":{\"typeOfShare\":\"DataShare\",\"validForInMinutes\":\"30\",\"transactionsAllowed\":\"2\",\"encryptionType\":\"PartnerBased\",\"shareDomain\":\"datashare-service\",\"source\":\"PacketManager\"}}",
+ "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",
"langcode": [
{
"language": "tam",
- "value": "தமிழ்"
+ "value": "தமிழ�"
},
{
"language": "kan",
- "value": "ಕನ್ನಡ"
+ "value": "ಕನ�ನಡ"
},
{
"language": "hin",
"value": "hin"
},
+ {
+ "language": "eng1",
+ "value": "English"
+ },
{
"language": "eng",
- "value": "eng"
+ "value": "English"
},
{
"language": "fra",
- "value": "Français"
+ "value": "Français"
},
{
"language": "ara",
- "value": "ara"
+ "value": "Arabic"
}
]
}
diff --git a/pmptest/pom.xml b/pmptest/pom.xml
index 10f7ac449..280fb0565 100644
--- a/pmptest/pom.xml
+++ b/pmptest/pom.xml
@@ -27,39 +27,269 @@
https://github.com/mosip/admin-ui
-
- 11
- 11
-
-
+
+
+ UTF-8
+
+
+ 11
+ 11
+ 3.7.0
+ 3.0.2
+ 3.1.0
+ 2.9
+ 0.8.1
+ 3.2
+ 3.0.1
+ 2.3
+ true
+ 3.7.0.1746
+
+ 2.0.2.RELEASE
+ 2.0.7.RELEASE
+ 5.0.5.RELEASE
+ 2.0.0.RELEASE
+
+ 2.0.7
+ 1.5.20
+ 2.9.2
+
+ 3.6.2
+ 3.7.0
+
+
+
+ 1.2
+ 3.0.0
+ 1.3
+ 2.2
+ 2.0.1.Final
+ 2.2.6
+
+
+ 1.4.197
+ 5.1.46
+ 42.2.2
+ 2.5.0
+ 6.0.12.Final
+
+
+ 1.10.19
+ 1.7.4
+ 2.0.0-beta.5
+
+
+ 1.2.3
+ 1.7.19
+ 2.16.0
+ 1.7.25
+
+
+ 2.9.5
+ 20180130
+ 2.2.10
+ 20180130
+
+
+ 3.6.1
+ 3.7
+ 2.6
+ 1.11
+ 4.3
+ 1.9.2
+ 2.2
+ 4.5.6
+ 19.0
+ 1.18.8
+ 0.1.54
+ 1.4.0
+ 7.1.0
+ 2.0.0
+ 5.5.13
+ 2.3.23
+ 1.7
+ 2.0
+ 1.5.2
+ 2.1.1
+ 1.60
+ 63.1
+ 1.0.0
+ 3.3.3
+ 2.8.1
+ 4.1.0-incubating
+ 1.11.368
+ 0.2.4
+ 2.3.0
+ 3.0.1
+ 1.9.12
+ 0.6.0
+ 2.0.0.AM2
+
+
+
+
+
+
+
+ 0.8.2
+ 2.2
+ 3.2
+ UTF-8
+ 3.7.0
+ 3.0.1
+
+
+ 1.1.6
+ 1.7.19
+ 1.10.19
+
+
+ 1.4.6
+
+
+ 5.0.6.RELEASE
+
+
+ 5.4.2.Final
+
+
+ 2.1.1
+
+
+ 10.13.1.1
+
+
+ 3.4.0
+
+
+ 1.3.5
+
+
+ 0.3.12
+
+
+ 0.3.0
+
+
+ 1.1.2-incubating
+ 1.2.0.1-B1
+ 0.4.7
+ 3.0.0
+ 2.41.2
+ 2.4.0
+ 3.3.9
+ 3.0.7
+ 6.11
+ 1.13
+ pmptest-1.2.1-SNAPSHOT-jar-with-dependencies
+
+
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 3.1.1
+
+
+
+
+
+
+
+ maven-compiler-plugin
+ 3.5.1
+
+
+ 11
+ -Dfile.encoding=UTF-8
+
+
+
+
+ pl.project13.maven
+ git-commit-id-plugin
+ 3.0.1
+
+
+ populate-git-commit-information
+
+ revision
+
+
+ true
+ MM/dd/yyyy HH:mm:ss Z
+ 8
+ true
+ ${project.build.outputDirectory}/git.properties
+
+
+
+
+ ${project.basedir}/.git
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.2.4
+
+
+
+ shade
+
-
- jar-with-dependencies
-
-
-
- true
- io.mosip.test.pmptest.utility.TestRunner
-
-
+ ${fileName}
+
+
+
+
+
+ io.mosip.testrig.adminui.utility.TestRunner
+
+
+
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+
+
+
-
-
- make-assembly
- package
-
- single
-
-
-
-
-
+
+
+
+
+
@@ -87,6 +317,7 @@
+
org.apache.maven.plugins
maven-javadoc-plugin
@@ -102,7 +333,30 @@
none
-
+
+
+ pl.project13.maven
+ git-commit-id-plugin
+ 3.0.1
+
+
+ populate-git-commit-information
+
+ revision
+
+
+ true
+ MM/dd/yyyy HH:mm:ss Z
+ 8
+ true
+ ${project.build.outputDirectory}/git.properties
+
+
+
+
+ ${project.basedir}/.git
+
+
org.apache.maven.plugins
maven-source-plugin
@@ -212,14 +466,28 @@
+
+ io.github.bonigarcia
+ webdrivermanager
+ 5.2.0
+
-
+
+ org.apache.logging.log4j
+ log4j-api
+ 2.11.1
+
org.testng
testng
7.1.0
+
+ com.aventstack
+ extentreports
+ 5.0.9
+
@@ -227,6 +495,95 @@
commons-io
2.6
+
+
+ org.postgresql
+ postgresql
+ 42.6.0
+
+
+ io.minio
+ minio
+ 8.4.3
+
+
+ com.amazonaws
+ aws-java-sdk-s3
+ 1.12.470
+
+
+
+
+ org.hibernate
+ hibernate-core
+ 5.6.7.Final
+
+
+
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+
+ io.rest-assured
+ rest-assured
+ 5.3.0
+
+
+ org.apache.logging.log4j
+ log4j-api
+ 2.11.1
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.2
+
+
+ javax.ws.rs
+ javax.ws.rs-api
+ 2.1.1
+
+
+ org.json
+ json
+ 20230227
+
+
+ org.keycloak
+ keycloak-admin-client
+ 17.0.1
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.4
+
+
+ com.googlecode.json-simple
+ json-simple
+ 1.1.1
+
+
+ org.apache.commons
+ commons-collections4
+ 4.4
+
+
+ commons-lang
+ commons-lang
+ 2.6
+
+
+
+ com.amazonaws
+ aws-java-sdk-s3
+ 1.12.470
+
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminAuthPolicyTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminAuthPolicyTest.java
deleted file mode 100644
index 1ef3240c2..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminAuthPolicyTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.awt.AWTException;
-import java.awt.Robot;
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.awt.event.KeyEvent;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class AdminAuthPolicyTest extends BaseClass {
-
- @Test(groups = {"AP"},dependsOnGroups = "PG")
- public void adminAuthPolicyTest() throws InterruptedException{
-
- Commons.click(driver, By.id("policymenugroup"));
-
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/authpolicy/view']"));
-
- Commons.click(driver, By.xpath("//button[@id='Create Policy']"));
-
- Commons.enter(driver, By.id("name"), "AUTH"+data);
- Commons.enter(driver, By.id("desc"), data);
- Commons.dropdown(driver, By.xpath("//mat-select[@id='policyGroupName']"),data);
-
-
-
- String policyData;
- try {
- policyData = JsonUtil.JsonObjParsing(Commons.getTestData(),"policyData");
- Commons.enter(driver, By.id("policies"), policyData);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("name"), "AUTH"+data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.id("desc"), data+1);
-
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("name"), "AUTH"+data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Activate0"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
-
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminDataSharePolicyTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminDataSharePolicyTest.java
deleted file mode 100644
index 5885c2f78..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminDataSharePolicyTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class AdminDataSharePolicyTest extends BaseClass {
-
- @Test(groups = "DSP",dependsOnGroups = "AP")
- public void adminDataSharePolicyTest() throws InterruptedException {
-
- Commons.click(driver, By.id("policymenugroup"));
-
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/datasharepolicy/view']"));
-
- Commons.click(driver, By.xpath("//button[@id='Create Policy']"));
-
-
- Commons.enter(driver, By.id("name"), "DS"+data);
- Commons.enter(driver, By.id("desc"), data);
- Commons.dropdown(driver, By.xpath("//mat-select[@id='policyGroupName']"),data);
-
- String dataSharepolicyData;
- try {
- dataSharepolicyData = JsonUtil.JsonObjParsing(Commons.getTestData(),"dataSharepolicyData");
- Commons.enter(driver, By.id("policies"), dataSharepolicyData);
- Thread.sleep(500);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("desc"), data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.id("desc"), data+1);
-
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- Commons.filter(driver, By.id("desc"), data+1);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Activate0"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
-
-
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminDeviceDetailsTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminDeviceDetailsTest.java
deleted file mode 100644
index b62a56d9d..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminDeviceDetailsTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class AdminDeviceDetailsTest extends BaseClass {
-
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(AdminDeviceDetailsTest.class);
- @Test(groups = "DD",dataProvider = "data-provider-DEVICE-SBI",dependsOnGroups = {"SD","AP"})
-
- public void adminDeviceDetailsTest(String cer) throws InterruptedException {
-
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
-
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/devicedetails/view']"));
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
-
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Approve0"));
- //Commons.click(driver, By.id("Activate0"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
-
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- //Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
-
-
- Commons.dropdown(driver, By.id("SBIVersion"));
-
- Commons.click(driver, By.xpath("//button[@id='mapSBIVersion']"));
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- /*
- Commons.filter(driver, By.id("make"), data);
-
- Commons.click(driver, By.id("ellipsis-button0"));
-
- Commons.click(driver, By.id("Upload Certificate0"));
-
-
- Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\partner_cert\\",cer);
-
- Commons.filter(driver, By.id("make"), data);
-
- Commons.click(driver, By.id("ellipsis-button0"));
-
- Commons.click(driver, By.id("View Certificate0"));
-
- String cert=Commons.getText(driver,By.xpath("//p"));
- logger.info(cert);
- Commons.click(driver, By.id("confirmmessagepopup"));
- */
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/devicedetails/view']"));
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
-
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Reject0"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminFtmDetailsTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminFtmDetailsTest.java
deleted file mode 100644
index 072d9759f..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminFtmDetailsTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class AdminFtmDetailsTest extends BaseClass {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(AdminFtmDetailsTest.class);
-
- @Test(groups = {"FD"},dataProvider = "data-provider-FTM",dependsOnGroups = "RFTM")
- public void adminFtmDetailsTest(String cer) throws InterruptedException {
-
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/ftmdetails/view']"));
-
-
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.id("model"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
-
- Commons.click(driver, By.id("ellipsis-button0"));
-
- Commons.click(driver, By.id("Upload Certificate0"));
-
-
- Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\ftm_cert\\",cer);
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
-
- Commons.click(driver, By.id("ellipsis-button0"));
-
- Commons.click(driver, By.id("View Certificate0"));
-
- String cert=Commons.getText(driver,By.xpath("//p"));
- logger.info(cert);
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
-
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Activate0"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
-
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Deactivate0"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminPolicyGroupTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminPolicyGroupTest.java
deleted file mode 100644
index b1c3e2ebf..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminPolicyGroupTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.ExtentReportUtil;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class AdminPolicyGroupTest extends BaseClass {
-
- @Test(groups = "PG",dependsOnGroups = "UFCC")
- public void adminPolicyGroupTest() throws InterruptedException {
- ExtentReportUtil.test1 = ExtentReportUtil.reports
- .createTest("PolicyGroupTest : " );
-
-
- Commons.click(driver, By.id("policymenugroup"));
-
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/policygroup/view']"));
- Commons.click(driver, By.xpath("//button[@id='Create Policy Group']"));
-
- Commons.enter(driver, By.id("name"), data);
- Commons.enter(driver, By.id("desc"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
-
- Commons.filter(driver, By.id("name"), data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.id("desc"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
-
- Commons.filter(driver, By.id("name"), data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Deactivate0"));
- Commons.click(driver, By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("name"), data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Activate0"));
- Commons.click(driver, By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- ExtentReportUtil.reports.flush();
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminSbiDetailsTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminSbiDetailsTest.java
deleted file mode 100644
index 8fcfd1e32..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminSbiDetailsTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class AdminSbiDetailsTest extends BaseClass {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(AdminSbiDetailsTest.class);
- @Test(groups = "SD",dataProvider = "data-provider-DEVICE-SBI",dependsOnGroups = "RSD")
- public void adminSbiDetailsTest(String cer) throws Exception {
-
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
-
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/sbidetails/view']"));
-
- //Commons.filter(driver, By.id("swVersion"),By.id("providerId"), data,orgName);
- Commons.filter(driver, By.id("swVersion"),data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Reject0"));
-
-
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("swVersion"),data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("swVersion"),data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Approve0"));
- Commons.click(driver, By.xpath("//button[@id='confirmpopup']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminUploadCaCertTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminUploadCaCertTest.java
deleted file mode 100644
index 509d71c2f..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminUploadCaCertTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.awt.AWTException;
-import org.openqa.selenium.By;
-
-import org.testng.annotations.Test;
-
-
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.ExtentReportUtil;
-import io.mosip.test.pmptest.utility.Reporter;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(value=Reporter.class)
-public class AdminUploadCaCertTest extends BaseClass {
-
- @Test(groups = "UFCC",dataProvider = "data-provider-ca")
- public void adminUploadCaCertTest(String cer) throws InterruptedException, AWTException {
-
-
-
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/uploadcacert/upload']"));
-
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
-
-
-
-
- ExtentReportUtil.test1 = ExtentReportUtil.reports
- .createTest("UploadFtmCaCertTest : " + dropdwnVal );
-
- Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\ca_cert\\",cer);
- ExtentReportUtil.reports.flush();
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerLoginAuthCredTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerLoginAuthCredTest.java
deleted file mode 100644
index d96b2db92..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerLoginAuthCredTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.awt.AWTException;
-import java.io.IOException;
-
-import org.openqa.selenium.By;
-// Generated by Selenium IDE
-import org.testng.annotations.Test;
-import io.mosip.test.pmptest.utility.RegisterBaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.ExtentReportUtil;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class PartnerLoginAuthCredTest extends RegisterBaseClass {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(RealTimeReport.class);
-
- @Test(groups = "PLAC", dataProvider = "data-provider-AUTH" ,dependsOnGroups = {"PPM"})
- public void partnerLoginAuthCredTest(String cer) throws InterruptedException, AWTException{
- //String datetime=Commons.getDateTime();
-
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
- ExtentReportUtil.test1 = ExtentReportUtil.reports
- .createTest("AuthPartnerLogin : " + dropdwnVal + " Orgname : " + orgName);
-
-
-
- driver.findElement(By.id("username")).sendKeys(orgName+data);
- driver.findElement(By.id("password")).sendKeys(orgName+data);
- driver.findElement(By.xpath("//input[@name=\'login\']")).click();
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Generate API Key0"));
-
-
- Commons.enter(driver, By.id("apiKeyLabel"),data);
-
- Commons.click(driver, By.id("generateAPIKey"));
- String key=Commons.getText(driver,By.xpath("//p"));
- logger.info(key);
- Commons.click(driver, By.id("confirmmessagepopup"));
- ExtentReportUtil.capture();
- try {
- ExtentReportUtil.test1.addScreenCaptureFromPath(ExtentReportUtil.capture());
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- ExtentReportUtil.reports.flush();
-
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterAuthCredTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterAuthCredTest.java
deleted file mode 100644
index 03fbf1a4e..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterAuthCredTest.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.awt.AWTException;
-import java.awt.Robot;
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.awt.event.KeyEvent;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.Select;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RegisterBaseClass;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class PartnerRegisterAuthCredTest extends RegisterBaseClass {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(PartnerRegisterAuthCredTest.class);
- @Test(groups = "RAC",dataProvider = "data-provider-AUTH" , dependsOnGroups = {"UFCC","DSP"})
- public void partnerRegisterAuthCredTest(String cer) throws InterruptedException, AWTException{
- String datetime=Commons.getDateTime();
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
- Commons.click(driver, By.xpath("//a[contains(text(),'Register')]"));
- Commons.enter(driver, By.id("firstName"), datetime);
- Commons.enter(driver, By.id("lastName"), datetime);
- try {
- Commons.enter(driver, By.id("organizationName"), orgName);
- Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
-
- if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
- { select.selectByValue(dropdwnVal+"_PROVIDER");
- }
- else {
- select.selectByValue(dropdwnVal+"_PARTNER");
- }
-
-
- Commons.enter(driver, By.id("address"), data);
- Commons.enter(driver, By.id("email"), datetime+"@automationlabs.com");
- Commons.enter(driver, By.id("phoneNumber"), "9178338765");
- Commons.selOption(driver, By.id("user.attributes.langCode"), "English");
-
-
- Commons.enter(driver, By.id("username"),orgName+data);
- Commons.enter(driver, By.id("password"), orgName+data);
- Commons.enter(driver, By.id("password-confirm"),orgName+data);
-
- Commons.click(driver, By.xpath("//input[@type='submit']"));
-
- if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
- {Commons.dropdown(driver, By.id("mat-select-0"),data);
- Commons.click(driver, By.id("applyTxt"));
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.id("/pmp/home"));
- }
-
- Commons.click(driver, By.id("uploadCertificate"));
-
- if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\auth_cert\\",cer);
- else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\auth_cert\\",cer);
-
-
- Commons.click(driver, By.id("viewCertificate"));
-
-
- String certificate=Commons.getText(driver,By.xpath("//p"));
- logger.info(certificate);
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- switch(dropdwnVal) {
- case "DEVICE":
- Commons.click(driver, By.id("/pmp/resources/devicedetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("deviceProviderId"),orgName);
- Commons.dropdown(driver, By.id("deviceTypeCode"),By.id("Face"));
-
- Commons.dropdown(driver, By.id("deviceSubTypeCode"),By.id("Full face"));
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-// SBI View
-
- Commons.click(driver, By.id("/pmp/resources/sbidetails/view"));
- Commons.click(driver, By.xpath("//button[@id='Create SBI']"));
-
- Commons.dropdown(driver, By.id("providerId"),orgName);
-
- Commons.enter(driver, By.xpath("//input[@id='swVersion']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
- Commons.enter(driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- Commons.filter(driver, By.id("swVersion"),data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- break;
- case "FTM":
- Commons.click(driver, By.id("/pmp/resources/ftmdetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("ftpProviderId"),orgName);
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-break;
-
-
- case "AUTH":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"AUTH"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-break;
-
- case "CREDENTIAL":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"DS"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-
-
-break;
-
- }
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterFTMTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterFTMTest.java
deleted file mode 100644
index 77141da55..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterFTMTest.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.awt.AWTException;
-import java.awt.Robot;
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.awt.event.KeyEvent;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.Select;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RegisterBaseClass;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class PartnerRegisterFTMTest extends RegisterBaseClass {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(PartnerRegisterFTMTest.class);
- @Test(groups = {"RFTM"},dataProvider = "data-provider-FTM" , dependsOnGroups = {"UFCC"})
- public void partnerRegisterFTMTest(String cer) throws InterruptedException, AWTException{
- String datetime=Commons.getDateTime();
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
- Commons.click(driver, By.xpath("//a[contains(text(),'Register')]"));
- Commons.enter(driver, By.id("firstName"), datetime);
- Commons.enter(driver, By.id("lastName"), datetime);
- try {
- Commons.enter(driver, By.id("organizationName"), orgName);
- Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
-
- if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
- { select.selectByValue(dropdwnVal+"_PROVIDER");
- }
- else {
- select.selectByValue(dropdwnVal+"_PARTNER");
- }
-
-
- Commons.enter(driver, By.id("address"), data);
- Commons.enter(driver, By.id("email"), datetime+"@automationlabs.com");
- Commons.enter(driver, By.id("phoneNumber"), "9178338765");
- Commons.selOption(driver, By.id("user.attributes.langCode"), "English");
-
-
- Commons.enter(driver, By.id("username"),orgName+data);
- Commons.enter(driver, By.id("password"), orgName+data);
- Commons.enter(driver, By.id("password-confirm"),orgName+data);
-
- Commons.click(driver, By.xpath("//input[@type='submit']"));
-
- if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
- {Commons.dropdown(driver, By.id("mat-select-0"),data);
- Commons.click(driver, By.id("applyTxt"));
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.id("/pmp/home"));
- }
-
- Commons.click(driver, By.id("uploadCertificate"));
-
- if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\auth_cert\\",cer);
- else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\ftm_cert\\",cer);
-
-
- Commons.click(driver, By.id("viewCertificate"));
-
-
- String certificate=Commons.getText(driver,By.xpath("//p"));
- logger.info(certificate);
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- switch(dropdwnVal) {
- case "DEVICE":
- Commons.click(driver, By.id("/pmp/resources/devicedetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("deviceProviderId"),orgName);
- Commons.dropdown(driver, By.id("deviceTypeCode"),By.id("Face"));
-
- Commons.dropdown(driver, By.id("deviceSubTypeCode"),By.id("Full face"));
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-// SBI View
-
- Commons.click(driver, By.id("/pmp/resources/sbidetails/view"));
- Commons.click(driver, By.xpath("//button[@id='Create SBI']"));
-
- Commons.dropdown(driver, By.id("providerId"),orgName);
-
- Commons.enter(driver, By.xpath("//input[@id='swVersion']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
- Commons.enter(driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- Commons.filter(driver, By.id("swVersion"),data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- break;
- case "FTM":
- Commons.click(driver, By.id("/pmp/resources/ftmdetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("ftpProviderId"),orgName);
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-break;
-
-
- case "AUTH":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"AUTH"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-break;
-
- case "CREDENTIAL":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"DS"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-
-
-break;
-
- }
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterSbiDeviceTest.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterSbiDeviceTest.java
deleted file mode 100644
index f764d74e2..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/PartnerRegisterSbiDeviceTest.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.awt.AWTException;
-import java.awt.Robot;
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.awt.event.KeyEvent;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.Select;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RegisterBaseClass;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class PartnerRegisterSbiDeviceTest extends RegisterBaseClass {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(PartnerRegisterSbiDeviceTest.class);
- @Test(groups = "RSD",dataProvider = "data-provider-DEVICE-SBI" , dependsOnGroups = {"UFCC","DSP"})
- public void partnerRegisterSbiDeviceTest(String cer) throws InterruptedException, AWTException{
- String datetime=Commons.getDateTime();
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
- Commons.click(driver, By.xpath("//a[contains(text(),'Register')]"));
- Commons.enter(driver, By.id("firstName"), datetime);
- Commons.enter(driver, By.id("lastName"), datetime);
- try {
- Commons.enter(driver, By.id("organizationName"), orgName);
- Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
-
- if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
- { select.selectByValue(dropdwnVal+"_PROVIDER");
- }
- else {
- select.selectByValue(dropdwnVal+"_PARTNER");
- }
-
-
- Commons.enter(driver, By.id("address"), data);
- Commons.enter(driver, By.id("email"), datetime+"@automationlabs.com");
- Commons.enter(driver, By.id("phoneNumber"), "9178338765");
- Commons.selOption(driver, By.id("user.attributes.langCode"), "English");
-
-
- Commons.enter(driver, By.id("username"),orgName+data);
- Commons.enter(driver, By.id("password"), orgName+data);
- Commons.enter(driver, By.id("password-confirm"),orgName+data);
-
- Commons.click(driver, By.xpath("//input[@type='submit']"));
-
- if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
- {Commons.dropdown(driver, By.id("mat-select-0"),data);
- Commons.click(driver, By.id("applyTxt"));
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.id("/pmp/home"));
- }
-
- Commons.click(driver, By.id("uploadCertificate"));
-
- if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\auth_cert\\",cer);
- else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\device_sbi_cert\\",cer);
-
-
- Commons.click(driver, By.id("viewCertificate"));
-
-
- String certificate=Commons.getText(driver,By.xpath("//p"));
- logger.info(certificate);
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- switch(dropdwnVal) {
- case "DEVICE":
- Commons.click(driver, By.id("/pmp/resources/devicedetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("deviceProviderId"),orgName);
- Commons.dropdown(driver, By.id("deviceTypeCode"),By.id("Face"));
-
- Commons.dropdown(driver, By.id("deviceSubTypeCode"),By.id("Full face"));
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-// SBI View
-
- Commons.click(driver, By.id("/pmp/resources/sbidetails/view"));
- Commons.click(driver, By.xpath("//button[@id='Create SBI']"));
-
- Commons.dropdown(driver, By.id("providerId"),orgName);
-
- Commons.enter(driver, By.xpath("//input[@id='swVersion']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
- Commons.enter(driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- Commons.filter(driver, By.id("swVersion"),data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- break;
- case "FTM":
- Commons.click(driver, By.id("/pmp/resources/ftmdetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("ftpProviderId"),orgName);
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-break;
-
-
- case "AUTH":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"AUTH"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-break;
-
- case "CREDENTIAL":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"DS"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-
-
-break;
-
- }
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/TBD.java b/pmptest/src/main/java/io/mosip/test/pmptest/testcase/TBD.java
deleted file mode 100644
index 2e736b83a..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/TBD.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package io.mosip.test.pmptest.testcase;
-
-import java.awt.AWTException;
-import java.awt.Robot;
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.awt.event.KeyEvent;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Dimension;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.Select;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-// Generated by Selenium IDE
-//import org.junit.Test;
-//import org.junit.Before;
-//import org.junit.After;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.JsonUtil;
-import io.mosip.test.pmptest.utility.RegisterBaseClass;
-import io.mosip.test.pmptest.utility.RealTimeReport;
-import org.testng.annotations.Listeners;
-
-@Listeners(RealTimeReport.class)
-public class TBD extends RegisterBaseClass {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(TBD.class);
- @Test(groups = "R",dataProvider = "data-provider-partner" , dependsOnGroups = {"UFCC","DSP"})
- public void registerCRUD(String cer) throws InterruptedException, AWTException{
- String datetime=Commons.getDateTime();
- String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
- String orgName=cer.substring(0, cer.length()-4);
-
- Commons.click(driver, By.xpath("//a[contains(text(),'Register')]"));
- Commons.enter(driver, By.id("firstName"), datetime);
- Commons.enter(driver, By.id("lastName"), datetime);
- try {
- Commons.enter(driver, By.id("organizationName"), orgName);
- Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
-
- if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
- { select.selectByValue(dropdwnVal+"_PROVIDER");
- }
- else {
- select.selectByValue(dropdwnVal+"_PARTNER");
- }
-
-
- Commons.enter(driver, By.id("address"), data);
- Commons.enter(driver, By.id("email"), datetime+"@automationlabs.com");
- Commons.enter(driver, By.id("phoneNumber"), "9178338765");
- Commons.selOption(driver, By.id("user.attributes.langCode"), "English");
-
-
- Commons.enter(driver, By.id("username"),orgName+data);
- Commons.enter(driver, By.id("password"), orgName+data);
- Commons.enter(driver, By.id("password-confirm"),orgName+data);
-
- Commons.click(driver, By.xpath("//input[@type='submit']"));
-
- if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
- {Commons.dropdown(driver, By.id("mat-select-0"),data);
- Commons.click(driver, By.id("applyTxt"));
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.id("/pmp/home"));
- }
-
- Commons.click(driver, By.id("uploadCertificate"));
-
- if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\partner_cert\\",cer);
- else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\partner_cert\\",cer);
-
-
- Commons.click(driver, By.id("viewCertificate"));
-
-
- String certificate=Commons.getText(driver,By.xpath("//p"));
- logger.info(certificate);
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- switch(dropdwnVal) {
- case "DEVICE":
- Commons.click(driver, By.id("/pmp/resources/devicedetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("deviceProviderId"),orgName);
- Commons.dropdown(driver, By.id("deviceTypeCode"),By.id("Face"));
-
- Commons.dropdown(driver, By.id("deviceSubTypeCode"),By.id("Full face"));
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-// SBI View
-
- Commons.click(driver, By.id("/pmp/resources/sbidetails/view"));
- Commons.click(driver, By.xpath("//button[@id='Create SBI']"));
-
- Commons.dropdown(driver, By.id("providerId"),orgName);
-
- Commons.enter(driver, By.xpath("//input[@id='swVersion']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data);
- Commons.enter(driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
- Commons.enter(driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- Commons.filter(driver, By.id("swVersion"),data);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
-
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
- break;
- case "FTM":
- Commons.click(driver, By.id("/pmp/resources/ftmdetails/view"));
-
-
- Commons.click(driver, By.id("Create Device"));
- Commons.dropdown(driver, By.id("ftpProviderId"),orgName);
- Commons.enter(driver, By.xpath("//input[@id='make']"), data);
- Commons.enter(driver, By.xpath("//input[@id='model']"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.id("confirmmessagepopup"));
-
-
- Commons.filter(driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
- Commons.enter(driver, By.xpath("//input[@id='model']"), data + 1);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-break;
-
-
- case "AUTH":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"AUTH"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-break;
-
- case "CREDENTIAL":
-
-
- Commons.click(driver, By.id("/pmp/resources/policymapping/view"));
- Commons.click(driver, By.xpath("//button[@id='Map Policy']"));
- Commons.dropdown(driver, By.id("partnerId"),orgName);
- Commons.dropdown(driver, By.id("policyId"),"DS"+data);
- Commons.enter(driver, By.id("requestDetail"), data);
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
-
- Commons.click(driver, By.xpath("//button[@id='confirmmessagepopup']"));
-
-
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
-
-
-
-break;
-
- }
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/Commons.java b/pmptest/src/main/java/io/mosip/test/pmptest/utility/Commons.java
deleted file mode 100644
index 8f8ecbdb2..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/Commons.java
+++ /dev/null
@@ -1,422 +0,0 @@
-package io.mosip.test.pmptest.utility;
-
-import java.awt.AWTException;
-import java.awt.Robot;
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.awt.event.KeyEvent;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.TimeoutException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.testng.Assert;
-
-public class Commons {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(Commons.class);
-
- public static String appendDate="a"+getDateTime();
-
- public static String getDateTime()
- {
-
-
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MMddHHmmss");
- LocalDateTime now = LocalDateTime.now();
- return dtf.format(now);
- }
-
- public static String getUnique()
- {
-
-
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MMddHHmm");
- LocalDateTime now = LocalDateTime.now();
- return dtf.format(now);
- }
-
- public static void filter(WebDriver driver, By by,String data) {
- logger.info("Inside Filter " + by + data);
- Commons.click(driver, By.id("Filter"));
-
- Commons.enter(driver, by, data);
- Commons.click(driver, By.id("applyTxt"));
- }
-
- public static void filter(WebDriver driver, By by1,By by2,String data1,String data2) {
- logger.info("Inside Filter " + by1 + data1);
- logger.info("Inside Filter " + by2 + data2);
- Commons.click(driver, By.id("Filter"));
-
- Commons.enter(driver, by1, data1);
-
- Commons.enter(driver, by2, data2);
- Commons.click(driver, By.id("applyTxt"));
- }
-
- public static void filterCenter(WebDriver driver, By by,String data) {
- logger.info("Inside filterCenter " + by + data);
- Commons.click(driver, By.id("Filter"));
-
- Commons.dropdowncenter(driver, by, data);
-
- Commons.click(driver, By.id("applyTxt"));
- }
- public static void click(WebDriver driver, By by) {
- logger.info("Clicking " + by );
- try {
- (new WebDriverWait(driver, 20)).until(ExpectedConditions.elementToBeClickable(by));
- Thread.sleep(500);
- driver.findElement(by).click();
- Thread.sleep(500);
- }catch (StaleElementReferenceException sere) {
- // simply retry finding the element in the refreshed DOM
- driver.findElement(by).click();
- }
- catch (TimeoutException toe) {
- driver.findElement(by).click();
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- System.out.println( "Element identified by " + by.toString() + " was not clickable after 20 seconds");
- } catch (Exception e) {
-
- JavascriptExecutor executor = (JavascriptExecutor) driver;
- executor.executeScript("arguments[0].click();", driver.findElement(by));
-
- }}
-
-
- public static void enter(WebDriver driver, By by,String value) {
- logger.info("Entering " + by +value);
- //value="10";
- try {
- (new WebDriverWait(driver, 20)).until(ExpectedConditions.visibilityOfElementLocated(by));
- driver.findElement(by).clear();
- driver.findElement(by).sendKeys(value);
- try {
- Thread.sleep(8);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }catch (StaleElementReferenceException sere) {
- // simply retry finding the element in the refreshed DOM
- driver.findElement(by).clear();
- driver.findElement(by).sendKeys(value);
- }
- catch (TimeoutException toe) {
- driver.findElement(by).clear();
- driver.findElement(by).sendKeys(value);
- System.out.println( "Element identified by " + by.toString() + " was not clickable after 20 seconds");
- } }
-
- public static void dropdown(WebDriver driver, By by)
- {
- logger.info("Selecting DropDown Index Zero Value " + by );
-
- try {
- Thread.sleep(500);
- click(driver,by);//REGION
- Thread.sleep(500);
-
- String att= driver.findElement(by).getAttribute("aria-owns");
- String[] list=att.split(" ");
- click( driver,By.id(list[0]));
- try {
- Thread.sleep(50);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }catch(Exception e)
-
- {
- e.getMessage();
- }
- }
-
- public static void dropdown(WebDriver driver, By by,String value)
- {
- logger.info("Selecting DropDown By Value " + by +value );
-
- try {
- Thread.sleep(50);
- click(driver,by);
- Thread.sleep(50);
- String val="'"+value +"'";
-
- click( driver,By.xpath("//span[contains(text(),"+val+")]"));
- try {
- Thread.sleep(50);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }catch(Exception e)
-
- {
- e.getMessage();
- }
- }
- //option[@value,'FTM_PROVIDER']
-
- public static void selOption(WebDriver driver, By by,String value)
- {
- logger.info("Selecting DropDown By Value " + by +value );
-
- try {
- Thread.sleep(50);
- click(driver,by);
- Thread.sleep(50);
- String val="'"+value +"'";
- //select/option[contains(text(),'FTM Provider')]
- String xpath="//select/option[contains(text(),"+val+"]";
- clickAction( driver,By.xpath(xpath));
- try {
- Thread.sleep(50);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }catch(Exception e)
-
- {
- e.getMessage();
- }
- }
-
-
- public static void dropdowncenter(WebDriver driver, By by,String value)
- {
- logger.info("Selecting DropDown By Value " + by +value );
-
- try {
- Thread.sleep(50);
- click(driver,by);
- Thread.sleep(50);
- String val="'"+value +"'";
-
- click( driver,By.id(value));
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }catch(Exception e)
-
- {
- e.getMessage();
- }
- }
-
- public static void dropdown(WebDriver driver, By by,By value)
- {
- logger.info("Selecting DropDown By Value " + by +value );
- try {
- Thread.sleep(50);
- click(driver,by);
- Thread.sleep(50);
- click( driver,value);
-
- Thread.sleep(500);
-
- }catch(Exception e)
-
- {
- e.getMessage();
- }
- }
- public static String getTestData()
- {
- return JsonUtil.readJsonFileText("TestData.json");
- }
-
-
-
- public static String getJsonData()
- {
- return JsonUtil.readJsonFileText("PolicyData.json");
- }
-
-
-
- public static String getFieldData(String idfield) throws Exception
- {
- return JsonUtil.JsonObjSimpleParsing(getTestData(), idfield);
-
- }
-
- public static void clickSpan(WebDriver driver,String key) throws Exception {
-
- String val=Commons.getFieldData(key);
- String var="//span[contains(text(),'"+ val+ "')]";
- Commons.click(driver,By.xpath(var));
- logger.info("clickSpan" + var );
- }
-
- public static void deactivate(WebDriver driver) {
- Commons.click(driver,By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Deactivate0"));
-
- Commons.click(driver,By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
- logger.info("Click deactivate and Confirm");
- }
-
- public static void activate(WebDriver driver) {
- Commons.click(driver,By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Activate0"));
-
- Commons.click(driver,By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
- logger.info("Click activate and Confirm");
- }
-
- public static void edit(WebDriver driver,String data,By by) {
- Commons.click(driver,By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
-
- Assert.assertNotEquals(data,
- driver.findElement(by).getText());
- driver.findElement(by).clear();
-
- Commons.enter(driver, by, data);
-
- Commons.click(driver, By.id("createButton"));
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- logger.info("Click Edit and Confirm" + by + data);
- }
-
- public static void editRes(WebDriver driver,String data,By by) {
- Commons.click(driver,By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
-
- Assert.assertNotEquals(data,
- driver.findElement(by).getText());
- driver.findElement(by).clear();
-
- Commons.enter(driver, by, data);
-
- Commons.click(driver, By.id("createButton"));
-
- Commons.click(driver,By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- logger.info("Click Edit and Confirm" + by + data);
- }
- public static void editCenter(WebDriver driver,String data,By by) {
- Commons.click(driver,By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Edit0"));
-
- Assert.assertNotEquals(data,
- driver.findElement(by).getText());
- driver.findElement(by).clear();
-
- Commons.enter(driver, by, data);
-
- Commons.click(driver, By.xpath("(//*[@id='createButton'])[1]"));
-
- Commons.click(driver,By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- Commons.click(driver, By.xpath("(//*[@id='cancel'])[1]"));
- Commons.click(driver, By.xpath("(//*[@id='cancel'])[1]"));
- logger.info("Click editCenter and Confirm" + by + data);
- }
-
- public static void create(WebDriver driver) {
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver, By.id("confirmmessagepopup"));
-
- logger.info("Click create");
- }
- public static void createRes(WebDriver driver) {
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- Commons.click(driver, By.xpath("//button[@id='createButton']"));
- Commons.click(driver,By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
- logger.info("Click and confirm");
- }
-
- public static void decommission(WebDriver driver) {
- Commons.click(driver,By.id("ellipsis-button0"));
- Commons.click(driver,By.id("Decommission0"));
-
- Commons.click(driver,By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
- logger.info("Click decommission and confirm");
- }
-
- public static void clickAction(WebDriver driver, By by) {
- Actions action = new Actions(driver);
- WebElement we=driver.findElement(by);
- action.moveToElement(we).click().perform();
-
- }
-
-
-
-
- public static String getText(WebDriver driver, By by) {
- String str=driver.findElement(by).getText();
- return str;
- }
-
- public static void uploadPartnerCert(WebDriver driver, By by,String orgName,String folder,String str) {
- // TODO Auto-generated method stub
-
- Commons.dropdown(driver, by, By.id(orgName)
- );
-try {
- Thread.sleep(5000);
-} catch (InterruptedException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
-}
- Commons.clickAction(driver, By.xpath("//*[@type='button']"));
-
- String filePath=null;;
- try {
- filePath = System.getProperty("user.dir") + folder+str ;
- } catch (Exception e) {
-
- // TODO Auto-generated catch block;
- e.printStackTrace();
- }
- StringSelection ss = new StringSelection(filePath);
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
- Robot robot;
- try {
- robot = new Robot();
- robot.delay(250);
- robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER);
- robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_V);
- robot.keyRelease(KeyEvent.VK_V); robot.delay(250);
- robot.keyRelease(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_ENTER);
- robot.delay(250); robot.keyRelease(KeyEvent.VK_ENTER); robot.delay(250);
- Commons.click(driver, By.id("createButton"));
- Commons.click(driver, By.id("confirmmessagepopup"));
- } catch (AWTException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/ExtentReportUtil.java b/pmptest/src/main/java/io/mosip/test/pmptest/utility/ExtentReportUtil.java
deleted file mode 100644
index d867f6f9b..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/ExtentReportUtil.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package io.mosip.test.pmptest.utility;
-
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-
-import javax.imageio.ImageIO;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import java.awt.Dimension;
-import java.awt.Rectangle;
-import java.awt.Robot;
-import java.awt.Toolkit;
-
-
-import com.aventstack.extentreports.ExtentReports;
-import com.aventstack.extentreports.ExtentTest;
-import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
-
-public class ExtentReportUtil {
- private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(ExtentReportUtil.class);
-
- public static Path REPORTPATH = Paths.get(System.getProperty("user.dir"), "report",
- "extentReport" + DateUtil.getDateTime() + ".html");
-
- public static ExtentHtmlReporter htmlReporter;
- public static ExtentReports reports;
- public static ExtentTest test1, test2, test3, test4, test5, test6, test7;
- public static ExtentTest step1, step2, step3, step4, step5, step6, step7, step8, step9;
-
- public static void ExtentSetting() {
- htmlReporter = new ExtentHtmlReporter(REPORTPATH.toString());
-
- reports = new ExtentReports();
- reports.attachReporter(htmlReporter);
-
- }
-
- public static String capture() {
- String snapshotpath = null;
- try {
- Robot rb = new Robot();
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-
- Rectangle rec = new Rectangle(0, 0, screenSize.width, screenSize.height);
- BufferedImage image = rb.createScreenCapture(rec);
- // Image myImage=SwingFXUtils.toFXImage(image, null);
-
- Path SNAPSHOTPATH = Paths.get(System.getProperty("user.dir"), "snapshot",
- "snapshot" + DateUtil.getDateTime() + ".jpg");
- snapshotpath = SNAPSHOTPATH.toString();
- ImageIO.write(image, "jpg", new File(snapshotpath));
-
- } catch (Exception e) {
- logger.error("", e);
-
- }
- return snapshotpath;
-
- }
-
-}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/Reporter.java b/pmptest/src/main/java/io/mosip/test/pmptest/utility/Reporter.java
deleted file mode 100644
index f34dda51f..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/Reporter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package io.mosip.test.pmptest.utility;
-
-
-import java.util.Collection;
-
-import java.util.Date;
-
-import java.util.List;
-
-import java.util.Map;
-
-import java.util.Set;
-
-import org.testng.IReporter;
-
-import org.testng.IResultMap;
-
-import org.testng.ISuite;
-
-import org.testng.ISuiteResult;
-
-import org.testng.ITestContext;
-
-import org.testng.ITestNGMethod;
-
-import org.testng.xml.XmlSuite;
-
-public class Reporter implements IReporter{
-
- @Override
-
- public void generateReport(List arg0, List arg1,
-
- String outputDirectory) {
-
- // Second parameter of this method ISuite will contain all the suite executed.
-
- for (ISuite iSuite : arg1) {
-
- //Get a map of result of a single suite at a time
-
- Map results = iSuite.getResults();
-
- //Get the key of the result map
-
- Set keys = results.keySet();
-
- //Go to each map value one by one
-
- for (String key : keys) {
-
- //The Context object of current result
-
- ITestContext context = results.get(key).getTestContext();
-
- //Print Suite detail in Console
-
- System.out.println("Suite Name->"+context.getName()
-
- + "::Report output Ditectory->"+context.getOutputDirectory()
-
- +"::Suite Name->"+ context.getSuite().getName()
-
- +"::Start Date Time for execution->"+context.getStartDate()
-
- +"::End Date Time for execution->"+context.getEndDate());
-
-
-
- //Get Map for only failed test cases
-
- IResultMap resultMap = context.getFailedTests();
-
- //Get method detail of failed test cases
-
- Collection failedMethods = resultMap.getAllMethods();
-
- //Loop one by one in all failed methods
-
- System.out.println("--------FAILED TEST CASE---------");
-
- for (ITestNGMethod iTestNGMethod : failedMethods) {
-
- //Print failed test cases detail
-
- System.out.println("TESTCASE NAME->"+iTestNGMethod.getMethodName()
-
- +"\nDescription->"+iTestNGMethod.getDescription()
-
- +"\nPriority->"+iTestNGMethod.getPriority()
-
- +"\n:Date->"+new Date(iTestNGMethod.getDate()));
-
-
-
- }
-
- }
-
- }
-
-
-
- }
-
-}
\ No newline at end of file
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/TestRunner.java b/pmptest/src/main/java/io/mosip/test/pmptest/utility/TestRunner.java
deleted file mode 100644
index 7b898a60d..000000000
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/TestRunner.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package io.mosip.test.pmptest.utility;
-
-import java.util.List;
-
-import org.testng.TestListenerAdapter;
-import org.testng.TestNG;
-
-import io.mosip.test.pmptest.testcase.PartnerLoginAuthCredTest;
-import io.mosip.test.pmptest.testcase.PartnerRegisterAuthCredTest;
-import io.mosip.test.pmptest.testcase.PartnerRegisterFTMTest;
-import io.mosip.test.pmptest.testcase.PartnerRegisterSbiDeviceTest;
-import io.mosip.test.pmptest.testcase.AdminAuthPolicyTest;
-import io.mosip.test.pmptest.testcase.AdminDataSharePolicyTest;
-import io.mosip.test.pmptest.testcase.AdminDeviceDetailsTest;
-import io.mosip.test.pmptest.testcase.AdminFtmDetailsTest;
-import io.mosip.test.pmptest.testcase.AdminPartnerPolicyMappingTest;
-import io.mosip.test.pmptest.testcase.AdminPolicyGroupTest;
-import io.mosip.test.pmptest.testcase.TBD;
-import io.mosip.test.pmptest.testcase.apicall;
-import io.mosip.test.pmptest.testcase.AdminSbiDetailsTest;
-import io.mosip.test.pmptest.testcase.AdminUploadCaCertTest;
-
-
-public class TestRunner {
- static TestListenerAdapter tla = new TestListenerAdapter();
-
-
- static TestNG testNg;
-
- public static void main(String[] args) throws Exception {
-
- testNg=new TestNG();
-
- String listExcludedGroups=JsonUtil.JsonObjParsing(Commons.getTestData(),"setExcludedGroups");
- testNg.setExcludedGroups(listExcludedGroups);
- //testNg.setPreserveOrder(true);
- testNg.setTestClasses(new Class[] {
- AdminAuthPolicyTest.class,
- AdminDataSharePolicyTest.class,
- AdminDeviceDetailsTest.class,
- AdminFtmDetailsTest.class,
- AdminPartnerPolicyMappingTest.class,
- AdminPolicyGroupTest.class,
- AdminSbiDetailsTest.class,
- AdminUploadCaCertTest.class,
- PartnerLoginAuthCredTest.class,
- PartnerRegisterAuthCredTest.class,
- PartnerRegisterFTMTest.class,
- PartnerRegisterSbiDeviceTest.class,apicall.class
-
- });
- testNg.run();
-
- }
-
-
-}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/authentication/fw/precon/JsonPrecondtion.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/authentication/fw/precon/JsonPrecondtion.java
new file mode 100644
index 000000000..6364ae23e
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/authentication/fw/precon/JsonPrecondtion.java
@@ -0,0 +1,23 @@
+package io.mosip.testrig.pmpui.authentication.fw.precon;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.log4j.Logger;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class JsonPrecondtion {
+ private static final Logger JSONPRECONDATION_LOGGER = Logger.getLogger(JsonPrecondtion.class);
+
+
+ public static String getValueFromJson(String jsonContent, String fieldMapper) {
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+ Object jsonObj = mapper.readValue(jsonContent, Object.class);
+ return PropertyUtils.getProperty(jsonObj, fieldMapper).toString();
+ } catch (Exception expection) {
+ JSONPRECONDATION_LOGGER
+ .error("Exception Occured in retrieving the value from json file: " + expection.getMessage());
+ return "Cannot retrieve data or content for the object mapper from JSON";
+ }
+ }
+}
\ No newline at end of file
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/authentication/fw/util/RestClient.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/authentication/fw/util/RestClient.java
new file mode 100644
index 000000000..acabba8fc
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/authentication/fw/util/RestClient.java
@@ -0,0 +1,63 @@
+package io.mosip.testrig.pmpui.authentication.fw.util;
+
+import static io.restassured.RestAssured.given;
+
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+
+import io.restassured.RestAssured;
+import io.restassured.config.HttpClientConfig;
+import io.restassured.config.RestAssuredConfig;
+import io.restassured.response.Response;
+
+public class RestClient {
+
+ private static final Logger RESTCLIENT_LOGGER = Logger.getLogger(RestClient.class);
+ private static RestAssuredConfig config = RestAssured.config()
+ .httpClient(HttpClientConfig.httpClientConfig().setParam("http.connection.timeout", 500000)
+ .setParam("http.socket.timeout", 500000).setParam("http.connection-manager.timeout", 500000));
+
+
+
+
+ public static Response getRequest(String url, String contentHeader, String acceptHeader) {
+ RESTCLIENT_LOGGER.info("RESSURED: Sending a GET request to " + url);
+ Response getResponse = given().config(config).relaxedHTTPSValidation().log().all().when().get(url).then().log()
+ .all().extract().response();
+ RESTCLIENT_LOGGER.info("REST-ASSURED: The response from the request is: " + getResponse.asString());
+ RESTCLIENT_LOGGER.info("REST-ASSURED: The response Time is: " + getResponse.time());
+ return getResponse;
+ }
+
+ public static Response getRequestWithCookie(String url, String contentHeader, String acceptHeader,
+ String cookieName, String cookieValue) {
+ RESTCLIENT_LOGGER.info("REST-ASSURED: Sending a GET request to " + url);
+ Response getResponse = given().config(config).relaxedHTTPSValidation().cookie(cookieName, cookieValue).log()
+ .all().when().get(url).then().log().all().extract().response();
+ RESTCLIENT_LOGGER.info("REST-ASSURED: The response from the request is: " + getResponse.asString());
+ RESTCLIENT_LOGGER.info("REST-ASSURED: The response Time is: " + getResponse.time());
+ return getResponse;
+ }
+
+ public static Response postRequestWithCookie(String url, Object body, String contentHeader, String acceptHeader,
+ String cookieName, String cookieValue) {
+ RESTCLIENT_LOGGER.info("REST-ASSURED: Sending a POST request to " + url);
+ Response postResponse = given().config(config).relaxedHTTPSValidation().body(body).contentType(contentHeader)
+ .cookie(cookieName, cookieValue).accept(acceptHeader).log().all().when().post(url).then().log().all()
+ .extract().response();
+ RESTCLIENT_LOGGER.info("REST-ASSURED: The response from the request is: " + postResponse.asString());
+ RESTCLIENT_LOGGER.info("REST-ASSURED: The response Time is: " + postResponse.time());
+ return postResponse;
+ }
+ public static Response patchRequestWithCookieAndQueryParm(String url, HashMap body,
+ String contentHeader, String acceptHeader, String cookieName, String cookieValue) {
+ RESTCLIENT_LOGGER.info("REST-ASSURED: Sending a PATCH request to " + url);
+ Response postResponse = given().config(config).relaxedHTTPSValidation().queryParams(body)
+ .contentType(contentHeader).cookie(cookieName, cookieValue).accept(acceptHeader).log().all().when()
+ .patch(url).then().log().all().extract().response();
+ RESTCLIENT_LOGGER.info(postResponse.asString());
+ RESTCLIENT_LOGGER.info(postResponse.time());
+ return postResponse;
+ }
+}
\ No newline at end of file
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/fw/util/AdminTestUtil.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/fw/util/AdminTestUtil.java
new file mode 100644
index 000000000..10da885c3
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/fw/util/AdminTestUtil.java
@@ -0,0 +1,246 @@
+package io.mosip.testrig.pmpui.fw.util;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Properties;
+import java.util.TimeZone;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.log4j.Logger;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import io.mosip.testrig.pmpui.authentication.fw.precon.JsonPrecondtion;
+import io.mosip.testrig.pmpui.authentication.fw.util.RestClient;
+import io.mosip.testrig.pmpui.kernel.util.ConfigManager;
+import io.mosip.testrig.pmpui.kernel.util.KernelAuthentication;
+import io.mosip.testrig.pmpui.kernel.util.KeycloakUserManager;
+import io.mosip.testrig.pmpui.utility.BaseTestCaseFunc;
+import io.restassured.response.Response;
+import org.apache.commons.lang.RandomStringUtils;
+
+public class AdminTestUtil extends BaseTestCaseFunc {
+
+ private static final Logger logger = Logger.getLogger(AdminTestUtil.class);
+ public static String token;
+ public static String user;
+ public static String tokenRoleIdRepo = "idrepo";
+ public static String tokenRoleAdmin = "admin";
+ public static boolean initialized = false;
+
+ public static String getUnUsedUIN(String role){
+
+ return JsonPrecondtion
+ .getValueFromJson(
+ RestClient.getRequestWithCookie(ApplnURI + "/v1/idgenerator/uin", MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_JSON, COOKIENAME,
+ new KernelAuthentication().getTokenByRole(role)).asString(),
+ "response.uin");
+ }
+
+ public static String getMasterDataSchema(String role){
+ String url = ApplnURI + props.getProperty("masterSchemaURL");
+ kernelAuthLib = new KernelAuthentication();
+ String token = kernelAuthLib.getTokenByRole("admin");
+
+ Response response = RestClient.getRequestWithCookie(url, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON,
+ "Authorization", token);
+
+ return response.asString();
+ }
+
+ public static String generateCurrentUTCTimeStamp() {
+ Date date = new Date();
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ return dateFormat.format(date);
+ }
+
+ public static boolean activateUIN(String inputJson, String role) {
+ Response response = null;
+
+ token = kernelAuthLib.getTokenByRole(role);
+ response = RestClient.postRequestWithCookie(ApplnURI + props.getProperty("addIdentityURL"), inputJson, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_JSON, COOKIENAME, token);
+ JSONObject responseJson = new JSONObject(response.asString());
+
+
+ logger.info("responseJson = " + responseJson);
+
+ return responseJson.getJSONObject("response").getString("status").equalsIgnoreCase("ACTIVATED");
+ }
+
+ public static String buildaddIdentityRequestBody(String schemaJson, String uin, String rid) {
+ org.json.JSONObject schemaresponseJson = new org.json.JSONObject(schemaJson);
+
+ org.json.JSONObject schemaData = (org.json.JSONObject) schemaresponseJson.get("response");
+ Double schemaVersion = (Double) schemaData.get("idVersion");
+ String schemaJsonData = schemaData.getString("schemaJson");
+ String schemaFile = schemaJsonData.toString();
+
+ JSONObject schemaFileJson = new JSONObject(schemaFile); // jObj
+ JSONObject schemaPropsJson = schemaFileJson.getJSONObject("properties"); // objIDJson4
+ JSONObject schemaIdentityJson = schemaPropsJson.getJSONObject("identity"); // objIDJson
+ JSONObject identityPropsJson = schemaIdentityJson.getJSONObject("properties"); // objIDJson2
+ JSONArray requiredPropsArray = schemaIdentityJson.getJSONArray("required"); // objIDJson1
+ logger.info("requiredPropsArray = " + requiredPropsArray);
+
+ JSONObject requestJson = new JSONObject();
+
+ requestJson.put("id", propsMap.getProperty("id"));
+ requestJson.put("request", new HashMap<>());
+ requestJson.getJSONObject("request").put("registrationId", rid);
+ JSONObject identityJson = new JSONObject();
+ identityJson.put("UIN", uin);
+
+ for (int i = 0, size = requiredPropsArray.length(); i < size; i++) {
+ String eachRequiredProp = requiredPropsArray.getString(i); // objIDJson3
+
+ JSONObject eachPropDataJson = (JSONObject) identityPropsJson.get(eachRequiredProp); // rc1
+
+ if (eachPropDataJson.has("$ref") && eachPropDataJson.get("$ref").toString().contains("simpleType")) {
+
+ JSONArray eachPropDataArray = new JSONArray(); // jArray
+
+ for (int j = 0; j < BaseTestCaseFunc.getLanguageList().size(); j++) {
+ JSONObject eachValueJson = new JSONObject(); // studentJSON
+ eachValueJson.put("language", BaseTestCaseFunc.getLanguageList().get(j));
+ eachValueJson.put("value", propsMap.getProperty(eachRequiredProp) + BaseTestCaseFunc.getLanguageList().get(j));
+ eachPropDataArray.put(eachValueJson);
+ }
+ identityJson.put(eachRequiredProp, eachPropDataArray);
+ }
+ else {
+ if (eachRequiredProp.equals("proofOfIdentity")) {
+ identityJson.put(eachRequiredProp, new HashMap<>());
+ identityJson.getJSONObject(eachRequiredProp).put("format", "txt");
+ identityJson.getJSONObject(eachRequiredProp).put("type", "DOC001");
+ identityJson.getJSONObject(eachRequiredProp).put("value", "fileReferenceID");
+ }
+ else if (eachRequiredProp.equals("individualBiometrics")) {
+ identityJson.put(eachRequiredProp, new HashMap<>());
+ identityJson.getJSONObject(eachRequiredProp).put("format", "cbeff");
+ identityJson.getJSONObject(eachRequiredProp).put("version", 1);
+ identityJson.getJSONObject(eachRequiredProp).put("value", "fileReferenceID");
+ }
+
+ else if (eachRequiredProp.equals("IDSchemaVersion")) {
+ identityJson.put(eachRequiredProp, schemaVersion);
+ }
+
+ else {
+ identityJson.put(eachRequiredProp, propsMap.getProperty(eachRequiredProp));
+ if (eachRequiredProp.equals("email")) {
+ uinEmail = propsMap.getProperty(eachRequiredProp);
+ }
+ if (eachRequiredProp.equals("phone")) {
+ uinPhone = propsMap.getProperty(eachRequiredProp);
+ }
+ }
+ }
+ }
+
+ JSONArray requestDocArray = new JSONArray();
+ JSONObject docJson = new JSONObject();
+ docJson.put("value", propsBio.getProperty("BioValue"));
+ docJson.put("category", "individualBiometrics");
+ requestDocArray.put(docJson);
+
+ requestJson.getJSONObject("request").put("documents", requestDocArray);
+ requestJson.getJSONObject("request").put("identity", identityJson);
+ requestJson.put("requesttime", generateCurrentUTCTimeStamp());
+ requestJson.put("version", "v1");
+
+ logger.info(requestJson);
+ return requestJson.toString();
+ }
+
+ public static String UserMapping() {
+ return user;
+
+ }
+
+// public static String generateUIN() {
+// String uin = "";
+//
+// initialize();
+//
+// DateFormat dateFormatter = new SimpleDateFormat("YYYYMMddHHmmss");
+// Calendar cal = Calendar.getInstance();
+// String timestampValue = dateFormatter.format(cal.getTime());
+// String rid = "27847" + RandomStringUtils.randomNumeric(10) + timestampValue;
+//
+// // Make Unused UIN Api call to get the UIN Number
+// uin = AdminTestUtil.getUnUsedUIN(tokenRoleIdRepo);
+//
+// // Call Masterdata Schema API To get the Schema Data Of the Env
+// String responseString = AdminTestUtil.getMasterDataSchema(tokenRoleAdmin);
+//
+// // Build request body for add identity API
+// String requestjson = AdminTestUtil.buildaddIdentityRequestBody(responseString, uin, rid);
+//
+//
+// // Make Add Identity API Call and activate the UIN
+// if (AdminTestUtil.activateUIN(requestjson, tokenRoleIdRepo) == false) {
+// // UIN activation failed
+// return "";
+// }
+//
+// return uin;
+// }
+
+
+// public static String generateVID(String uin, String vidType) {
+// if (uin.isEmpty() || vidType.isEmpty()) {
+// return "";
+// }
+//
+// initialize();
+// Response response = null;
+//
+// String token = BaseTestCase.kernelAuthLib.getTokenByRole(tokenRoleIdRepo);
+// JSONObject requestJson = new JSONObject();
+//
+// requestJson.put("id", "mosip.vid.create");
+// requestJson.put("metadata", new HashMap<>());
+// requestJson.put("requesttime", AdminTestUtil.generateCurrentUTCTimeStamp());
+// requestJson.put("version", "v1");
+// requestJson.put("request", new HashMap<>());
+// requestJson.getJSONObject("request").put("UIN", uin);
+// requestJson.getJSONObject("request").put("vidType", vidType);
+//
+// response = RestClient.postRequestWithCookie(BaseTestCase.ApplnURI + BaseTestCase.props.getProperty("idRepoGenVidURL"), requestJson.toString(), MediaType.APPLICATION_JSON,
+// MediaType.APPLICATION_JSON, BaseTestCase.COOKIENAME, token);
+// JSONObject responseJson = new JSONObject(response.asString());
+//
+//
+// logger.info("responseJson = " + responseJson);
+//
+// if (responseJson.getJSONObject("response").getString("vidStatus").equalsIgnoreCase("ACTIVE")) {
+// return responseJson.getJSONObject("response").getString("VID");
+// }
+//
+// return "";
+// }
+ public static void initialize() {
+ String adminuser="";
+ if (initialized == false) {
+ ConfigManager.init();
+ BaseTestCaseFunc.initialize();
+ // Initializing or setting up execution
+ //Langauge Independent
+
+ // Generate Keycloak Users
+ KeycloakUserManager.createUsers();
+ BaseTestCaseFunc.mapUserToZone(BaseTestCaseFunc.currentModule+"-"+propsKernel.getProperty("admin_userName"),"CSB");
+ BaseTestCaseFunc.mapZone(BaseTestCaseFunc.currentModule+"-"+propsKernel.getProperty("admin_userName"));
+ initialized = true;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/service/ApplicationLibrary.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/service/ApplicationLibrary.java
new file mode 100644
index 000000000..05cfb6568
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/service/ApplicationLibrary.java
@@ -0,0 +1,23 @@
+package io.mosip.testrig.pmpui.kernel.service;
+
+import javax.ws.rs.core.MediaType;
+
+import io.mosip.testrig.pmpui.utility.BaseTestCaseFunc;
+import io.mosip.testrig.pmpui.kernel.util.CommonLibrary;
+import io.restassured.response.Response;
+
+public class ApplicationLibrary extends BaseTestCaseFunc {
+
+ private static CommonLibrary commonLibrary = new CommonLibrary();
+
+
+ // get requests
+ public Response getWithoutParams(String endpoint, String cookie) {
+ return commonLibrary.getWithoutParams(ApplnURI + endpoint, cookie);
+ }
+
+ public Response postWithJson(String endpoint, Object body) {
+ return commonLibrary.postWithJson(ApplnURI + endpoint, body, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_JSON);
+ }
+}
\ No newline at end of file
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/CommonLibrary.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/CommonLibrary.java
new file mode 100644
index 000000000..4f1502a36
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/CommonLibrary.java
@@ -0,0 +1,158 @@
+package io.mosip.testrig.pmpui.kernel.util;
+
+import static io.restassured.RestAssured.given;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Map;
+import java.util.Properties;
+import java.util.stream.Collectors;
+
+import org.apache.log4j.Logger;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+
+import io.mosip.testrig.pmpui.utility.BaseTestCaseFunc;
+import io.mosip.testrig.pmpui.utility.TestRunner;
+import io.mosip.testrig.pmpui.kernel.service.ApplicationLibrary;
+import io.restassured.http.Cookie;
+import io.restassured.response.Response;
+
+public class CommonLibrary extends BaseTestCaseFunc {
+ private static Logger logger = Logger.getLogger(CommonLibrary.class);
+ private ApplicationLibrary applicationLibrary = new ApplicationLibrary();
+
+
+ public String getResourcePath() {
+ return TestRunner.getGlobalResourcePath() + "/";
+ }
+
+ public String getResourcePathForKernel() {
+ return TestRunner.getResourcePath() + "/";
+ }
+
+
+ public boolean isValidToken(String cookie) {
+
+ logger.info("========= Revalidating the token =========");
+ Response response = applicationLibrary.getWithoutParams("/v1/authmanager/authorize/admin/validateToken", cookie);
+ JSONObject responseJson =null;
+ try {
+ responseJson = (JSONObject) ((JSONObject) new JSONParser().parse(response.asString()))
+ .get("response");
+ } catch (ParseException | NullPointerException e) {
+ logger.info(e.getMessage());
+ }
+
+ if (responseJson!=null && responseJson.get("errors")==null)
+ {
+ logger.info("========= Valid Token =========");
+ return true;
+ }
+ else
+ {
+
+ logger.info("========= InValid Token =========");
+ return false;
+ }
+
+ }
+
+ public Map readProperty(String propertyFileName) {
+ Properties prop = new Properties();
+ try {
+ logger.info("propertyFileName: " + propertyFileName + "Path :" + getResourcePathForKernel() + "config/" + propertyFileName + ".properties");
+ logger.info("propertyFileName: " + propertyFileName + "Path :" + getResourcePathForKernel() + "config/" + propertyFileName + ".properties");
+ File propertyFile = new File(getResourcePathForKernel() + "config/" + propertyFileName + ".properties");
+ prop.load(new FileInputStream(propertyFile));
+
+ } catch (IOException e) {
+ logger.info("Error occrued while reading propertyFileName " + propertyFileName + e.getMessage());
+ logger.info(e.getMessage());
+ }
+
+ Map mapProp = prop.entrySet().stream()
+ .collect(Collectors.toMap(e -> (String) e.getKey(), e -> (String) e.getValue()));
+
+ return mapProp;
+ }
+
+ // Get Requests:
+ /**
+ * @param url
+ * @param cookie
+ * @return this method is for get request with authentication(cookie) and
+ * without any param.
+ */
+ public Response getWithoutParams(String url, String cookie) {
+ logger.info("REST-ASSURED: Sending a Get request to " + url);
+ Cookie.Builder builder = new Cookie.Builder("Authorization", cookie);
+ Response getResponse = given().cookie(builder.build()).relaxedHTTPSValidation().log().all().when().get(url);
+ // log then response
+ responseLogger(getResponse);
+ logger.info("REST-ASSURED: the response Time is: " + getResponse.time());
+ return getResponse;
+ }
+
+
+ /**
+ * @param response
+ * this method is for logging the response in case of error only.
+ * this is used in get request response logging
+ */
+ public void responseLogger(Response response) {
+ int statusCode = response.statusCode();
+ if (statusCode < 200 || statusCode > 299) {
+ logger.info(response.asString());
+ } else
+ logger.info("status code: " + statusCode + "(success)");
+
+ }
+
+ public JSONObject readJsonData(String path, boolean isRelative) {
+ logger.info("path : " + path);
+ if(isRelative)
+ path = getResourcePath() + path;
+ logger.info("Relativepath : " + path);
+ File fileToRead = new File(path);
+ InputStream isOfFile = null;
+ try {
+ logger.info("fileToRead : " + fileToRead);
+ isOfFile = new FileInputStream(fileToRead);
+ } catch (FileNotFoundException e1) {
+ logger.info("error while reading the file : " + e1.getLocalizedMessage() );
+ e1.printStackTrace();
+ logger.info("File Not Found at the given path");
+ }
+ JSONObject jsonData = null;
+ try {
+ jsonData = (JSONObject) new JSONParser().parse(new InputStreamReader(isOfFile, "UTF-8"));
+ } catch (IOException | ParseException | NullPointerException e) {
+ logger.info(e.getMessage());
+ }
+ return jsonData;
+ }
+
+ /**
+ * @param url
+ * @param body
+ * @param contentHeader
+ * @param acceptHeader
+ * @return this method is for post request without authentication(cookie) and
+ * only with jsonData in request body.
+ */
+ public Response postWithJson(String url, Object body, String contentHeader, String acceptHeader) {
+ logger.info("REST:ASSURED:Sending post request to" + url);
+ Response postResponse = given().relaxedHTTPSValidation().body(body).contentType(contentHeader)
+ .accept(acceptHeader).log().all().when().post(url).then().log().all().extract().response();
+ // log then response
+ logger.info("REST-ASSURED: The response from request is: " + postResponse.asString());
+ logger.info("REST-ASSURED: The response Time is: " + postResponse.time());
+ return postResponse;
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/ConfigManager.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/ConfigManager.java
new file mode 100644
index 000000000..80c7f84e6
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/ConfigManager.java
@@ -0,0 +1,678 @@
+package io.mosip.testrig.pmpui.kernel.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+
+import io.mosip.testrig.pmpui.utility.TestRunner;
+public class ConfigManager {
+
+ private static final Logger logger = Logger.getLogger(ConfigManager.class);
+
+// private static String MOSIP_PMS_CLIENT_SECRET = "mosip_pms_client_secret";
+// private static String MOSIP_PMS_CLIENT_ID = "mosip_pms_client_id";
+// private static String MOSIP_PMS_APP_ID = "mosip_pms_app_id";
+//
+// private static String MOSIP_RESIDENT_CLIENT_SECRET = "mosip_resident_client_secret";
+// private static String MOSIP_RESIDENT_CLIENT_ID = "mosip_resident_client_id";
+// private static String MOSIP_RESIDENT_APP_ID = "mosip_resident_app_id";
+//
+// private static String MOSIP_MOBILE_CLIENT_ID = "mpartner_default_mobile_client_id";
+// private static String MOSIP_MOBILE_CLIENT_SECRET = "mpartner_default_mobile_secret";
+//
+ private static String IAM_ADMINPORTAL_PATH = "PmpPortalPath";
+ private static String IAM_APIENVUSER = "apiEnvUser";
+ private static String IAM_APIINTERNALENDPOINT = "apiInternalEndPoint";
+ private static String MOSIP_IDREPO_CLIENT_SECRET = "mosip_idrepo_client_secret";
+ private static String MOSIP_IDREPO_CLIENT_ID = "mosip_idrepo_client_id";
+ private static String MOSIP_IDREPO_APP_ID = "mosip_idrepo_app_id";
+//
+ private static String MOSIP_ADMIN_CLIENT_SECRET = "mosip_admin_client_secret";
+ private static String MOSIP_ADMIN_CLIENT_ID = "mosip_admin_client_id";
+ private static String MOSIP_ADMIN_APP_ID = "mosip_admin_app_id";
+//
+// private static String MOSIP_REG_CLIENT_SECRET = "mosip_reg_client_secret";
+// private static String MOSIP_REG_CLIENT_ID = "mosip_reg_client_id";
+// private static String MOSIP_REGCLIENT_APP_ID = "mosip_regclient_app_id";
+//
+// private static String MOSIP_IDA_CLIENT_SECRET = "mosip_ida_client_secret";
+// private static String MOSIP_IDA_CLIENT_ID = "mosip_ida_client_id";
+// private static String MOSIP_IDA_APP_ID = "mosip_ida_app_id";
+//
+// private static String MOSIP_HOTLIST_CLIENT_SECRET = "mosip_hotlist_client_secret";
+// private static String MOSIP_HOTLIST_CLIENT_ID = "mosip_hotlist_client_id";
+// private static String MOSIP_HOTLIST_APP_ID = "mosip_hotlist_app_id";
+//
+ private static String MOSIP_AUTOMATION_CLIENT_SECRET = "mosip_testrig_client_secret";
+ private static String MOSIP_AUTOMATION_CLIENT_ID = "mosip_testrig_client_id";
+// private static String MOSIP_AUTOMATION_APP_ID = "mosip_automation_app_id";
+//
+ private static String S3_HOST = "s3-host";
+ private static String S3_REGION = "s3-region";
+ private static String S3_USER_KEY = "s3-user-key";
+ private static String S3_SECRET_KEY = "s3-user-secret";
+ private static String S3_ACCOUNT = "s3-account";
+ private static String PUSH_TO_S3 = "push-reports-to-s3";
+// private static String ENABLE_DEBUG = "enableDebug";
+// private static String THREAD_COUNT = "threadCount";
+// private static String LANG_SELECT = "langselect";
+//
+//
+ private static String DB_PORT = "db-port";
+ private static String DB_DOMAIN = "db-server";
+ private static String HIBERNATE_CONNECTION_DRIVER_CLASS = "hibernate.connection.driver_class";
+ private static String HIBERNATE_CONNECTION_POOL_SIZE = "hibernate.connection.pool_size";
+ private static String HIBERNATE_DIALECT = "hibernate.dialect";
+ private static String HIBERNATE_SHOW_SQL = "hibernate.show_sql";
+ private static String HIBERNATE_CONTEXT_CLASS = "hibernate.current_session_context_class";
+//
+// private static String AUDIT_DB_USER = "db-su-user";
+// private static String AUDIT_DB_PASS = "postgresql-password";
+// private static String AUDIT_DB_SCHEMA = "audit_db_schema";
+//
+// private static String IDA_DB_USER = "db-su-user";
+// private static String IDA_DB_PASS = "postgresql-password";
+// private static String IDA_DB_SCHEMA = "ida_db_schema";
+//
+// private static String PMS_DB_USER = "db-su-user";
+// private static String PMS_DB_PASS = "postgresql-password";
+// private static String PMS_DB_SCHEMA = "pms_db_schema";
+//
+// private static String KM_DB_USER = "db-su-user";
+// private static String KM_DB_PASS = "postgresql-password";
+// private static String KM_DB_SCHEMA = "km_db_schema";
+//
+ private static String MASTER_DB_USER = "db-su-user";
+ private static String MASTER_DB_PASS = "postgresql-password";
+ private static String MASTER_DB_SCHEMA = "master_db_schema";
+//
+ private static String IAM_EXTERNAL_URL = "keycloak-external-url";
+ private static String IAM_REALM_ID = "keycloak-realm-id";
+ private static String IAM_USERS_TO_CREATE = "iam-users-to-create";
+ private static String IAM_USERS_PASSWORD = "iam-users-password";
+//
+// private static String AUTH_DEMO_SERVICE_PORT = "authDemoServicePort";
+// private static String AUTH_DEMO_SERVICE_BASE_URL = "authDemoServiceBaseURL";
+// private static String MOUNT_PATH = "mountPath";
+// private static String AUTHCERTS_PATH = "authCertsPath";
+// private static String MOUNT_PATH_FOR_SCENARIO = "mountPathForScenario";
+//
+// private static String PACKET_UTILITY_BASE_URL = "packetUtilityBaseUrl";
+ private static String REPORT_EXPIRATION_IN_DAYS = "reportExpirationInDays";
+// private static String pms_client_secret;
+// private static String pms_client_id;
+// private static String pms_app_id;
+//
+// private static String resident_client_secret;
+// private static String resident_client_id;
+// private static String resident_app_id;
+//
+// private static String mpartner_mobile_client_id;
+// private static String mpartner_mobile_client_secret;
+//
+ private static String idrepo_client_secret;
+ private static String idrepo_client_id;
+ private static String idrepo_app_id;
+//
+ private static String admin_client_secret;
+ private static String admin_client_id;
+ private static String admin_app_id;
+//
+// private static String regproc_client_secret;
+// private static String regproc_client_id;
+// private static String regproc_app_id;
+//
+// private static String ida_client_secret;
+// private static String ida_client_id;
+// private static String ida_app_id;
+//
+// private static String hotlist_client_secret;
+// private static String hotlist_client_id;
+// private static String hotlist_app_id;
+//
+ private static String automation_client_secret;
+ private static String automation_client_id;
+// private static String automation_app_id;
+//
+ private static String s3_region;
+ private static String s3_host;
+ private static String s3_user_key;
+ private static String s3_account;
+ private static String s3_secret_key;
+ private static String push_reports_to_s3;
+// private static String enableDebug;
+// private static String threadCount;
+// private static String langselect;
+//
+ private static String db_port;
+ private static String db_domain;
+ private static String hibernate_connection_driver_class;
+ private static String hibernate_connection_pool_size;
+ private static String hibernate_dialect;
+ private static String hibernate_show_sql;
+ private static String hibernate_current_session_context_class;
+//
+// private static String audit_db_user;
+// private static String audit_db_pass;
+// private static String audit_db_schema;
+//
+// private static String ida_db_user;
+// private static String ida_db_pass;
+// private static String ida_db_schema;
+//
+// private static String pms_db_user;
+// private static String pms_db_pass;
+// private static String pms_db_schema;
+//
+// private static String km_db_user;
+// private static String km_db_pass;
+// private static String km_db_schema;
+//
+ private static String master_db_user;
+ private static String master_db_pass;
+ private static String master_db_schema;
+//
+ private static String iam_external_url;
+ private static String iam_realm_id;
+ private static String iam_users_to_create;
+ private static String iam_users_password;
+ private static String iam_adminportal_path;
+ private static String iam_apienvuser;
+ private static String iam_apiinternalendpoint;
+// private static String authDemoServicePort;
+// private static String authDemoServiceBaseUrl;
+//
+// private static String mountPath;
+// private static String authCertsPath;
+// private static String mountPathForScenario;
+// private static String packetUtilityBaseUrl;
+ public static Properties propsKernel;
+ private static String reportExpirationInDays;
+
+ public static void setProperty(String key, String value) {
+ // Overwrite the value with only if the key exists
+ if (propsKernel.containsKey(key)) {
+ propsKernel.setProperty(key, value);
+ }
+ }
+
+ public static String getValueForKey(String key) {
+ String value = System.getenv(key) == null ? propsKernel.getProperty(key) : System.getenv(key);
+ setProperty(key, value);
+
+ return value;
+ }
+
+ public static void init() {
+ // Loading Kernel property
+ propsKernel = getproperty(TestRunner.getResourcePath() + "/" + "config/Kernel.properties");
+
+// pms_client_secret = getValueForKey(MOSIP_PMS_CLIENT_SECRET);
+// pms_client_id = getValueForKey(MOSIP_PMS_CLIENT_ID);
+// pms_app_id = getValueForKey(MOSIP_PMS_APP_ID);
+// resident_client_secret = getValueForKey(MOSIP_RESIDENT_CLIENT_SECRET);
+// resident_client_id = getValueForKey(MOSIP_RESIDENT_CLIENT_ID);
+// resident_app_id = getValueForKey(MOSIP_RESIDENT_APP_ID);
+// mpartner_mobile_client_id = getValueForKey(MOSIP_MOBILE_CLIENT_ID);
+// mpartner_mobile_client_secret = getValueForKey(MOSIP_MOBILE_CLIENT_SECRET);
+ iam_adminportal_path =System.getenv(IAM_ADMINPORTAL_PATH) == null
+ ? propsKernel.getProperty(IAM_ADMINPORTAL_PATH)
+ : System.getenv(IAM_ADMINPORTAL_PATH);
+
+ logger.info("adminportal_path from config manager::" + iam_adminportal_path);
+ iam_apienvuser = System.getenv(IAM_APIENVUSER) == null
+ ? propsKernel.getProperty(IAM_APIENVUSER)
+ : System.getenv(IAM_APIENVUSER);
+ logger.info("apienvuser from config manager::" + iam_apienvuser);
+ iam_apiinternalendpoint = System.getenv(IAM_APIINTERNALENDPOINT) == null
+ ? propsKernel.getProperty(IAM_APIINTERNALENDPOINT)
+ : System.getenv(IAM_APIINTERNALENDPOINT);
+ logger.info("apiinternalendpoint from config manager::" + iam_apiinternalendpoint);
+ idrepo_client_secret = getValueForKey(MOSIP_IDREPO_CLIENT_SECRET);
+ idrepo_client_id = getValueForKey(MOSIP_IDREPO_CLIENT_ID);
+ idrepo_app_id = getValueForKey(MOSIP_IDREPO_APP_ID);
+ admin_client_secret = getValueForKey(MOSIP_ADMIN_CLIENT_SECRET);
+ admin_client_id = getValueForKey(MOSIP_ADMIN_CLIENT_ID);
+ admin_app_id = getValueForKey(MOSIP_ADMIN_APP_ID);
+// regproc_client_secret = getValueForKey(MOSIP_REG_CLIENT_SECRET);
+// regproc_client_id = getValueForKey(MOSIP_REG_CLIENT_ID);
+// regproc_app_id = getValueForKey(MOSIP_REGCLIENT_APP_ID);
+// ida_client_secret = getValueForKey(MOSIP_IDA_CLIENT_SECRET);
+// ida_client_id = getValueForKey(MOSIP_IDA_CLIENT_ID);
+// ida_app_id = getValueForKey(MOSIP_IDA_APP_ID);
+// hotlist_client_secret = getValueForKey(MOSIP_HOTLIST_CLIENT_SECRET);
+// hotlist_client_id = getValueForKey(MOSIP_HOTLIST_CLIENT_ID);
+// hotlist_app_id = getValueForKey(MOSIP_HOTLIST_APP_ID);
+ automation_client_secret = getValueForKey(MOSIP_AUTOMATION_CLIENT_SECRET);
+ automation_client_id = getValueForKey(MOSIP_AUTOMATION_CLIENT_ID);
+// automation_app_id = getValueForKey(MOSIP_AUTOMATION_APP_ID);
+ s3_host = getValueForKey(S3_HOST);
+ s3_region = getValueForKey(S3_REGION);
+ s3_user_key = getValueForKey(S3_USER_KEY);
+ s3_secret_key = getValueForKey(S3_SECRET_KEY);
+ s3_account = getValueForKey(S3_ACCOUNT);
+ push_reports_to_s3 = getValueForKey(PUSH_TO_S3);
+ db_port = getValueForKey(DB_PORT);
+ db_domain = getValueForKey(DB_DOMAIN);
+ hibernate_connection_driver_class = getValueForKey(HIBERNATE_CONNECTION_DRIVER_CLASS);
+ hibernate_connection_pool_size = getValueForKey(HIBERNATE_CONNECTION_POOL_SIZE);
+ hibernate_dialect = getValueForKey(HIBERNATE_DIALECT);
+ hibernate_show_sql = getValueForKey(HIBERNATE_SHOW_SQL);
+ hibernate_current_session_context_class = getValueForKey(HIBERNATE_CONTEXT_CLASS);
+// audit_db_user = getValueForKey(AUDIT_DB_USER);
+// audit_db_pass = getValueForKey(AUDIT_DB_PASS);
+// audit_db_schema = getValueForKey(AUDIT_DB_SCHEMA);
+// ida_db_user = getValueForKey(IDA_DB_USER);
+// ida_db_pass = getValueForKey(IDA_DB_PASS);
+// ida_db_schema = getValueForKey(IDA_DB_SCHEMA);
+// pms_db_user = getValueForKey(PMS_DB_USER);
+// pms_db_pass = getValueForKey(PMS_DB_PASS);
+// pms_db_schema = getValueForKey(PMS_DB_SCHEMA);
+// km_db_user = getValueForKey(KM_DB_USER);
+// km_db_pass = getValueForKey(KM_DB_PASS);
+// km_db_schema = getValueForKey(KM_DB_SCHEMA);
+ master_db_user = getValueForKey(MASTER_DB_USER);
+ master_db_pass = getValueForKey(MASTER_DB_PASS);
+ master_db_schema = getValueForKey(MASTER_DB_SCHEMA);
+ iam_external_url = getValueForKey(IAM_EXTERNAL_URL);
+ logger.info("keycloakendpoint from config manager::" + iam_external_url);
+
+ iam_external_url = getValueForKey(IAM_EXTERNAL_URL);
+ logger.info("keycloakendpoint from config manager::" + iam_external_url);
+ iam_adminportal_path =System.getenv(IAM_ADMINPORTAL_PATH) == null
+ ? propsKernel.getProperty(IAM_ADMINPORTAL_PATH)
+ : System.getenv(IAM_ADMINPORTAL_PATH);
+
+ logger.info("adminportal_path from config manager::" + iam_adminportal_path);
+ iam_apienvuser = System.getenv(IAM_APIENVUSER) == null
+ ? propsKernel.getProperty(IAM_APIENVUSER)
+ : System.getenv(IAM_APIENVUSER);
+ logger.info("apienvuser from config manager::" + iam_apienvuser);
+ iam_apiinternalendpoint = System.getenv(IAM_APIINTERNALENDPOINT) == null
+ ? propsKernel.getProperty(IAM_APIINTERNALENDPOINT)
+ : System.getenv(IAM_APIINTERNALENDPOINT);
+ logger.info("apiinternalendpoint from config manager::" + iam_apiinternalendpoint);
+//
+ iam_realm_id = getValueForKey(IAM_REALM_ID);
+ iam_users_to_create = getValueForKey(IAM_USERS_TO_CREATE);
+ iam_users_password = getValueForKey(IAM_USERS_PASSWORD);
+//
+ admin_client_secret = System.getenv(MOSIP_ADMIN_CLIENT_SECRET) == null
+ ? propsKernel.getProperty(MOSIP_ADMIN_CLIENT_SECRET)
+ : System.getenv(MOSIP_ADMIN_CLIENT_SECRET);
+//
+ propsKernel.setProperty(MOSIP_ADMIN_CLIENT_SECRET, admin_client_secret);
+//
+// authDemoServicePort = System.getenv(AUTH_DEMO_SERVICE_PORT) == null
+// ? propsKernel.getProperty(AUTH_DEMO_SERVICE_PORT)
+// : System.getenv(AUTH_DEMO_SERVICE_PORT);
+// propsKernel.setProperty(AUTH_DEMO_SERVICE_PORT, authDemoServicePort);
+//
+// authDemoServiceBaseUrl = System.getenv(AUTH_DEMO_SERVICE_BASE_URL) == null
+// ? propsKernel.getProperty(AUTH_DEMO_SERVICE_BASE_URL)
+// : System.getenv(AUTH_DEMO_SERVICE_BASE_URL);
+// propsKernel.setProperty(AUTH_DEMO_SERVICE_BASE_URL, authDemoServiceBaseUrl);
+//
+// mountPath = System.getenv(MOUNT_PATH) == null ? propsKernel.getProperty(MOUNT_PATH) : System.getenv(MOUNT_PATH);
+// propsKernel.setProperty(MOUNT_PATH, mountPath);
+ reportExpirationInDays = System.getenv(REPORT_EXPIRATION_IN_DAYS) == null
+ ? propsKernel.getProperty(REPORT_EXPIRATION_IN_DAYS)
+ : System.getenv(REPORT_EXPIRATION_IN_DAYS);
+ propsKernel.setProperty(REPORT_EXPIRATION_IN_DAYS, reportExpirationInDays);
+// authCertsPath = System.getenv(AUTHCERTS_PATH) == null ? propsKernel.getProperty(AUTHCERTS_PATH) : System.getenv(AUTHCERTS_PATH);
+// propsKernel.setProperty(AUTHCERTS_PATH, authCertsPath);
+//
+// mountPathForScenario = System.getenv(MOUNT_PATH_FOR_SCENARIO) == null ? propsKernel.getProperty(MOUNT_PATH_FOR_SCENARIO) : System.getenv(MOUNT_PATH_FOR_SCENARIO);
+// propsKernel.setProperty(MOUNT_PATH_FOR_SCENARIO, mountPathForScenario);
+//
+// packetUtilityBaseUrl = System.getenv(PACKET_UTILITY_BASE_URL) == null ? propsKernel.getProperty(PACKET_UTILITY_BASE_URL) : System.getenv(PACKET_UTILITY_BASE_URL);
+// propsKernel.setProperty(PACKET_UTILITY_BASE_URL, packetUtilityBaseUrl);
+//
+ push_reports_to_s3 =System.getenv(PUSH_TO_S3) == null ? propsKernel.getProperty(PUSH_TO_S3) : System.getenv(PUSH_TO_S3);
+ propsKernel.setProperty(PUSH_TO_S3, push_reports_to_s3);
+//
+// enableDebug =System.getenv(ENABLE_DEBUG) == null ? propsKernel.getProperty(ENABLE_DEBUG) : System.getenv(ENABLE_DEBUG);
+// propsKernel.setProperty(ENABLE_DEBUG, enableDebug);
+//
+// threadCount =System.getenv(THREAD_COUNT) == null ? propsKernel.getProperty(THREAD_COUNT) : System.getenv(THREAD_COUNT);
+// propsKernel.setProperty(THREAD_COUNT, threadCount);
+//
+// langselect =System.getenv(LANG_SELECT) == null ? propsKernel.getProperty(LANG_SELECT) : System.getenv(LANG_SELECT);
+// propsKernel.setProperty(LANG_SELECT, langselect);
+
+ //enableDebug threadCount langselect
+
+ }
+
+// public static String getAuthDemoServicePort() {
+// return authDemoServicePort;
+// }
+//
+// public static String getAuthDemoServiceBaseUrl() {
+// return authDemoServiceBaseUrl;
+//
+// }
+//
+// public static String getLangselect() {
+// return langselect;
+//
+// }
+//
+// public static String getThreadCount() {
+// return threadCount;
+//
+// }
+//
+// public static String getEnableDebug() {
+// return enableDebug;
+//
+// }
+//
+// public static String getmountPath() {
+// return mountPath;
+// }
+//
+// public static String getmountPathForScenario() {
+// return mountPathForScenario;
+// }
+//
+// public static String getpacketUtilityBaseUrl() {
+// return packetUtilityBaseUrl;
+// }
+//
+// public static String getauthCertsPath() {
+// return authCertsPath;
+// }
+//
+// public static Properties init(String abc) {
+// propsKernel = getproperty(TestRunner.getResourcePath() + "/" + "config/Kernel.properties");
+//
+// return propsKernel;
+// }
+//
+// public static String getPmsClientSecret() {
+// return pms_client_secret;
+// }
+//
+// public static String getPmsClientId() {
+// return pms_client_id;
+// }
+//
+// public static String getPmsAppId() {
+// return pms_app_id;
+// }
+//
+// public static String getResidentClientSecret() {
+// return resident_client_secret;
+// }
+//
+// public static String getResidentClientId() {
+// return resident_client_id;
+// }
+//
+// public static String getResidentAppId() {
+// return resident_app_id;
+// }
+//
+// public static String getMPartnerMobileClientId() {
+// return mpartner_mobile_client_id;
+// }
+//
+// public static String getMPartnerMobileClientSecret() {
+// return mpartner_mobile_client_secret;
+// }
+//
+ public static String getAdminClientSecret() {
+ return admin_client_secret;
+ }
+//
+ public static String getAdminClientId() {
+ return admin_client_id;
+ }
+//
+ public static String getAdminAppId() {
+ return admin_app_id;
+ }
+//
+ public static String getIdRepoClientSecret() {
+ return idrepo_client_secret;
+ }
+//
+ public static String getidRepoClientId() {
+ return idrepo_client_id;
+ }
+//
+ public static String getidRepoAppId() {
+ return idrepo_app_id;
+ }
+ public static String getiam_adminportal_path() {
+ return iam_adminportal_path;
+ }
+ public static String getiam_apienvuser() {
+ return iam_apienvuser;
+ }
+ public static String getiam_apiinternalendpoint() {
+ return iam_apiinternalendpoint;
+ }
+//
+// public static String getRegprocClientSecret() {
+// return regproc_client_secret;
+// }
+//
+// public static String getRegprocClientId() {
+// return regproc_client_id;
+// }
+//
+// public static String getRegprocAppId() {
+// return regproc_app_id;
+// }
+//
+// public static String getIdaClientSecret() {
+// return ida_client_secret;
+// }
+//
+// public static String getIdaClientId() {
+// return ida_client_id;
+// }
+//
+// public static String getIdaAppId() {
+// return ida_app_id;
+// }
+//
+// public static String getHotListClientSecret() {
+// return hotlist_client_secret;
+// }
+//
+// public static String getHotListClientId() {
+// return hotlist_client_id;
+// }
+//
+// public static String getHotListAppId() {
+// return hotlist_app_id;
+// }
+//
+ public static String getAutomationClientSecret() {
+ return automation_client_secret;
+ }
+//
+ public static String getAutomationClientId() {
+ return automation_client_id;
+ }
+//
+// public static String getAutomationAppId() {
+// return automation_app_id;
+// }
+//
+ public static String getS3Host() {
+ return s3_host;
+ }
+ public static String getReportExpirationInDays() {
+ return reportExpirationInDays;
+ }
+//
+ public static String getS3Region() {
+ return s3_region;
+ }
+//
+ public static String getS3UserKey() {
+ return s3_user_key;
+ }
+//
+ public static String getS3SecretKey() {
+ return s3_secret_key;
+ }
+//
+ public static String getS3Account() {
+ return s3_account;
+ }
+//
+ public static String getPushReportsToS3() {
+ return push_reports_to_s3;
+ }
+//
+ public static String getIdaDbUrl() {
+ return "jdbc:postgresql://" + db_domain + ":" + db_port + "/mosip_ida";
+ }
+//
+// public static String getAuditDbUrl() {
+// return "jdbc:postgresql://" + db_domain + ":" + db_port + "/mosip_audit";
+// }
+//
+ public static String getDbDriverClass() {
+ return hibernate_connection_driver_class;
+ }
+//
+ public static String getDbConnectionPoolSize() {
+ return hibernate_connection_pool_size;
+ }
+//
+ public static String getDbDialect() {
+ return hibernate_dialect;
+ }
+//
+ public static String getShowSql() {
+ return hibernate_show_sql;
+ }
+//
+ public static String getDbSessionContext() {
+ return hibernate_current_session_context_class;
+ }
+//
+// public static String getAuditDbUser() {
+// return audit_db_user;
+// }
+//
+// public static String getAuditDbPass() {
+// logger.info("DB Password from ENV::: " + System.getenv(AUDIT_DB_PASS));
+// return audit_db_pass;
+// }
+//
+// public static String getAuditDbSchema() {
+// return audit_db_schema;
+// }
+//
+// public static String getIdaDbUser() {
+// return ida_db_user;
+// }
+//
+// public static String getIdaDbPass() {
+// return ida_db_pass;
+// }
+//
+// public static String getIdaDbSchema() {
+// return ida_db_schema;
+// }
+//
+// public static String getPMSDbUrl() {
+// return "jdbc:postgresql://" + db_domain + ":" + db_port + "/mosip_pms";
+// }
+//
+// public static String getKMDbUrl() {
+// return "jdbc:postgresql://" + db_domain + ":" + db_port + "/mosip_keymgr";
+// }
+//
+ public static String getMASTERDbUrl() {
+ return "jdbc:postgresql://" + db_domain + ":" + db_port + "/mosip_master";
+ }
+//
+// public static String getPMSDbUser() {
+// return pms_db_user;
+// }
+//
+// public static String getPMSDbPass() {
+// return pms_db_pass;
+// }
+//
+// public static String getPMSDbSchema() {
+// return pms_db_schema;
+// }
+//
+// public static String getKMDbUser() {
+// return km_db_user;
+// }
+//
+// public static String getKMDbPass() {
+// return km_db_pass;
+// }
+//
+// public static String getKMDbSchema() {
+// return km_db_schema;
+// }
+//
+ public static String getMasterDbUser() {
+ return master_db_user;
+ }
+//
+ public static String getMasterDbPass() {
+ return master_db_pass;
+ }
+//
+ public static String getMasterDbSchema() {
+ return master_db_schema;
+ }
+//
+// // from docker env getting only host url
+ public static String getIAMUrl() {
+ logger.info("keycloak url from ENV::: " + System.getenv(IAM_EXTERNAL_URL) + "/auth");
+ logger.info("keycloak url from Property::: " + System.getProperty(IAM_EXTERNAL_URL) + "/auth");
+ logger.info("keycloak url from Config::: " + propsKernel.getProperty(IAM_EXTERNAL_URL) + "/auth");
+ logger.info("keycloak url is:::" + iam_external_url + "/auth");
+ return iam_external_url + "/auth";
+ }
+//
+ public static String getIAMRealmId() {
+ return iam_realm_id;
+ }
+//
+ public static String getIAMUsersToCreate() {
+ return iam_users_to_create;
+ }
+//
+ public static String getIAMUsersPassword() {
+ return iam_users_password;
+ }
+
+ public static String getRolesForUser(String userId) {
+ propsKernel = getproperty(TestRunner.getResourcePath() + "/" + "config/Kernel.properties");
+ return propsKernel.getProperty("roles." + userId);
+ }
+
+ private static Properties getproperty(String path) {
+ Properties prop = new Properties();
+ try {
+ File file = new File(path);
+ prop.load(new FileInputStream(file));
+ } catch (IOException e) {
+ logger.error("Exception " + e.getMessage());
+ }
+ return prop;
+ }
+
+// public static String getAuthDemoServiceUrl() {
+// return ConfigManager.getAuthDemoServiceBaseUrl() + ":" + ConfigManager.getAuthDemoServicePort();
+// }
+
+}
\ No newline at end of file
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/KernelAuthentication.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/KernelAuthentication.java
new file mode 100644
index 000000000..75be7f585
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/KernelAuthentication.java
@@ -0,0 +1,115 @@
+package io.mosip.testrig.pmpui.kernel.util;
+
+import java.util.Map;
+import java.util.UUID;
+
+import org.json.simple.JSONObject;
+
+import io.mosip.testrig.pmpui.kernel.service.ApplicationLibrary;
+import io.mosip.testrig.pmpui.utility.BaseTestCaseFunc;
+import io.restassured.response.Response;
+
+public class KernelAuthentication extends io.mosip.testrig.pmpui.utility.BaseTestCaseFunc {
+ private String authRequest="/config/Authorization/request.json";
+ private String authInternalRequest="config/Authorization/internalAuthRequest.json";
+ public String zonemapCookie = null;
+ String cookie;
+ static String dataKey = "response";
+ CommonLibrary clib= new CommonLibrary();
+ public final Map props = clib.readProperty("Kernel");
+ private String admin_password = props.get("admin_password");
+ private String admin_userName=props.get("admin_userName");
+ private String authenticationInternalEndpoint = props.get("authenticationInternal");
+ private ApplicationLibrary appl=new ApplicationLibrary();
+
+
+
+
+ public String getTokenByRole(String role) {
+ return getTokenByRole(role, null);
+ }
+
+ public String getTokenByRole(String role, String tokenType)
+ {
+ String insensitiveRole = null;
+ if(role!=null)
+ insensitiveRole = role.toLowerCase();
+ else return "";
+
+ switch(insensitiveRole) {
+
+ case "idrepo":
+ if(!kernelCmnLib.isValidToken(idrepoCookie))
+ idrepoCookie = kernelAuthLib.getAuthForIDREPO();
+ return idrepoCookie;
+ case "admin":
+ if(!kernelCmnLib.isValidToken(adminCookie))
+ adminCookie = kernelAuthLib.getAuthForAdmin();
+ return adminCookie;
+ case "globaladmin":
+ if(!kernelCmnLib.isValidToken(zonemapCookie))
+ zonemapCookie = kernelAuthLib.getAuthForzoneMap();
+ return zonemapCookie;
+ default:
+ if(!kernelCmnLib.isValidToken(adminCookie))
+ adminCookie = kernelAuthLib.getAuthForAdmin();
+ return adminCookie;
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ public String getAuthForIDREPO() {
+ JSONObject actualrequest = getRequestJson(authRequest);
+
+ JSONObject request=new JSONObject();
+ request.put("appId", ConfigManager.getidRepoAppId());
+ request.put("clientId", ConfigManager.getidRepoClientId());
+ request.put("secretKey", ConfigManager.getIdRepoClientSecret());
+ actualrequest.put("request", request);
+
+ Response reponse=appl.postWithJson(props.get("authclientidsecretkeyURL"), actualrequest);
+ cookie=reponse.getCookie("Authorization");
+ return cookie;
+ }
+
+ @SuppressWarnings("unchecked")
+ public String getAuthForAdmin() {
+
+ JSONObject actualrequest = getRequestJson(authInternalRequest);
+
+ JSONObject request = new JSONObject();
+ request.put("appId", ConfigManager.getAdminAppId());
+ request.put("password", admin_password);
+
+ //if(BaseTestCase.currentModule==null) admin_userName=
+ request.put("userName", BaseTestCaseFunc.currentModule +"-"+ admin_userName);
+
+ request.put("clientId", ConfigManager.getAdminClientId());
+ request.put("clientSecret", ConfigManager.getAdminClientSecret());
+ actualrequest.put("request", request);
+
+ Response reponse = appl.postWithJson(authenticationInternalEndpoint, actualrequest);
+ String responseBody = reponse.getBody().asString();
+ String token = new org.json.JSONObject(responseBody).getJSONObject(dataKey).getString("token");
+ return token;
+ }
+ @SuppressWarnings("unchecked")
+ public String getAuthForzoneMap() {
+
+ JSONObject actualrequest = getRequestJson(authInternalRequest);
+
+ JSONObject request = new JSONObject();
+ request.put("appId", ConfigManager.getAdminAppId());
+ request.put("password", props.get("admin_zone_password"));
+ request.put("userName", props.get("admin_zone_userName"));
+ request.put("clientId", ConfigManager.getAdminClientId());
+ request.put("clientSecret", ConfigManager.getAdminClientSecret());
+ actualrequest.put("request", request);
+
+ Response reponse = appl.postWithJson(authenticationInternalEndpoint, actualrequest);
+ String responseBody = reponse.getBody().asString();
+ String token = new org.json.JSONObject(responseBody).getJSONObject(dataKey).getString("token");
+ return token;
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/KeycloakUserManager.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/KeycloakUserManager.java
new file mode 100644
index 000000000..f08ec220f
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/KeycloakUserManager.java
@@ -0,0 +1,159 @@
+package io.mosip.testrig.pmpui.kernel.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Properties;
+
+import javax.ws.rs.core.Response;
+
+import org.apache.log4j.Logger;
+import org.keycloak.OAuth2Constants;
+import org.keycloak.admin.client.CreatedResponseUtil;
+import org.keycloak.admin.client.Keycloak;
+import org.keycloak.admin.client.KeycloakBuilder;
+import org.keycloak.admin.client.resource.RealmResource;
+import org.keycloak.admin.client.resource.UserResource;
+import org.keycloak.admin.client.resource.UsersResource;
+import org.keycloak.representations.idm.CredentialRepresentation;
+import org.keycloak.representations.idm.RoleRepresentation;
+import org.keycloak.representations.idm.UserRepresentation;
+
+import io.mosip.testrig.pmpui.utility.BaseTestCaseFunc;
+import io.mosip.testrig.pmpui.utility.TestRunner;
+
+public class KeycloakUserManager extends BaseTestCaseFunc {
+ public static String moduleSpecificUser = null;
+ public static String passwordCred;
+
+ private static final Logger logger = Logger.getLogger(KeycloakUserManager.class);
+
+ public static Properties propsKernel = getproperty(TestRunner.getResourcePath() + "/"+"config/Kernel.properties");
+
+ private static Keycloak getKeycloakInstance() {
+ Keycloak key=null;
+ try {
+
+ key=KeycloakBuilder.builder().serverUrl(ConfigManager.getIAMUrl()).realm(ConfigManager.getIAMRealmId())
+ .grantType(OAuth2Constants.CLIENT_CREDENTIALS).clientId(ConfigManager.getAutomationClientId()).clientSecret(ConfigManager.getAutomationClientSecret())
+ .build();
+ logger.info(ConfigManager.getIAMUrl());
+ logger.info(key.toString() + key.realms());
+ }catch(Exception e)
+ {
+ throw e;
+
+ }
+ return key;
+ }
+
+ public static Properties getproperty(String path) {
+ Properties prop = new Properties();
+ try {
+ File file = new File(path);
+ prop.load(new FileInputStream(file));
+ } catch (IOException e) {
+ logger.error("Exception " + e.getMessage());
+ }
+ return prop;
+ }
+
+ public static void createUsers() {
+
+ List needsToBeCreatedUsers = List.of(ConfigManager.getIAMUsersToCreate().split(","));
+ Keycloak keycloakInstance = getKeycloakInstance();
+ for (String needsToBeCreatedUser : needsToBeCreatedUsers) {
+ UserRepresentation user = new UserRepresentation();
+
+ if (needsToBeCreatedUser.equals("globaladmin")) {
+ moduleSpecificUser = needsToBeCreatedUser;
+ }
+ else if(needsToBeCreatedUser.equals("masterdata-220005")){
+ moduleSpecificUser = needsToBeCreatedUser;
+
+ }
+
+ else {
+ moduleSpecificUser = BaseTestCaseFunc.currentModule+"-"+ needsToBeCreatedUser;
+ }
+
+ logger.info(moduleSpecificUser);
+ user.setEnabled(true);
+ user.setUsername(moduleSpecificUser);
+ user.setFirstName(moduleSpecificUser);
+ user.setLastName(moduleSpecificUser);
+ user.setEmail("automation" + moduleSpecificUser + "@automationlabs.com");
+ // Get realm
+ RealmResource realmResource = keycloakInstance.realm(ConfigManager.getIAMRealmId());
+ UsersResource usersRessource = realmResource.users();
+ // Create user (requires manage-users role)
+ Response response = null;
+ response = usersRessource.create(user);
+ logger.info(response);
+ logger.info("Repsonse: %s %s%n"+ response.getStatus()+ response.getStatusInfo());
+ if (response.getStatus()==409) {
+ break;
+ }
+
+
+ logger.info(response.getLocation());
+ String userId = CreatedResponseUtil.getCreatedId(response);
+ logger.info("User created with userId: %s%n"+ userId);
+
+ // Define password credential
+ CredentialRepresentation passwordCred = new CredentialRepresentation();
+
+ passwordCred.setTemporary(false);
+ passwordCred.setType(CredentialRepresentation.PASSWORD);
+
+ //passwordCred.setValue(userPassword.get(passwordIndex));
+ passwordCred.setValue("mosip123");
+
+ UserResource userResource = usersRessource.get(userId);
+
+ // Set password credential
+ userResource.resetPassword(passwordCred);
+
+ // Getting all the roles
+ List allRoles = realmResource.roles().list();
+ List availableRoles = new ArrayList<>();
+ List toBeAssignedRoles = List.of(ConfigManager.getRolesForUser(needsToBeCreatedUser).split(","));
+ for(String role : toBeAssignedRoles) {
+ if(allRoles.stream().anyMatch((r->r.getName().equalsIgnoreCase(role)))){
+ availableRoles.add(allRoles.stream().filter(r->r.getName().equals(role)).findFirst().get());
+ }else {
+ logger.info("Role not found in keycloak: %s%n"+ role);
+ }
+ }
+ // Assign realm role tester to user
+ userResource.roles().realmLevel() //
+ .add((availableRoles.isEmpty() ? allRoles : availableRoles));
+
+ //passwordIndex ++;
+ }
+ }
+
+ public static void removeUser() {
+ List needsToBeRemovedUsers = List.of(ConfigManager.getIAMUsersToCreate().split(","));
+ Keycloak keycloakInstance = getKeycloakInstance();
+ for (String needsToBeRemovedUser : needsToBeRemovedUsers) {
+ String moduleSpecificUserToBeRemoved = BaseTestCaseFunc.currentModule +"-"+ needsToBeRemovedUser;
+ RealmResource realmResource = keycloakInstance.realm(ConfigManager.getIAMRealmId());
+ UsersResource usersRessource = realmResource.users();
+
+ List usersFromDB = usersRessource.search(moduleSpecificUserToBeRemoved);
+ if (!usersFromDB.isEmpty()) {
+ UserResource userResource = usersRessource.get(usersFromDB.get(0).getId());
+ userResource.remove();
+ logger.info("User removed with name: %s%n"+ moduleSpecificUserToBeRemoved);
+ } else {
+ logger.info("User not found with name: %s%n"+ moduleSpecificUserToBeRemoved);
+ }
+
+ }
+ }
+
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/S3Adapter.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/S3Adapter.java
new file mode 100644
index 000000000..c38d6f06a
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/kernel/util/S3Adapter.java
@@ -0,0 +1,221 @@
+package io.mosip.testrig.pmpui.kernel.util;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+
+import com.amazonaws.ClientConfiguration;
+import com.amazonaws.auth.AWSCredentials;
+import com.amazonaws.auth.AWSStaticCredentialsProvider;
+import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.client.builder.AwsClientBuilder;
+import com.amazonaws.services.s3.AmazonS3;
+import com.amazonaws.services.s3.AmazonS3ClientBuilder;
+import com.amazonaws.services.s3.model.ObjectMetadata;
+import com.amazonaws.services.s3.model.PutObjectRequest;
+import com.google.common.collect.ImmutableMap;
+
+//import io.mosip.kernel.core.util.StringUtils;
+
+public class S3Adapter {
+ private static final Logger logger = Logger.getLogger(S3Adapter.class);
+
+ private AmazonS3 connection = null;
+
+ private int maxRetry = 20;
+
+ private int maxConnection = 200;
+
+ private int retry = 0;
+
+ private boolean useAccountAsBucketname = true;
+
+ private static final String SEPARATOR = "/";
+
+ private int reportExpirationInDays = Integer.parseInt(ConfigManager.getReportExpirationInDays());
+
+ private List existingBuckets = new ArrayList<>();
+
+ private AmazonS3 getConnection(String bucketName) {
+ if (connection != null)
+ return connection;
+
+ logger.info("ConfigManager.getS3UserKey() :: "+ConfigManager.getS3UserKey());
+ logger.info("ConfigManager.getS3Host() :: "+ConfigManager.getS3Host());
+ logger.info("ConfigManager.getS3Region() :: "+ConfigManager.getS3Region());
+ logger.info("ConfigManager.getS3SecretKey() :: "+ConfigManager.getS3SecretKey());
+ try {
+ AWSCredentials awsCredentials = new BasicAWSCredentials(ConfigManager.getS3UserKey(),
+ ConfigManager.getS3SecretKey());
+ connection = AmazonS3ClientBuilder.standard()
+ .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).enablePathStyleAccess()
+ .withClientConfiguration(
+ new ClientConfiguration().withMaxConnections(maxConnection).withMaxErrorRetry(maxRetry))
+ .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(ConfigManager.getS3Host(),
+ ConfigManager.getS3Region()))
+ .build();
+
+ connection.doesBucketExistV2(bucketName);
+ retry = 0;
+ } catch (Exception e) {
+ if (retry >= maxRetry) {
+ // reset the connection and retry count
+ retry = 0;
+ connection = null;
+// LOGGER.error(SESSIONID, REGISTRATIONID,"Maximum retry limit exceeded. Could not obtain connection for "+ bucketName +". Retry count :" + retry, ExceptionUtils.getStackTrace(e));
+// throw new ObjectStoreAdapterException(OBJECT_STORE_NOT_ACCESSIBLE.getErrorCode(), OBJECT_STORE_NOT_ACCESSIBLE.getErrorMessage(), e);
+ } else {
+ connection = null;
+ retry = retry + 1;
+// LOGGER.error(SESSIONID, REGISTRATIONID,"Exception occured while obtaining connection for "+ bucketName +". Will try again. Retry count : " + retry, ExceptionUtils.getStackTrace(e));
+ getConnection(bucketName);
+ }
+ }
+ return connection;
+ }
+
+ /*
+ * public boolean putObject(String account, final String container, String
+ * source, String process, String objectName, File file) { String
+ * finalObjectName = null; String bucketName = null;
+ * logger.info("useAccountAsBucketname:: "+useAccountAsBucketname); if
+ * (useAccountAsBucketname) { finalObjectName = getName(container, source,
+ * process, objectName); bucketName = account; } else { finalObjectName =
+ * getName(source, process, objectName); bucketName = container; }
+ * logger.info("bucketName :: "+bucketName); AmazonS3 connection =
+ * getConnection(bucketName); if (!doesBucketExists(bucketName)) {
+ * connection.createBucket(bucketName); if (useAccountAsBucketname)
+ * existingBuckets.add(bucketName); }
+ *
+ * connection.putObject(bucketName, finalObjectName, file); return true; }
+ */
+
+ public boolean
+ putObject(String account, final String container, String source, String process, String objectName, File repotFile) {
+ String finalObjectName = null;
+ String bucketName = null;
+ boolean bReturn = false;
+ logger.info("useAccountAsBucketname:: "+useAccountAsBucketname);
+ if (useAccountAsBucketname) {
+ finalObjectName = getName(container, source, process, objectName);
+ bucketName = account;
+ } else {
+ finalObjectName = getName(source, process, objectName);
+ bucketName = container;
+ }
+ logger.info("bucketName :: "+bucketName);
+ AmazonS3 connection = getConnection(bucketName);
+ if (connection != null) {
+ if (!doesBucketExists(bucketName)) {
+ connection.createBucket(bucketName);
+ if (useAccountAsBucketname)
+ existingBuckets.add(bucketName);
+ }
+ PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, finalObjectName, repotFile);
+ ObjectMetadata objectMetadata = new ObjectMetadata();
+ objectMetadata.setHttpExpiresDate(new DateTime().plusDays(reportExpirationInDays).toDate());
+ putObjectRequest.setMetadata(objectMetadata);
+ connection.putObject(putObjectRequest);
+ bReturn = true;
+ }
+ return bReturn;
+ }
+
+ private boolean doesBucketExists(String bucketName) {
+ // use account as bucket name and bucket name is present in existing bucket list
+ if (useAccountAsBucketname && existingBuckets.contains(bucketName))
+ return true;
+ // use account as bucket name and bucket name is not present in existing bucket
+ // list
+ else if (useAccountAsBucketname && !existingBuckets.contains(bucketName)) {
+ boolean doesBucketExistsInObjectStore = connection.doesBucketExistV2(bucketName);
+ if (doesBucketExistsInObjectStore)
+ existingBuckets.add(bucketName);
+ return doesBucketExistsInObjectStore;
+ } else
+ return connection.doesBucketExistV2(bucketName);
+ }
+
+ /*
+ * public boolean reportRetentionPolicy(String bucketName) {
+ *
+ * ObjectMetadata metadata = new ObjectMetadata(); logger.info("size:" +
+ * bytes.length); metadata.setContentLength(bytes.length);
+ * metadata.setContentType(contentType); Date expirationTime = new Date(2025, 5,
+ * 10); metadata.setExpirationTime(DateTime.now().toDate());
+ * metadata.setHeader("x-amz-object-lock-retain-until-date", closerDate +
+ * "T00:00:00.000Z"); metadata.setHeader("x-amz-object-lock-mode",
+ * "COMPLIANCE"); byte[] md5 = Md5Utils.computeMD5Hash(baInputStream); String
+ * md5Base64 = BinaryUtils.toBase64(md5); metadata.setHeader("Content-MD5",
+ * md5Base64); baInputStream.reset(); PutObjectRequest putRequest = new
+ * PutObjectRequest(bucketName, finalObjectName, baInputStream, metadata);
+ * s3client.putObject(putRequest);
+ *
+ *
+ * return true;
+ *
+ * }
+ */
+
+ public static String getName(String container, String source, String process, String objectName) {
+ String finalObjectName = "";
+ if (StringUtils.isNotEmpty(container))
+ finalObjectName = container + SEPARATOR;
+ if (StringUtils.isNotEmpty(source))
+ finalObjectName = finalObjectName + source + SEPARATOR;
+ if (StringUtils.isNotEmpty(process))
+ finalObjectName = finalObjectName + process + SEPARATOR;
+
+ finalObjectName = finalObjectName + objectName;
+
+ return finalObjectName;
+ }
+
+ public static String getName(String source, String process, String objectName) {
+ String finalObjectName = "";
+ if (StringUtils.isNotEmpty(source))
+ finalObjectName = source + SEPARATOR;
+ if (StringUtils.isNotEmpty(process))
+ finalObjectName = finalObjectName + process + SEPARATOR;
+
+ finalObjectName = finalObjectName + objectName;
+
+ return finalObjectName;
+ }
+
+ public boolean putObjectWithMetadata(String account, final String container, String source, String process, String objectName, File sourcefile, ObjectMetadata metadata) {
+ String finalObjectName = null;
+ String bucketName = null;
+ boolean bReturn = false;
+
+ if (useAccountAsBucketname) {
+ finalObjectName = getName(container, source, process, objectName);
+ bucketName = account;
+ } else {
+ finalObjectName = getName(source, process, objectName);
+ bucketName = container;
+ }
+
+ AmazonS3 connection = getConnection(bucketName);
+ if (connection != null) {
+ if (!doesBucketExists(bucketName)) {
+ connection.createBucket(bucketName);
+ if (useAccountAsBucketname)
+ existingBuckets.add(bucketName);
+ }
+
+ PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, finalObjectName, sourcefile);
+ putObjectRequest.setMetadata(metadata);
+ connection.putObject(putObjectRequest);
+ bReturn = true;
+ }
+
+ return bReturn;
+ }
+
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminAuthPolicyTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminAuthPolicyTest.java
new file mode 100644
index 000000000..32b2cbfbc
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminAuthPolicyTest.java
@@ -0,0 +1,102 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.KeyEvent;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class AdminAuthPolicyTest extends BaseClass {
+
+ @Test(groups = {"AP"},dependsOnGroups = "PG")
+ public void adminAuthPolicyTest() throws InterruptedException{
+
+ test=extent.createTest("AdminAuthPolicyTest", "verify Login");
+ Commons.click(test,driver, By.id("policymenugroup"));
+ test.log(Status.INFO, "clicked on policymenugroup");
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/authpolicy/view']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='Create Policy']"));
+ Thread.sleep(3000);
+ Commons.enter(test,driver, By.id("name"), "AUTH"+data);
+ Commons.enter(test,driver, By.id("desc"), data);
+ Thread.sleep(3000);
+ Commons.dropdownbyid(test,driver, By.xpath("//mat-select[@id='policyGroupName']"),data);
+ test.log(Status.INFO, "dropdown selected");
+
+
+ String policyData;
+ try {
+ policyData = JsonUtil.JsonObjParsing(Commons.getTestData(),"policyData");
+ Commons.enter(test,driver, By.id("policies"), policyData);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Thread.sleep(3000);
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("name"), "AUTH"+data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.id("desc"), data+1);
+
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("name"), "AUTH"+data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Activate0"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+
+
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminDataSharePolicyTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminDataSharePolicyTest.java
new file mode 100644
index 000000000..fc0c3d855
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminDataSharePolicyTest.java
@@ -0,0 +1,97 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class AdminDataSharePolicyTest extends BaseClass {
+
+ @Test(groups = "DSP",dependsOnGroups = "AP")
+ public void adminDataSharePolicyTest() throws InterruptedException {
+
+ test=extent.createTest("AdminDataSharePolicyTest", "verify Login");
+ Commons.click(test,driver, By.id("policymenugroup"));
+
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/datasharepolicy/view']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='Create Policy']"));
+
+
+ Commons.enter(test,driver, By.id("name"), "DS"+data);
+ Commons.enter(test,driver, By.id("desc"), data);
+ Thread.sleep(3000);
+ Commons.dropdown(test,driver, By.xpath("//mat-select[@id='policyGroupName']"),data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Dropdoen selected");
+ String dataSharepolicyData;
+ try {
+ dataSharepolicyData = JsonUtil.JsonObjParsing(Commons.getTestData(),"dataSharepolicyData");
+ Commons.enter(test,driver, By.id("policies"), dataSharepolicyData);
+ Thread.sleep(500);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ Thread.sleep(3000);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("desc"), data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.id("desc"), data+1);
+
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("desc"), data+1);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Activate0"));
+ Thread.sleep(3000);
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+
+
+
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminDeviceDetailsTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminDeviceDetailsTest.java
new file mode 100644
index 000000000..c74370397
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminDeviceDetailsTest.java
@@ -0,0 +1,104 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class AdminDeviceDetailsTest extends BaseClass {
+
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(AdminDeviceDetailsTest.class);
+ @Test(groups = "DD",dataProvider = "data-provider-DEVICE-SBI",dependsOnGroups = {"SD","AP"})
+
+ public void adminDeviceDetailsTest(String cer) throws InterruptedException {
+
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+
+ test=extent.createTest("AdminDeviceDetailsTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/devicedetails/view']"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Approve0"));
+ //Commons.click(test,driver, By.id("Activate0"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ //Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+
+
+ Commons.dropdown(test,driver, By.id("SBIVersion"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='mapSBIVersion']"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ /*
+ Commons.filter(test,driver, By.id("make"), data);
+
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+
+ Commons.click(test,driver, By.id("Upload Certificate0"));
+
+
+ Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\partner_cert\\",cer);
+
+ Commons.filter(test,driver, By.id("make"), data);
+
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+
+ Commons.click(test,driver, By.id("View Certificate0"));
+
+ String cert=Commons.getText(driver,By.xpath("//p"));
+ logger.info(cert);
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ */
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/devicedetails/view']"));
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Reject0"));
+ test.log(Status.INFO, "Click on reject");
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminFtmDetailsTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminFtmDetailsTest.java
new file mode 100644
index 000000000..395fa6898
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminFtmDetailsTest.java
@@ -0,0 +1,104 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class AdminFtmDetailsTest extends BaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(AdminFtmDetailsTest.class);
+
+ @Test(groups = {"FD"},dataProvider = "data-provider-FTM",dependsOnGroups = "RFTM")
+ public void adminFtmDetailsTest(String cer) throws InterruptedException {
+
+ test=extent.createTest("AdminFtmDetailsTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/ftmdetails/view']"));
+
+
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ // test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.id("model"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ // test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+
+ Commons.click(test,driver, By.id("Upload Certificate0"));
+ // test.log(Status.INFO, "Upload certificate");
+
+ Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\ftm_cert\\",cer);
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+
+ Commons.click(test,driver, By.id("View Certificate0"));
+ // test.log(Status.INFO, "view certificate");
+ String cert=Commons.getText(driver,By.xpath("//p"));
+ logger.info(cert);
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ // test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Activate0"));
+ // test.log(Status.INFO, "Click on Activate");
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ // test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Deactivate0"));
+ // test.log(Status.INFO, "Click on deactivate");
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminPartnerPolicyMappingTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminPartnerPolicyMappingTest.java
similarity index 61%
rename from pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminPartnerPolicyMappingTest.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminPartnerPolicyMappingTest.java
index ea993cf57..8bc915b6e 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/AdminPartnerPolicyMappingTest.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminPartnerPolicyMappingTest.java
@@ -1,4 +1,4 @@
-package io.mosip.test.pmptest.testcase;
+package io.mosip.testrig.pmpui.testcase;
import java.util.HashMap;
import java.util.Map;
@@ -24,9 +24,12 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.Commons;
-import io.mosip.test.pmptest.utility.RealTimeReport;
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
import org.testng.annotations.Listeners;
@Listeners(RealTimeReport.class)
@@ -38,16 +41,19 @@ public void adminPartnerPolicyMappingTest(String cer) throws InterruptedExceptio
String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
String orgName=cer.substring(0, cer.length()-4);
- Commons.click(driver, By.xpath("//a[@href='#/pmp/resources/policymapping/view']"));
+ test=extent.createTest("AdminPartnerPolicyMappingTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/policymapping/view']"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Manage Policy0"));
- Commons.filter(driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
- Commons.click(driver, By.id("ellipsis-button0"));
- Commons.click(driver, By.id("Manage Policy0"));
-
- Commons.click(driver, By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmpopup"));
- Commons.click(driver, By.id("confirmmessagepopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
}
}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminPolicyGroupTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminPolicyGroupTest.java
new file mode 100644
index 000000000..c7cfa3ccf
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminPolicyGroupTest.java
@@ -0,0 +1,87 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class AdminPolicyGroupTest extends BaseClass {
+
+ @Test(groups = "PG",dependsOnGroups = "UFCC")
+ public void adminPolicyGroupTest() throws InterruptedException {
+
+
+ test=extent.createTest("AdminPolicyGroupTest", "verify Login");
+ Commons.click(test,driver, By.id("policymenugroup"));
+
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/policygroup/view']"));
+ Commons.click(test,driver, By.xpath("//button[@id='Create Policy Group']"));
+
+ Commons.enter(test,driver, By.id("name"), data);
+ Commons.enter(test,driver, By.id("desc"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+
+
+ Commons.filter(test,driver, By.id("name"), data);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.id("desc"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+
+
+ Commons.filter(test,driver, By.id("name"), data);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Deactivate0"));
+ test.log(Status.INFO, "Click on deactive");
+ Commons.click(test,driver, By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+ Commons.filter(test,driver, By.id("name"), data);
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Activate0"));
+ test.log(Status.INFO, "Click on activate");
+ Commons.click(test,driver, By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminSbiDetailsTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminSbiDetailsTest.java
new file mode 100644
index 000000000..dfc6ade25
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminSbiDetailsTest.java
@@ -0,0 +1,86 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class AdminSbiDetailsTest extends BaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(AdminSbiDetailsTest.class);
+ @Test(groups = "SD",dataProvider = "data-provider-DEVICE-SBI",dependsOnGroups = "RSD")
+ public void adminSbiDetailsTest(String cer) throws Exception {
+
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+
+ test=extent.createTest("AdminSbiDetailsTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/sbidetails/view']"));
+
+ //Commons.filter(test,driver, By.id("swVersion"),By.id("providerId"), data,orgName);
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("swVersion"),data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Reject0"));
+ test.log(Status.INFO, "Click on reject");
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("swVersion"),data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("swVersion"),data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Approve0"));
+ test.log(Status.INFO, "Click on approve");
+ Commons.click(test,driver, By.xpath("//button[@id='confirmpopup']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminUploadCaCertTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminUploadCaCertTest.java
new file mode 100644
index 000000000..e4c590af3
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/AdminUploadCaCertTest.java
@@ -0,0 +1,36 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.awt.AWTException;
+import org.openqa.selenium.By;
+
+import org.testng.annotations.Test;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+
+import org.testng.annotations.Listeners;
+
+
+public class AdminUploadCaCertTest extends BaseClass {
+
+ @Test(groups = "UFCC",dataProvider = "data-provider-ca")
+ public void adminUploadCaCertTest(String cer) throws InterruptedException, AWTException {
+
+
+
+ test=extent.createTest("AdminUploadCaCertTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[@href='#/pmp/resources/uploadcacert/upload']"));
+
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+
+
+ //Commons.enter(test,driver, By.id("custom-file-input"), System.getProperty("user.dir")+"\\ca_cert\\AUTH_ca.pem");
+
+ Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\ca_cert\\",cer);
+
+
+
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerLoginAuthCredTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerLoginAuthCredTest.java
new file mode 100644
index 000000000..f9852a7fe
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerLoginAuthCredTest.java
@@ -0,0 +1,56 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.awt.AWTException;
+import java.io.IOException;
+
+import org.openqa.selenium.By;
+// Generated by Selenium IDE
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+import io.mosip.testrig.pmpui.utility.RegisterBaseClass;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class PartnerLoginAuthCredTest extends RegisterBaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(RealTimeReport.class);
+
+ @Test(groups = "PLAC", dataProvider = "data-provider-AUTH" ,dependsOnGroups = {"PPM"})
+ public void partnerLoginAuthCredTest(String cer) throws InterruptedException, AWTException{
+ //String datetime=Commons.getDateTime();
+ test=extent.createTest("PartnerLoginAuthCredTest", "verify Login");
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+
+
+
+
+
+ driver.findElement(By.id("username")).sendKeys(orgName+data);
+ driver.findElement(By.id("password")).sendKeys(orgName+data);
+ driver.findElement(By.xpath("//input[@name=\'login\']")).click();
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Generate API Key0"));
+
+
+ Commons.enter(test,driver, By.id("apiKeyLabel"),data);
+
+ Commons.click(test,driver, By.id("generateAPIKey"));
+ String key=Commons.getText(driver,By.xpath("//p"));
+ logger.info(key);
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ test.log(Status.INFO, "Click on confirmpopup");
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterAuthCredTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterAuthCredTest.java
new file mode 100644
index 000000000..6e0d14fc1
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterAuthCredTest.java
@@ -0,0 +1,226 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.KeyEvent;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+import io.mosip.testrig.pmpui.utility.RegisterBaseClass;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class PartnerRegisterAuthCredTest extends RegisterBaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(PartnerRegisterAuthCredTest.class);
+ @Test(groups = "RAC",dataProvider = "data-provider-AUTH" , dependsOnGroups = {"UFCC","DSP"})
+ public void partnerRegisterAuthCredTest(String cer) throws InterruptedException, AWTException{
+ String datetime=Commons.getDateTime();
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+ test=extent.createTest("PartnerRegisterAuthCredTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[contains(text(),'Register')]"));
+ Commons.enter(test,driver, By.id("firstName"), datetime);
+ Commons.enter(test,driver, By.id("lastName"), datetime);
+ try {
+ Commons.enter(test,driver, By.id("organizationName"), orgName);
+ Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
+
+ if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
+ { select.selectByValue(dropdwnVal+"_PROVIDER");
+ }
+ else {
+ select.selectByValue(dropdwnVal+"_PARTNER");
+ }
+
+
+ Commons.enter(test,driver, By.id("address"), data);
+ Commons.enter(test,driver, By.id("email"), datetime+"@automationlabs.com");
+ Commons.enter(test,driver, By.id("phoneNumber"), "9178338765");
+ Commons.selOption(test,driver, By.id("user.attributes.langCode"), "English");
+ test.log(Status.INFO, "enter langcode");
+
+ Commons.enter(test,driver, By.id("username"),orgName+data);
+ Commons.enter(test,driver, By.id("password"), orgName+data);
+ Commons.enter(test,driver, By.id("password-confirm"),orgName+data);
+
+ Commons.click(test,driver, By.xpath("//input[@type='submit']"));
+
+ if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
+ {Commons.dropdown(test,driver, By.id("mat-select-0"),data);
+ Commons.click(test,driver, By.id("applyTxt"));
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.id("/pmp/home"));
+ }
+
+ Commons.click(test,driver, By.id("uploadCertificate"));
+ test.log(Status.INFO, "Click on uploadcertificate");
+ if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\auth_cert\\",cer);
+ else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\auth_cert\\",cer);
+
+
+ Commons.click(test,driver, By.id("viewCertificate"));
+
+ test.log(Status.INFO, "Click on viewcertificate");
+ String certificate=Commons.getText(driver,By.xpath("//p"));
+ logger.info(certificate);
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+ switch(dropdwnVal) {
+ case "DEVICE":
+ Commons.click(test,driver, By.id("/pmp/resources/devicedetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("deviceProviderId"),orgName);
+ Commons.dropdown(test,driver, By.id("deviceTypeCode"),By.id("Face"));
+
+ Commons.dropdown(test,driver, By.id("deviceSubTypeCode"),By.id("Full face"));
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+// SBI View
+
+ Commons.click(test,driver, By.id("/pmp/resources/sbidetails/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Create SBI']"));
+
+ Commons.dropdown(test,driver, By.id("providerId"),orgName);
+
+ Commons.enter(test,driver, By.xpath("//input[@id='swVersion']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
+ Commons.enter(test,driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("swVersion"),data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ break;
+ case "FTM":
+ Commons.click(test,driver, By.id("/pmp/resources/ftmdetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("ftpProviderId"),orgName);
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+break;
+
+
+ case "AUTH":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"AUTH"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+
+break;
+
+ case "CREDENTIAL":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"DS"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+
+
+break;
+
+ }
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterFTMTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterFTMTest.java
new file mode 100644
index 000000000..5e9890005
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterFTMTest.java
@@ -0,0 +1,225 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.KeyEvent;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+import io.mosip.testrig.pmpui.utility.RegisterBaseClass;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class PartnerRegisterFTMTest extends RegisterBaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(PartnerRegisterFTMTest.class);
+ @Test(groups = {"RFTM"},dataProvider = "data-provider-FTM" , dependsOnGroups = {"UFCC"})
+ public void partnerRegisterFTMTest(String cer) throws InterruptedException, AWTException{
+ String datetime=Commons.getDateTime();
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+ test=extent.createTest("PartnerRegisterFTMTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[contains(text(),'Register')]"));
+ Commons.enter(test,driver, By.id("firstName"), datetime);
+ Commons.enter(test,driver, By.id("lastName"), datetime);
+ try {
+ Commons.enter(test,driver, By.id("organizationName"), orgName);
+ Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
+
+ if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
+ { select.selectByValue(dropdwnVal+"_PROVIDER");
+ }
+ else {
+ select.selectByValue(dropdwnVal+"_PARTNER");
+ }
+
+
+ Commons.enter(test,driver, By.id("address"), data);
+ Commons.enter(test,driver, By.id("email"), datetime+"@automationlabs.com");
+ Commons.enter(test,driver, By.id("phoneNumber"), "9178338765");
+ Commons.selOption(test,driver, By.id("user.attributes.langCode"), "English");
+
+
+ Commons.enter(test,driver, By.id("username"),orgName+data);
+ Commons.enter(test,driver, By.id("password"), orgName+data);
+ Commons.enter(test,driver, By.id("password-confirm"),orgName+data);
+
+ Commons.click(test,driver, By.xpath("//input[@type='submit']"));
+
+ if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
+ {Commons.dropdown(test,driver, By.id("mat-select-0"),data);
+ Commons.click(test,driver, By.id("applyTxt"));
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.id("/pmp/home"));
+ }
+
+ Commons.click(test,driver, By.id("uploadCertificate"));
+ test.log(Status.INFO, "Click on uploadcertificate");
+ if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\auth_cert\\",cer);
+ else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\ftm_cert\\",cer);
+
+
+ Commons.click(test,driver, By.id("viewCertificate"));
+ test.log(Status.INFO, "Click on viewcertificate");
+
+ String certificate=Commons.getText(driver,By.xpath("//p"));
+ logger.info(certificate);
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+ switch(dropdwnVal) {
+ case "DEVICE":
+ Commons.click(test,driver, By.id("/pmp/resources/devicedetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("deviceProviderId"),orgName);
+ Commons.dropdown(test,driver, By.id("deviceTypeCode"),By.id("Face"));
+
+ Commons.dropdown(test,driver, By.id("deviceSubTypeCode"),By.id("Full face"));
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+// SBI View
+
+ Commons.click(test,driver, By.id("/pmp/resources/sbidetails/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Create SBI']"));
+
+ Commons.dropdown(test,driver, By.id("providerId"),orgName);
+
+ Commons.enter(test,driver, By.xpath("//input[@id='swVersion']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
+ Commons.enter(test,driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("swVersion"),data);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ break;
+ case "FTM":
+ Commons.click(test,driver, By.id("/pmp/resources/ftmdetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("ftpProviderId"),orgName);
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on edit");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+break;
+
+
+ case "AUTH":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"AUTH"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+ Thread.sleep(3000);
+
+break;
+
+ case "CREDENTIAL":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"DS"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+
+
+break;
+
+ }
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterSbiDeviceTest.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterSbiDeviceTest.java
new file mode 100644
index 000000000..3e3eeb299
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/PartnerRegisterSbiDeviceTest.java
@@ -0,0 +1,219 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.KeyEvent;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.Status;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+import io.mosip.testrig.pmpui.utility.RegisterBaseClass;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class PartnerRegisterSbiDeviceTest extends RegisterBaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(PartnerRegisterSbiDeviceTest.class);
+ @Test(groups = "RSD",dataProvider = "data-provider-DEVICE-SBI" , dependsOnGroups = {"UFCC","DSP"})
+ public void partnerRegisterSbiDeviceTest(String cer) throws InterruptedException, AWTException{
+ String datetime=Commons.getDateTime();
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+ test=extent.createTest("PartnerRegisterSbiDeviceTest", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[contains(text(),'Register')]"));
+ Commons.enter(test,driver, By.id("firstName"), datetime);
+ Commons.enter(test,driver, By.id("lastName"), datetime);
+ try {
+ Commons.enter(test,driver, By.id("organizationName"), orgName);
+ Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
+
+ if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
+ { select.selectByValue(dropdwnVal+"_PROVIDER");
+ }
+ else {
+ select.selectByValue(dropdwnVal+"_PARTNER");
+ }
+
+
+ Commons.enter(test,driver, By.id("address"), data);
+ Commons.enter(test,driver, By.id("email"), datetime+"@automationlabs.com");
+ Commons.enter(test,driver, By.id("phoneNumber"), "9178338765");
+ Commons.selOption(test,driver, By.id("user.attributes.langCode"), "English");
+
+
+ Commons.enter(test,driver, By.id("username"),orgName+data);
+ Commons.enter(test,driver, By.id("password"), orgName+data);
+ Commons.enter(test,driver, By.id("password-confirm"),orgName+data);
+
+ Commons.click(test,driver, By.xpath("//input[@type='submit']"));
+
+ if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
+ {Commons.dropdown(test,driver, By.id("mat-select-0"),data);
+ Commons.click(test,driver, By.id("applyTxt"));
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.id("/pmp/home"));
+ }
+
+ Commons.click(test,driver, By.id("uploadCertificate"));
+ test.log(Status.INFO, "Click on uploadCertificate");
+ if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\auth_cert\\",cer);
+ else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\device_sbi_cert\\",cer);
+
+
+ Commons.click(test,driver, By.id("viewCertificate"));
+ test.log(Status.INFO, "Click on viewCertificate");
+
+ String certificate=Commons.getText(driver,By.xpath("//p"));
+ logger.info(certificate);
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+ switch(dropdwnVal) {
+ case "DEVICE":
+ Commons.click(test,driver, By.id("/pmp/resources/devicedetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("deviceProviderId"),orgName);
+ Commons.dropdown(test,driver, By.id("deviceTypeCode"),By.id("Face"));
+
+ Commons.dropdown(test,driver, By.id("deviceSubTypeCode"),By.id("Full face"));
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ test.log(Status.INFO, "Click on filter");
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ test.log(Status.INFO, "Click on edit");
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+// SBI View
+
+ Commons.click(test,driver, By.id("/pmp/resources/sbidetails/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Create SBI']"));
+
+ Commons.dropdown(test,driver, By.id("providerId"),orgName);
+
+ Commons.enter(test,driver, By.xpath("//input[@id='swVersion']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
+ Commons.enter(test,driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("swVersion"),data);
+ Thread.sleep(3000);
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ break;
+ case "FTM":
+ Commons.click(test,driver, By.id("/pmp/resources/ftmdetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("ftpProviderId"),orgName);
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Thread.sleep(3000);
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+break;
+
+
+ case "AUTH":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"AUTH"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+
+break;
+
+ case "CREDENTIAL":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"DS"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Thread.sleep(3000);
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+ Thread.sleep(3000);
+
+
+break;
+
+ }
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/TBD.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/TBD.java
new file mode 100644
index 000000000..5e6ab7e01
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/TBD.java
@@ -0,0 +1,212 @@
+package io.mosip.testrig.pmpui.testcase;
+
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.KeyEvent;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+// Generated by Selenium IDE
+//import org.junit.Test;
+//import org.junit.Before;
+//import org.junit.After;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.Commons;
+import io.mosip.testrig.pmpui.utility.JsonUtil;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
+import io.mosip.testrig.pmpui.utility.RegisterBaseClass;
+
+import org.testng.annotations.Listeners;
+
+@Listeners(RealTimeReport.class)
+public class TBD extends RegisterBaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(TBD.class);
+ @Test(groups = "R",dataProvider = "data-provider-partner" , dependsOnGroups = {"UFCC","DSP"})
+ public void registerCRUD(String cer) throws InterruptedException, AWTException{
+ String datetime=Commons.getDateTime();
+ String dropdwnVal=cer.substring(0, cer.indexOf("_", 0));
+ String orgName=cer.substring(0, cer.length()-4);
+ test=extent.createTest("TBD", "verify Login");
+ Commons.click(test,driver, By.xpath("//a[contains(text(),'Register')]"));
+ Commons.enter(test,driver, By.id("firstName"), datetime);
+ Commons.enter(test,driver, By.id("lastName"), datetime);
+ try {
+ Commons.enter(test,driver, By.id("organizationName"), orgName);
+ Select select = new Select(driver.findElement(By.id("user.attributes.partnerType")));
+
+ if(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") )
+ { select.selectByValue(dropdwnVal+"_PROVIDER");
+ }
+ else {
+ select.selectByValue(dropdwnVal+"_PARTNER");
+ }
+
+
+ Commons.enter(test,driver, By.id("address"), data);
+ Commons.enter(test,driver, By.id("email"), datetime+"@automationlabs.com");
+ Commons.enter(test,driver, By.id("phoneNumber"), "9178338765");
+ Commons.selOption(test,driver, By.id("user.attributes.langCode"), "English");
+
+
+ Commons.enter(test,driver, By.id("username"),orgName+data);
+ Commons.enter(test,driver, By.id("password"), orgName+data);
+ Commons.enter(test,driver, By.id("password-confirm"),orgName+data);
+
+ Commons.click(test,driver, By.xpath("//input[@type='submit']"));
+
+ if(!(dropdwnVal.contains("DEVICE") || dropdwnVal.contains("FTM") ))
+ {Commons.dropdown(test,driver, By.id("mat-select-0"),data);
+ Commons.click(test,driver, By.id("applyTxt"));
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.id("/pmp/home"));
+ }
+
+ Commons.click(test,driver, By.id("uploadCertificate"));
+
+ if(dropdwnVal.contentEquals("CREDENTIAL")) Commons.uploadPartnerCert(driver,By.id("partnerDomain"),"AUTH","\\partner_cert\\",cer);
+ else Commons.uploadPartnerCert(driver,By.id("partnerDomain"),dropdwnVal,"\\partner_cert\\",cer);
+
+
+ Commons.click(test,driver, By.id("viewCertificate"));
+
+
+ String certificate=Commons.getText(driver,By.xpath("//p"));
+ logger.info(certificate);
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+ switch(dropdwnVal) {
+ case "DEVICE":
+ Commons.click(test,driver, By.id("/pmp/resources/devicedetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("deviceProviderId"),orgName);
+ Commons.dropdown(test,driver, By.id("deviceTypeCode"),By.id("Face"));
+
+ Commons.dropdown(test,driver, By.id("deviceSubTypeCode"),By.id("Full face"));
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+// SBI View
+
+ Commons.click(test,driver, By.id("/pmp/resources/sbidetails/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Create SBI']"));
+
+ Commons.dropdown(test,driver, By.id("providerId"),orgName);
+
+ Commons.enter(test,driver, By.xpath("//input[@id='swVersion']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='swCreateDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbivalidDate"));
+ Commons.enter(test,driver, By.xpath("//input[@id='swExpiryDateTime']"), JsonUtil.JsonObjParsing(Commons.getTestData(),"sbiexpiryDate"));
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ Commons.filter(test,driver, By.id("swVersion"),data);
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.xpath("//input[@id='swBinaryHash']"), data+1);
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+ break;
+ case "FTM":
+ Commons.click(test,driver, By.id("/pmp/resources/ftmdetails/view"));
+
+
+ Commons.click(test,driver, By.id("Create Device"));
+ Commons.dropdown(test,driver, By.id("ftpProviderId"),orgName);
+ Commons.enter(test,driver, By.xpath("//input[@id='make']"), data);
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+ Commons.filter(test,driver, By.id("make"),By.id("partnerOrganizationName"), data,orgName);
+ Commons.click(test,driver, By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+ Commons.enter(test,driver, By.xpath("//input[@id='model']"), data + 1);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+break;
+
+
+ case "AUTH":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"AUTH"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+
+break;
+
+ case "CREDENTIAL":
+
+
+ Commons.click(test,driver, By.id("/pmp/resources/policymapping/view"));
+ Commons.click(test,driver, By.xpath("//button[@id='Map Policy']"));
+ Commons.dropdown(test,driver, By.id("partnerId"),orgName);
+ Commons.dropdown(test,driver, By.id("policyId"),"DS"+data);
+ Commons.enter(test,driver, By.id("requestDetail"), data);
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+
+ Commons.click(test,driver, By.xpath("//button[@id='confirmmessagepopup']"));
+
+
+ Commons.filter(test,driver, By.id("requestDetail"),By.id("partnerName"), data,orgName);
+
+
+
+break;
+
+ }
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/apicall.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/apicall.java
similarity index 95%
rename from pmptest/src/main/java/io/mosip/test/pmptest/testcase/apicall.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/apicall.java
index 868768519..9d2bd30e3 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/testcase/apicall.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/testcase/apicall.java
@@ -1,4 +1,4 @@
-package io.mosip.test.pmptest.testcase;
+package io.mosip.testrig.pmpui.testcase;
import static org.testng.Assert.assertEquals;
@@ -7,8 +7,8 @@
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
-import io.mosip.test.pmptest.utility.BaseClass;
-import io.mosip.test.pmptest.utility.RealTimeReport;
+import io.mosip.testrig.pmpui.utility.BaseClass;
+import io.mosip.testrig.pmpui.utility.RealTimeReport;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import io.restassured.http.ContentType;
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/BaseClass.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/BaseClass.java
similarity index 65%
rename from pmptest/src/main/java/io/mosip/test/pmptest/utility/BaseClass.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/utility/BaseClass.java
index 95f40e61d..a462013eb 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/BaseClass.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/BaseClass.java
@@ -1,11 +1,13 @@
-package io.mosip.test.pmptest.utility;
+package io.mosip.testrig.pmpui.utility;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.lang.reflect.Method;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
+import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
@@ -22,6 +24,7 @@
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.ITest;
+import org.testng.Reporter;
// Generated by Selenium IDE
//import org.junit.Test;
//import org.junit.Before;
@@ -34,6 +37,14 @@
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.ExtentTest;
+import com.aventstack.extentreports.reporter.ExtentSparkReporter;
+
+import io.github.bonigarcia.wdm.WebDriverManager;
+import io.mosip.testrig.pmpui.kernel.util.ConfigManager;
+import io.mosip.testrig.pmpui.kernel.util.KeycloakUserManager;
+
import org.testng.annotations.DataProvider;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
@@ -42,36 +53,42 @@
public class BaseClass {
protected WebDriver driver;
protected Map vars;
- protected JavascriptExecutor js;
+ protected static JavascriptExecutor js;
protected String langcode;
- public String envPath = System.getProperty("path");
- protected String userid = System.getProperty("userid");
- protected String password = System.getProperty("password");
+ protected String envPath = ConfigManager.getiam_adminportal_path();
+ protected String env=ConfigManager.getiam_apienvuser();
+ protected String userid = KeycloakUserManager.moduleSpecificUser;
+ protected String[] allpassword = ConfigManager.getIAMUsersPassword().split(",");
+ protected String password = allpassword[0];
protected String data = Commons.appendDate;
-
+ public static ExtentSparkReporter html;
+ public static ExtentReports extent;
+ public static ExtentTest test;
public void setLangcode(String langcode) throws Exception {
this.langcode = Commons.getFieldData("langcode");
}
- @BeforeSuite
- public void report()
- {
- ExtentReportUtil.ExtentSetting();
-
-
- }
+@BeforeMethod
+
+ public void set() {
+ extent=ExtentReportManager.getReports();
+
+}
@BeforeMethod
- public void setUp() throws InterruptedException {
- System.out.println(System.getProperty("user.dir"));
- String configFilePath = System.getProperty("user.dir") + "\\chromedriver\\chromedriver.exe";
- System.setProperty("webdriver.chrome.driver", configFilePath);
-
-// ChromeOptions options = new ChromeOptions();
-// options.addArguments("--headless");
-// driver = new ChromeDriver(options);
+ public void setUp() throws Exception {
+ Reporter.log("BaseClass",true);
+ test=extent.createTest(getCommitId(),getCommitId());
+ WebDriverManager.chromedriver().setup();
+ ChromeOptions options = new ChromeOptions();
+ String headless=JsonUtil.JsonObjParsing(Commons.getTestData(),"headless");
+ if(headless.equalsIgnoreCase("yes")) {
+ options.addArguments("--headless=new");
+ }
+ ;
+ driver=new ChromeDriver(options);
- driver = new ChromeDriver();
+ //driver = new ChromeDriver(options);
js = (JavascriptExecutor) driver;
vars = new HashMap();
driver.get(envPath);
@@ -86,9 +103,9 @@ public void setUp() throws InterruptedException {
System.out.println(language1);
if(!language1.equals("sin"))
- {Commons.click(driver, By.xpath("//*[@id='kc-locale-dropdown']"));
+ {Commons.click(test,driver, By.xpath("//*[@id='kc-locale-dropdown']"));
String var = "//li/a[contains(text(),'" + language1 + "')]";
- Commons.click(driver, By.xpath(var));
+ Commons.click(test,driver, By.xpath(var));
}
//
// if(!language1.equals("sin"))
@@ -107,11 +124,12 @@ public void setUp() throws InterruptedException {
}
@AfterMethod
- public void tearDown() {
+ public void tearDown() throws InterruptedException {
//Once we will get the logout id we are going to use[TODO]
- Commons.click(driver, By.id("menuButton"));
- Commons.click(driver, By.id("Logout"));
+ Commons.click(test,driver, By.id("menuButton"));
+ Commons.click(test,driver, By.id("Logout"));
driver.quit();
+ extent.flush();
}
@DataProvider(name = "data-provider-ca")
@@ -166,5 +184,19 @@ public static String[] readFolderJsonList(String str) {
}
return contents;
}
+ private String getCommitId(){
+
+ Properties properties = new Properties();
+ try (InputStream is = ExtentReportManager.class.getClassLoader().getResourceAsStream("git.properties")) {
+ properties.load(is);
+
+ return "Commit Id is: " + properties.getProperty("git.commit.id.abbrev") + " & Branch Name is:" + properties.getProperty("git.branch");
+
+ } catch (IOException e) {
+// logger.error(e.getStackTrace());
+ return "";
+ }
+
+ }
}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/BaseTestCaseFunc.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/BaseTestCaseFunc.java
new file mode 100644
index 000000000..94afec4a4
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/BaseTestCaseFunc.java
@@ -0,0 +1,181 @@
+package io.mosip.testrig.pmpui.utility;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+import org.json.simple.JSONObject;
+
+import io.mosip.testrig.pmpui.authentication.fw.util.RestClient;
+import io.mosip.testrig.pmpui.kernel.util.CommonLibrary;
+import io.mosip.testrig.pmpui.kernel.util.ConfigManager;
+import io.mosip.testrig.pmpui.kernel.util.KernelAuthentication;
+import io.restassured.response.Response;
+
+//import org.apache.log4j.Logger;
+
+public class BaseTestCaseFunc {
+ private static String zoneMappingRequest = "config/Authorization/zoneMappingRequest.json";
+ protected static Logger logger = Logger.getLogger(BaseTestCaseFunc.class);
+ public static String environment;
+ public static List languageList = new ArrayList<>();
+ public static String ApplnURI;
+ public static String ApplnURIForKeyCloak;
+ public static String testLevel;
+ public static Properties props = getproperty(
+ TestRunner.getResourcePath() + "/" + "config/application.properties");
+ public static Properties propsKernel = getproperty(
+ TestRunner.getResourcePath() + "/" + "config/Kernel.properties");
+ public static Properties propsMap = getproperty(
+ TestRunner.getResourcePath() + "/" + "config/valueMapping.properties");
+ public static Properties propsBio = getproperty(
+ TestRunner.getGlobalResourcePath() + "/" + "config/bioValue.properties");
+ public static String SEPRATOR = "";
+ public static String currentModule = "pmpui";
+ public final static String COOKIENAME = "Authorization";
+ public static CommonLibrary kernelCmnLib = null;
+ public static KernelAuthentication kernelAuthLib = null;
+ public String adminCookie = null;
+ public String idrepoCookie = null;
+ public static Map, ?> queries;
+ public static Map, ?> residentQueries;
+ public static Map, ?> partnerQueries;
+ public static String uinEmail;
+ public static String uinPhone;
+
+
+
+ public static String getOSType() {
+ String type = System.getProperty("os.name");
+ if (type.toLowerCase().contains("windows")) {
+ SEPRATOR = "\\\\";
+ return "WINDOWS";
+ } else if (type.toLowerCase().contains("linux") || type.toLowerCase().contains("unix")) {
+ SEPRATOR = "/";
+ return "OTHERS";
+ }
+ return null;
+ }
+
+ public static List getLanguageList() {
+ logger.info("We have created a Config Manager. Beginning to read properties!");
+
+ environment = ConfigManager.getiam_apienvuser();
+ logger.info("Environemnt is ==== :" + environment);
+ ApplnURI = ConfigManager.getiam_apiinternalendpoint();
+ logger.info("Application URI ======" + ApplnURI);
+
+ logger.info("Configs from properties file are set.");
+ if (!languageList.isEmpty()) {
+ return languageList;
+ }
+ String url = ApplnURI + props.getProperty("preregLoginConfigUrl");
+ Response response = RestClient.getRequest(url, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON);
+ org.json.JSONObject responseJson = new org.json.JSONObject(response.asString());
+ org.json.JSONObject responseValue = (org.json.JSONObject) responseJson.get("response");
+ String mandatoryLanguage = (String) responseValue.get("mosip.mandatory-languages");
+
+ languageList.add(mandatoryLanguage);
+ languageList.addAll(Arrays.asList(((String) responseValue.get("mosip.optional-languages")).split(",")));
+
+ return languageList;
+ }
+
+ public static Properties getproperty(String path) {
+ Properties prop = new Properties();
+
+ try {
+ File file = new File(path);
+ prop.load(new FileInputStream(file));
+ } catch (IOException e) {
+ logger.error("Exception " + e.getMessage());
+ }
+ return prop;
+ }
+
+ public static void initialize() {
+ PropertyConfigurator.configure(getLoggerPropertyConfig());
+ kernelAuthLib = new KernelAuthentication();
+ kernelCmnLib = new CommonLibrary();
+ queries = kernelCmnLib.readProperty("adminQueries");
+ partnerQueries = kernelCmnLib.readProperty("partnerQueries");
+ residentQueries = kernelCmnLib.readProperty("residentServicesQueries");
+ /**
+ * Make sure test-output is there
+ */
+
+ getOSType();
+ logger.info("We have created a Config Manager. Beginning to read properties!");
+
+ environment = System.getProperty("env.user");
+ logger.info("Environemnt is ==== :" + environment);
+ ApplnURI = ConfigManager.getiam_apiinternalendpoint();
+ logger.info("Application URI ======" + ApplnURI);
+ ApplnURIForKeyCloak = ConfigManager.getIAMUrl();
+ logger.info("Application URI ======" + ApplnURIForKeyCloak);
+ testLevel = System.getProperty("env.testLevel");
+ logger.info("Test Level ======" + testLevel);
+ // languageList =Arrays.asList(System.getProperty("env.langcode").split(","));
+
+ // langcode = System.getProperty("env.langcode");
+ logger.info("Test Level ======" + languageList);
+
+ logger.info("Configs from properties file are set.");
+
+ }
+
+ private static Properties getLoggerPropertyConfig() {
+ Properties logProp = new Properties();
+ logProp.setProperty("log4j.rootLogger", "INFO, Appender1,Appender2");
+ logProp.setProperty("log4j.appender.Appender1", "org.apache.log4j.ConsoleAppender");
+ logProp.setProperty("log4j.appender.Appender1.layout", "org.apache.log4j.PatternLayout");
+ logProp.setProperty("log4j.appender.Appender1.layout.ConversionPattern", "%-7p %d [%t] %c %x - %m%n");
+ logProp.setProperty("log4j.appender.Appender2", "org.apache.log4j.FileAppender");
+ logProp.setProperty("log4j.appender.Appender2.File", "src/logs/mosip-api-test.log");
+ logProp.setProperty("log4j.appender.Appender2.layout", "org.apache.log4j.PatternLayout");
+ logProp.setProperty("log4j.appender.Appender2.layout.ConversionPattern", "%-7p %d [%t] %c %x - %m%n");
+ return logProp;
+ }
+
+ public static JSONObject getRequestJson(String filepath) {
+ return kernelCmnLib.readJsonData(filepath, true);
+
+ }
+ @SuppressWarnings("unchecked")
+ public static void mapUserToZone(String user, String zone) {
+ String token = kernelAuthLib.getTokenByRole("globalAdmin");
+ String url = ApplnURI + propsKernel.getProperty("zoneMappingUrl");
+ org.json.simple.JSONObject actualrequest = getRequestJson(zoneMappingRequest);
+ JSONObject request = new JSONObject();
+ request.put("zoneCode", zone);
+ request.put("userId", user);
+ request.put("langCode", BaseTestCaseFunc.getLanguageList().get(0));
+ request.put("isActive","true");
+ actualrequest.put("request", request);
+ logger.info(actualrequest);
+ Response response = RestClient.postRequestWithCookie(url, actualrequest, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_JSON, "Authorization", token);
+ logger.info(user + "Mapped to" + zone + "Zone");
+ logger.info(response);
+ }
+ public static void mapZone(String user) {
+ String token = kernelAuthLib.getTokenByRole("globalAdmin");
+ String url = ApplnURI + propsKernel.getProperty("zoneMappingActivateUrl");
+ HashMap map = new HashMap();
+ map.put("isActive","true");
+ map.put("userId", user);
+ Response response = RestClient.patchRequestWithCookieAndQueryParm(url, map, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_JSON, "Authorization", token);
+ logger.info(response);
+ }
+}
\ No newline at end of file
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/Commons.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/Commons.java
new file mode 100644
index 000000000..da7329424
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/Commons.java
@@ -0,0 +1,632 @@
+package io.mosip.testrig.pmpui.utility;
+
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.KeyEvent;
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.StaleElementReferenceException;
+import org.openqa.selenium.TimeoutException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testng.Assert;
+
+import com.aventstack.extentreports.ExtentTest;
+import com.aventstack.extentreports.MediaEntityBuilder;
+
+public class Commons extends BaseClass {
+ private static final org.slf4j.Logger logger= org.slf4j.LoggerFactory.getLogger(Commons.class);
+ public static String appendDate=getPreAppend()+getDateTime();
+ public static String getDateTime()
+ {
+
+
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MMddHHmmss");
+ LocalDateTime now = LocalDateTime.now();
+ return dtf.format(now);
+ }
+
+ public static String getUnique()
+ {
+
+
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MMddHHmm");
+ LocalDateTime now = LocalDateTime.now();
+ return dtf.format(now);
+ }
+
+ public static void filter(ExtentTest test,WebDriver driver, By by,String data) {
+ logger.info("Inside Filter " + by + data);
+ try
+ {
+ Commons.click( test,driver, By.id("Filter"));
+
+ Commons.enter(test,driver, by, data);
+ Commons.click(test,driver, By.id("applyTxt"));
+ }
+ catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+
+ }
+
+ public static void filter(ExtentTest test,WebDriver driver, By by1,By by2,String data1,String data2) throws InterruptedException {
+ logger.info("Inside Filter " + by1 + data1);
+ logger.info("Inside Filter " + by2 + data2);
+
+ Commons.click(test,driver, By.id("Filter"));
+
+ Commons.enter( test,driver, by1, data1);
+
+ Commons.enter( test,driver, by2, data2);
+ Commons.click( test,driver, By.id("applyTxt"));
+
+
+ }
+
+ public static void filterCenter(ExtentTest test,WebDriver driver, By by,String data) {
+ logger.info("Inside filterCenter " + by + data);
+ try
+ {Commons.click(test,driver, By.id("Filter"));
+
+ Commons.dropdowncenter(test,driver, by, data);
+
+ Commons.click(test,driver, By.id("applyTxt"));
+ }
+ catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+ public static void click(ExtentTest test,WebDriver driver, By by) {
+ logger.info("Clicking " + by );
+ try {
+ (new WebDriverWait(driver, 20)).until(ExpectedConditions.elementToBeClickable(by));
+ Thread.sleep(2000);
+ driver.findElement(by).click();
+ Thread.sleep(2000);
+ }catch (StaleElementReferenceException sere) {
+ // simply retry finding the element in the refreshed DOM
+ driver.findElement(by).click();
+ }
+ catch (TimeoutException toe) {
+ driver.findElement(by).click();
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ System.out.println( "Element identified by " + by.toString() + " was not clickable after 20 seconds");
+ } catch (Exception e) {
+ try {
+ test.fail(e.getMessage());
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }}
+ public static void clickWebelement(ExtentTest test,WebDriver driver, By by) throws IOException, InterruptedException {
+ logger.info("Clicking " + by );
+
+ try {
+ (new WebDriverWait(driver, 20)).until(ExpectedConditions.elementToBeClickable(by));
+ Thread.sleep(500);
+ WebElement checkbox= driver.findElement(by);
+ js.executeScript("arguments[0].click();", checkbox);
+ Thread.sleep(500);
+ }catch (StaleElementReferenceException sere) {
+ // simply retry finding the element in the refreshed DOM
+ driver.findElement(by).click();
+ }
+ }
+
+
+ public static void enter(ExtentTest test,WebDriver driver, By by,String value) {
+ logger.info("Entering " + by +value);
+ //value="10";
+ try {
+ (new WebDriverWait(driver, 20)).until(ExpectedConditions.visibilityOfElementLocated(by));
+ driver.findElement(by).clear();
+ driver.findElement(by).sendKeys(value);
+ try {
+ Thread.sleep(8);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }catch (StaleElementReferenceException sere) {
+ // simply retry finding the element in the refreshed DOM
+ driver.findElement(by).clear();
+ driver.findElement(by).sendKeys(value);
+ }
+ catch (TimeoutException toe) {
+ driver.findElement(by).clear();
+ driver.findElement(by).sendKeys(value);
+ System.out.println( "Element identified by " + by.toString() + " was not clickable after 20 seconds");
+ } }
+
+ public static void dropdown(ExtentTest test,WebDriver driver, By by)
+ {
+ logger.info("Selecting DropDown Index Zero Value " + by );
+
+ try {
+ Thread.sleep(500);
+ click(test,driver,by);//REGION
+ Thread.sleep(500);
+
+ String att= driver.findElement(by).getAttribute("aria-owns");
+ String[] list=att.split(" ");
+ click(test, driver,By.id(list[0]));
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+
+ public static void dropdown(ExtentTest test,WebDriver driver, By by,String value)
+ {
+ logger.info("Selecting DropDown By Value " + by +value );
+
+ try {
+ Thread.sleep(50);
+ click(test,driver,by);
+ Thread.sleep(50);
+ String val="'"+value +"'";
+
+ click(test,driver,By.xpath("//span[contains(text(),"+val+")]"));
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+ //option[@value,'FTM_PROVIDER']
+
+ public static void dropdownbyid(ExtentTest test,WebDriver driver, By by,String value)
+ {
+ logger.info("Selecting DropDown By Value " + by +value );
+
+ try {
+ Thread.sleep(50);
+ click(test,driver,by);
+ Thread.sleep(50);
+ String val="'"+value +"'";
+
+ click(test,driver,By.id(value));
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+ public static void selOption(ExtentTest test,WebDriver driver, By by,String value)
+ {
+ logger.info("Selecting DropDown By Value " + by +value );
+
+ try {
+ Thread.sleep(50);
+ click(test,driver,by);
+ Thread.sleep(50);
+ String val="'"+value +"'";
+ //select/option[contains(text(),'FTM Provider')]
+ // String xpath="//select/option[contains(text(),"+val+"]";
+ //clickAction(test,driver,By.xpath(xpath));
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+
+
+ public static void dropdowncenter(ExtentTest test,WebDriver driver, By by,String value)
+ {
+ logger.info("Selecting DropDown By Value " + by +value );
+
+ try {
+ Thread.sleep(50);
+ click(test,driver,by);
+ Thread.sleep(50);
+ String val="'"+value +"'";
+
+ click(test,driver,By.id(value));
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+
+ public static void dropdown(ExtentTest test,WebDriver driver, By by,By value)
+ {
+ logger.info("Selecting DropDown By Value " + by +value );
+ try {
+ Thread.sleep(50);
+ click(test,driver,by);
+ Thread.sleep(50);
+ click(test,driver,value);
+
+ Thread.sleep(500);
+
+ }catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+ public static String getTestData()
+ {
+ return JsonUtil.readJsonFileText("TestData.json");
+ }
+
+
+
+ public static String getJsonData()
+ {
+ return JsonUtil.readJsonFileText("PolicyData.json");
+ }
+
+
+
+ public static String getFieldData(String idfield) throws Exception
+ {
+ return JsonUtil.JsonObjSimpleParsing(getTestData(), idfield);
+
+ }
+
+ public static void clickSpan(ExtentTest test,WebDriver driver,String key) throws Exception {
+
+ String val=Commons.getFieldData(key);
+ String var="//span[contains(text(),'"+ val+ "')]";
+ Commons.click(test,driver,By.xpath(var));
+ logger.info("clickSpan" + var );
+
+ }
+
+ public static void deactivate(ExtentTest test,WebDriver driver) throws InterruptedException {
+
+ Commons.click(test,driver,By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Deactivate0"));
+
+ Commons.click(test,driver,By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ logger.info("Click deactivate and Confirm");
+
+
+ }
+
+ public static void activate(ExtentTest test,WebDriver driver) throws InterruptedException {
+
+ Commons.click(test,driver,By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Activate0"));
+
+ Commons.click(test,driver,By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ logger.info("Click activate and Confirm");
+ }
+
+ public static void edit(ExtentTest test,WebDriver driver,String data,By by) {
+ try
+ {Commons.click(test,driver,By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+
+ Assert.assertNotEquals(data,
+ driver.findElement(by).getText());
+ driver.findElement(by).clear();
+
+ Commons.enter(test,driver, by, data);
+
+ Commons.click(test,driver, By.id("createButton"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ logger.info("Click Edit and Confirm" + by + data);}
+ catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+
+ public static void editRes(ExtentTest test,WebDriver driver,String data,By by) {
+ try{Commons.click(test,driver,By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+
+ Assert.assertNotEquals(data,
+ driver.findElement(by).getText());
+ driver.findElement(by).clear();
+
+ Commons.enter(test,driver, by, data);
+
+ Commons.click(test,driver, By.id("createButton"));
+
+ Commons.click(test,driver,By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ logger.info("Click Edit and Confirm" + by + data);
+ }catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+ public static void editCenter(ExtentTest test,WebDriver driver,String data,By by) {
+ try{Commons.click(test,driver,By.id("ellipsis-button0"));
+ Commons.click(test,driver, By.id("Edit0"));
+
+ Assert.assertNotEquals(data,
+ driver.findElement(by).getText());
+ driver.findElement(by).clear();
+
+ Commons.enter(test,driver, by, data);
+
+ Commons.click(test,driver, By.xpath("(//*[@id='createButton'])[1]"));
+
+ Commons.click(test,driver,By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ Commons.click(test,driver, By.xpath("(//*[@id='cancel'])[1]"));
+ Commons.click(test,driver, By.xpath("(//*[@id='cancel'])[1]"));
+ logger.info("Click editCenter and Confirm" + by + data);}
+ catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+
+ public static void create(ExtentTest test,WebDriver driver) throws InterruptedException {
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+ logger.info("Click create");
+
+ }
+ public static void createRes(ExtentTest test,WebDriver driver) throws InterruptedException {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ Commons.click(test,driver, By.xpath("//button[@id='createButton']"));
+ Commons.click(test,driver,By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ logger.info("Click and confirm");
+
+
+
+ }
+
+ public static void decommission(ExtentTest test,WebDriver driver) throws InterruptedException {
+ Commons.click(test,driver,By.id("ellipsis-button0"));
+ Commons.click(test,driver,By.id("Decommission0"));
+
+ Commons.click(test,driver,By.id("confirmpopup"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ logger.info("Click decommission and confirm");
+ }
+
+ public static void clickAction(ExtentTest test,WebDriver driver, By by) {
+
+ try
+ {Actions action = new Actions(driver);
+ WebElement we=driver.findElement(by);
+ action.moveToElement(we).click().perform();
+ }
+ catch (Exception e) {
+ try {
+ test.fail(e.getMessage(), MediaEntityBuilder.createScreenCaptureFromBase64String(Screenshot.ClickScreenshot(driver)).build());
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ JavascriptExecutor executor = (JavascriptExecutor) driver;
+ executor.executeScript("arguments[0].click();", driver.findElement(by));
+
+ }
+ }
+
+
+
+
+ public static String getText(WebDriver driver, By by) {
+ String str=driver.findElement(by).getText();
+ return str;
+ }
+
+ public static void uploadPartnerCertold(WebDriver driver, By by,String orgName,String folder,String str) throws InterruptedException {
+ // TODO Auto-generated method stub
+
+ Commons.dropdown(test,driver, by, By.id(orgName)
+ );
+try {
+ Thread.sleep(5000);
+} catch (InterruptedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+}
+ Commons.clickAction(test,driver, By.xpath("//*[@type='button']"));
+
+ String filePath=null;;
+ try {
+ filePath = System.getProperty("user.dir") + folder+str ;
+ } catch (Exception e) {
+
+ // TODO Auto-generated catch block;
+ e.printStackTrace();
+ }
+ StringSelection ss = new StringSelection(filePath);
+ Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
+ Robot robot;
+ try {
+ robot = new Robot();
+ robot.delay(250);
+ robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER);
+ robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_V);
+ robot.keyRelease(KeyEvent.VK_V); robot.delay(250);
+ robot.keyRelease(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_ENTER);
+ robot.delay(250); robot.keyRelease(KeyEvent.VK_ENTER); robot.delay(250);
+ Commons.click(test,driver, By.id("createButton"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+ } catch (AWTException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public static void uploadPartnerCert(WebDriver driver, By by,String orgName,String folder,String str) throws InterruptedException {
+ // TODO Auto-generated method stub
+
+ Commons.dropdown(test,driver, by, By.id(orgName)
+ );
+try {
+ Thread.sleep(5000);
+} catch (InterruptedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+}
+
+
+ String filePath=null;;
+ try {
+ filePath = System.getProperty("user.dir") + folder+str ;
+ Commons.enter(test, driver, By.id("fileInput"), filePath);
+ } catch (Exception e) {
+
+ // TODO Auto-generated catch block;
+ e.printStackTrace();
+ }
+
+ Commons.click(test,driver, By.id("createButton"));
+ Commons.click(test,driver, By.id("confirmmessagepopup"));
+
+
+ }
+ public static String getPreAppend()
+ {
+ String preappend = null;
+ try {
+ preappend = JsonUtil.JsonObjParsing(getTestData(),"preappend");
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return preappend;
+ }
+}
+
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/DateUtil.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/DateUtil.java
similarity index 88%
rename from pmptest/src/main/java/io/mosip/test/pmptest/utility/DateUtil.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/utility/DateUtil.java
index 8b4f1f4ec..441991568 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/DateUtil.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/DateUtil.java
@@ -1,4 +1,4 @@
-package io.mosip.test.pmptest.utility;
+package io.mosip.testrig.pmpui.utility;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/ExtentReportManager.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/ExtentReportManager.java
new file mode 100644
index 000000000..f9accfd0f
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/ExtentReportManager.java
@@ -0,0 +1,27 @@
+package io.mosip.testrig.pmpui.utility;
+
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.ExtentTest;
+import com.aventstack.extentreports.reporter.ExtentSparkReporter;
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.ExtentTest;
+
+public class ExtentReportManager {
+ public static ExtentSparkReporter html;
+ public static String Filepath;
+ public static ExtentReports extent;
+ //public static WebDriver driver;
+ public static ExtentTest test;
+ public static ExtentReports getReports() {
+ if(extent==null) {
+ extent=new ExtentReports();
+ extent=new ExtentReports();
+ Filepath=System.getProperty("user.dir")+"/Reports/"+"pmp-ui-report-"+Commons.appendDate+".html";
+ html=new ExtentSparkReporter(Filepath);
+ extent.attachReporter(html);
+ }
+
+ return extent;
+
+ }
+}
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/JsonUtil.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/JsonUtil.java
similarity index 99%
rename from pmptest/src/main/java/io/mosip/test/pmptest/utility/JsonUtil.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/utility/JsonUtil.java
index d99477d05..04b83aeaf 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/JsonUtil.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/JsonUtil.java
@@ -1,4 +1,4 @@
-package io.mosip.test.pmptest.utility;
+package io.mosip.testrig.pmpui.utility;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/PropertiesUtil.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/PropertiesUtil.java
similarity index 95%
rename from pmptest/src/main/java/io/mosip/test/pmptest/utility/PropertiesUtil.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/utility/PropertiesUtil.java
index e0e653461..c921dece3 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/PropertiesUtil.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/PropertiesUtil.java
@@ -1,5 +1,5 @@
-package io.mosip.test.pmptest.utility;
+package io.mosip.testrig.pmpui.utility;
import java.io.*;
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/RealTimeReport.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/RealTimeReport.java
similarity index 96%
rename from pmptest/src/main/java/io/mosip/test/pmptest/utility/RealTimeReport.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/utility/RealTimeReport.java
index d0eacebac..180e95c3f 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/RealTimeReport.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/RealTimeReport.java
@@ -1,4 +1,4 @@
-package io.mosip.test.pmptest.utility;
+package io.mosip.testrig.pmpui.utility;
import org.testng.ITestContext;
diff --git a/pmptest/src/main/java/io/mosip/test/pmptest/utility/RegisterBaseClass.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/RegisterBaseClass.java
similarity index 54%
rename from pmptest/src/main/java/io/mosip/test/pmptest/utility/RegisterBaseClass.java
rename to pmptest/src/main/java/io/mosip/testrig/pmpui/utility/RegisterBaseClass.java
index 24d7d8a25..ec95e81b6 100644
--- a/pmptest/src/main/java/io/mosip/test/pmptest/utility/RegisterBaseClass.java
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/RegisterBaseClass.java
@@ -1,11 +1,13 @@
-package io.mosip.test.pmptest.utility;
+package io.mosip.testrig.pmpui.utility;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.lang.reflect.Method;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
+import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
@@ -22,18 +24,29 @@
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.ITest;
+import org.testng.Reporter;
// Generated by Selenium IDE
//import org.junit.Test;
//import org.junit.Before;
//import org.junit.After;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
+import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.ExtentTest;
+import com.aventstack.extentreports.reporter.ExtentSparkReporter;
+
+import io.github.bonigarcia.wdm.WebDriverManager;
+import io.mosip.testrig.pmpui.kernel.util.ConfigManager;
+import io.mosip.testrig.pmpui.kernel.util.KeycloakUserManager;
+import io.mosip.testrig.pmpui.kernel.util.S3Adapter;
+
import org.testng.annotations.DataProvider;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
@@ -44,30 +57,40 @@ public class RegisterBaseClass {
protected Map vars;
protected JavascriptExecutor js;
protected String langcode;
- protected String envPath = System.getProperty("path");
- protected String userid = System.getProperty("userid");
- protected String password = System.getProperty("password");
+ protected String envPath = ConfigManager.getiam_adminportal_path();
+ protected String env=ConfigManager.getiam_apienvuser();
+ protected String userid = KeycloakUserManager.moduleSpecificUser;
+ protected String[] allpassword = ConfigManager.getIAMUsersPassword().split(",");
+ protected String password = allpassword[0];
protected String data = Commons.appendDate;
-
+ public static ExtentSparkReporter html;
+ public static ExtentReports extent;
+ public static ExtentTest test;
public void setLangcode(String langcode) throws Exception {
this.langcode = Commons.getFieldData("langcode");
}
- @BeforeSuite
- public void report()
- {
- ExtentReportUtil.ExtentSetting();
-
-
- }
+
+@BeforeMethod
+
+ public void set() {
+ extent=ExtentReportManager.getReports();
+
+}
@BeforeMethod
- public void setUp() throws InterruptedException {
- System.out.println(System.getProperty("user.dir"));
- String configFilePath = System.getProperty("user.dir") + "\\chromedriver\\chromedriver.exe";
- System.setProperty("webdriver.chrome.driver", configFilePath);
+ public void setUp() throws Exception {
+ Reporter.log("BaseClass",true);
+ test=extent.createTest(getCommitId(),getCommitId());
+
+ WebDriverManager.chromedriver().setup();
+ ChromeOptions options = new ChromeOptions();
+ String headless=JsonUtil.JsonObjParsing(Commons.getTestData(),"headless");
+ if(headless.equalsIgnoreCase("yes")) {
+ options.addArguments("--headless=new");
+ }
- driver = new ChromeDriver();
+ driver = new ChromeDriver(options);
js = (JavascriptExecutor) driver;
vars = new HashMap();
driver.get(envPath);
@@ -79,12 +102,43 @@ public void setUp() throws InterruptedException {
}
@AfterMethod
- public void tearDown() {
- Commons.click(driver, By.id("menuButton"));
- Commons.click(driver, By.id("Logout"));
+ public void tearDown() throws InterruptedException {
+ Commons.click(test,driver, By.id("menuButton"));
+ Commons.click(test,driver, By.id("Logout"));
driver.quit();
+ extent.flush();
}
+ @AfterSuite
+ public void pushFileToS3() {
+ getCommitId();
+ if (ConfigManager.getPushReportsToS3().equalsIgnoreCase("yes")) {
+ // EXTENT REPORT
+
+ File repotFile = new File(ExtentReportManager.Filepath);
+ System.out.println("reportFile is::" + repotFile);
+ String reportname = repotFile.getName();
+
+
+ S3Adapter s3Adapter = new S3Adapter();
+ boolean isStoreSuccess = false;
+ try {
+ isStoreSuccess = s3Adapter.putObject(ConfigManager.getS3Account(), BaseTestCaseFunc.testLevel, null,
+ "PmpUi",env+BaseTestCaseFunc.currentModule+data+".html", repotFile);
+
+ System.out.println("isStoreSuccess:: " + isStoreSuccess);
+ } catch (Exception e) {
+ System.out.println("error occured while pushing the object" + e.getLocalizedMessage());
+ e.printStackTrace();
+ }
+ if (isStoreSuccess) {
+ System.out.println("Pushed file to S3");
+ } else {
+ System.out.println("Failed while pushing file to S3");
+ }
+ }
+
+ }
// @DataProvider(name = "data-provider-partner")
// public Object[] dpMethod() {
// String listFilename[] = readFolderJsonList();
@@ -134,6 +188,21 @@ public static String[] readFolderJsonList(String str) {
return contents;
}
+ private String getCommitId(){
+
+ Properties properties = new Properties();
+ try (InputStream is = ExtentReportManager.class.getClassLoader().getResourceAsStream("git.properties")) {
+ properties.load(is);
+
+ return "Commit Id is: " + properties.getProperty("git.commit.id.abbrev") + " & Branch Name is:" + properties.getProperty("git.branch");
+
+ } catch (IOException e) {
+// logger.error(e.getStackTrace());
+ return "";
+ }
+
+ }
+
// public static String[] readFolderJsonList() {
// String contents[] = null;
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/Screenshot.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/Screenshot.java
new file mode 100644
index 000000000..2997af2b7
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/Screenshot.java
@@ -0,0 +1,54 @@
+package io.mosip.testrig.pmpui.utility;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Base64;
+
+import org.apache.commons.io.IOUtils;
+import org.openqa.selenium.OutputType;
+import org.openqa.selenium.TakesScreenshot;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.io.FileHandler;
+
+//import com.aspose.cells.Workbook;
+import com.aventstack.extentreports.ExtentTest;
+
+
+
+public class Screenshot {
+
+ public static String ClickScreenshot(WebDriver driver) throws IOException {
+ TakesScreenshot ss=(TakesScreenshot)driver;
+ File so=ss.getScreenshotAs(OutputType.FILE);
+ String path=System.getProperty("user.dir")+"/Screenshots/"+System.currentTimeMillis()+".png";
+ File des=new File(path);
+ FileHandler.copy(so, des);
+ FileInputStream fis=new FileInputStream(path);
+ byte[] bytes =IOUtils.toByteArray(fis);
+ String base64img=Base64.getEncoder().encodeToString(bytes);
+
+
+ return base64img;
+
+ }
+// public static String Attachfile(ExtentTest test,String n) {
+// try {
+// String up="C:\\Users\\jayesh.kharode\\Downloads\\"+n+".csv";
+// Workbook workbook = new Workbook(up);
+// String path=System.getProperty("user.dir")+"/Export/"+System.currentTimeMillis()+".png";
+// workbook.save(path);
+// FileInputStream fis=new FileInputStream(path);
+// byte[] bytes =IOUtils.toByteArray(fis);
+// String base64img=Base64.getEncoder().encodeToString(bytes);
+// return base64img;
+//
+// }catch(Exception e) {
+// test.fail(e.getMessage());
+// }
+//
+// return null;
+//
+// }
+//
+}
diff --git a/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/TestRunner.java b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/TestRunner.java
new file mode 100644
index 000000000..486a38b6a
--- /dev/null
+++ b/pmptest/src/main/java/io/mosip/testrig/pmpui/utility/TestRunner.java
@@ -0,0 +1,94 @@
+package io.mosip.testrig.pmpui.utility;
+
+import java.io.File;
+import java.util.List;
+
+import org.testng.TestListenerAdapter;
+import org.testng.TestNG;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+import io.mosip.testrig.pmpui.fw.util.AdminTestUtil;
+import io.mosip.testrig.pmpui.testcase.AdminAuthPolicyTest;
+import io.mosip.testrig.pmpui.testcase.AdminDataSharePolicyTest;
+import io.mosip.testrig.pmpui.testcase.AdminDeviceDetailsTest;
+import io.mosip.testrig.pmpui.testcase.AdminFtmDetailsTest;
+import io.mosip.testrig.pmpui.testcase.AdminPartnerPolicyMappingTest;
+import io.mosip.testrig.pmpui.testcase.AdminPolicyGroupTest;
+import io.mosip.testrig.pmpui.testcase.AdminSbiDetailsTest;
+import io.mosip.testrig.pmpui.testcase.AdminUploadCaCertTest;
+import io.mosip.testrig.pmpui.testcase.PartnerLoginAuthCredTest;
+import io.mosip.testrig.pmpui.testcase.PartnerRegisterAuthCredTest;
+import io.mosip.testrig.pmpui.testcase.PartnerRegisterFTMTest;
+import io.mosip.testrig.pmpui.testcase.PartnerRegisterSbiDeviceTest;
+import io.mosip.testrig.pmpui.testcase.TBD;
+import io.mosip.testrig.pmpui.testcase.apicall;
+
+
+public class TestRunner {
+ private static final Logger logger = Logger.getLogger(TestRunner.class);
+ public static String jarUrl = TestRunner.class.getProtectionDomain().getCodeSource().getLocation().getPath();
+ static TestListenerAdapter tla = new TestListenerAdapter();
+
+
+ static TestNG testNg;
+
+ public static void main(String[] args) throws Exception {
+ AdminTestUtil.initialize();
+
+ testNg=new TestNG();
+
+ String listExcludedGroups=JsonUtil.JsonObjParsing(Commons.getTestData(),"setExcludedGroups");
+ testNg.setExcludedGroups(listExcludedGroups);
+ //testNg.setPreserveOrder(true);
+ testNg.setTestClasses(new Class[] {
+ AdminAuthPolicyTest.class,
+ AdminDataSharePolicyTest.class,
+ AdminDeviceDetailsTest.class,
+ AdminFtmDetailsTest.class,
+ AdminPartnerPolicyMappingTest.class,
+ AdminPolicyGroupTest.class,
+ AdminSbiDetailsTest.class,
+ AdminUploadCaCertTest.class,
+ PartnerLoginAuthCredTest.class,
+ PartnerRegisterAuthCredTest.class,
+ PartnerRegisterFTMTest.class,
+ PartnerRegisterSbiDeviceTest.class,apicall.class
+
+ });
+ testNg.run();
+
+ }
+ public static String getGlobalResourcePath() {
+ if (checkRunType().equalsIgnoreCase("JAR")) {
+ return new File(jarUrl).getParentFile().getAbsolutePath().toString();
+ } else if (checkRunType().equalsIgnoreCase("IDE")) {
+ String path = new File(TestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath()
+ .toString();
+ if (path.contains("test-classes"))
+ path = path.replace("test-classes", "classes");
+ return path;
+ }
+ return "Global Resource File Path Not Found";
+ }
+
+ public static String getResourcePath() {
+ if (checkRunType().equalsIgnoreCase("JAR")) {
+ return new File(jarUrl).getParentFile().getAbsolutePath();
+ } else if (checkRunType().equalsIgnoreCase("IDE")) {
+ String path = new File(TestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath()
+ .toString();
+ if (path.contains("test-classes"))
+ path = path.replace("test-classes", "classes");
+ return path;
+ }
+ return "Global Resource File Path Not Found";
+ }
+
+ public static String checkRunType() {
+ if (TestRunner.class.getResource("TestRunner.class").getPath().toString().contains(".jar"))
+ return "JAR";
+ else
+ return "IDE";
+ }
+
+}
diff --git a/pmptest/src/main/resources/config/Authorization/internalAuthRequest.json b/pmptest/src/main/resources/config/Authorization/internalAuthRequest.json
new file mode 100644
index 000000000..57aa8f2f6
--- /dev/null
+++ b/pmptest/src/main/resources/config/Authorization/internalAuthRequest.json
@@ -0,0 +1,13 @@
+{
+ "id": "string",
+ "version": "string",
+ "requesttime": "2022-01-13T06:07:20.554Z",
+ "metadata": {},
+ "request": {
+ "userName": "110005",
+ "password": "mosip",
+ "appId": "admin",
+ "clientId": "mosip-admin-client",
+ "clientSecret": "xyz123"
+ }
+}
\ No newline at end of file
diff --git a/pmptest/src/main/resources/config/Authorization/request.json b/pmptest/src/main/resources/config/Authorization/request.json
new file mode 100644
index 000000000..57831153b
--- /dev/null
+++ b/pmptest/src/main/resources/config/Authorization/request.json
@@ -0,0 +1,11 @@
+{
+ "id": "string",
+ "metadata": {},
+ "request": {
+ "appId": "prereg",
+ "password": "prereguser",
+ "userName": "prereguser"
+ },
+ "requesttime": "2019-04-10T10:00:00.000Z",
+ "version": "string"
+}
\ No newline at end of file
diff --git a/pmptest/src/main/resources/config/Authorization/zoneMappingRequest.json b/pmptest/src/main/resources/config/Authorization/zoneMappingRequest.json
new file mode 100644
index 000000000..c7e5fbce5
--- /dev/null
+++ b/pmptest/src/main/resources/config/Authorization/zoneMappingRequest.json
@@ -0,0 +1,12 @@
+{
+ "id": "string",
+ "metadata": {},
+ "request": {
+ "zoneCode": "CSB",
+ "userId": "110123",
+ "isActive": true,
+ "langCode": "eng"
+ },
+ "requesttime": "2022-05-09T09:52:11.969Z",
+ "version": "string"
+}
\ No newline at end of file
diff --git a/pmptest/src/main/resources/config/Kernel.properties b/pmptest/src/main/resources/config/Kernel.properties
new file mode 100644
index 000000000..479659dc3
--- /dev/null
+++ b/pmptest/src/main/resources/config/Kernel.properties
@@ -0,0 +1,113 @@
+#Kernel resource uris
+#Make sure all resource apis are covered
+authenticationInternal=/v1/authmanager/authenticate/internal/useridPwd
+zoneMappingUrl=/v1/masterdata/zoneuser
+zoneNameUrl=/v1/masterdata/zones/zonename
+zoneMappingActivateUrl=/v1/masterdata/zoneuser
+userCenterMappingUrl=/v1/masterdata/usercentermapping
+bulkUploadUrl=/v1/admin/bulkupload
+#Below users are used for authentication
+#PARTNER
+#Dont change the partner id
+#IDREPO
+mosip_idrepo_app_id=idrepo
+mosip_idrepo_client_id=mosip-idrepo-client
+mosip_idrepo_client_secret=wJ21F8gXzdy2RM9q
+#IDREPO
+mosip_idrepo_app_id=idrepo
+mosip_idrepo_client_id=mosip-idrepo-client
+mosip_idrepo_client_secret=wJ21F8gXzdy2RM9q
+keycloak-realm-id=mosip
+keycloak-external-url=https://iam.dev3.mosip.net
+mosip_testrig_client_id=mosip-testrig-client
+mosip_testrig_client_secret=aOCfcQC2dYm2Iotg
+admin
+mosip_admin_app_id=admin
+admin_password=mosip123
+admin_userName=auto12
+mosip_admin_client_id=mosip-admin-client
+mosip_admin_client_secret=7Vvj405Z5a35eAod
+#admin
+admin_zone_password=mosip123
+admin_zone_userName=globaladmin
+mosip_regclient_app_id=registrationclient
+mosip_reg_client_id=mosip-reg-client
+mosip_reg_client_secret=SGqovDBMh7McnAxw
+iam-users-to-create=auto12,globaladmin
+#iam-users-to-create=111997,220005,111992
+iam-users-password=mosip123,mosip123
+roles.auto12=GLOBAL_ADMIN,ID_AUTHENTICATION,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN
+roles.globaladmin=GLOBAL_ADMIN,REGISTRATION_ADMIN,uma_authorization,ZONAL_ADMIN,default-roles-mosip
+partner_url=jdbc:postgresql://dev3.mosip.net:5432/mosip_ida
+#----------------------------------Database properties----------------------------------------------------------#
+postgresqlUser=postgresql
+db-port=5432
+db-server=dev3.mosip.net
+hibernate.connection.driver_class=org.postgresql.Driver
+hibernate.connection.pool_size=1
+hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
+hibernate.show_sql=true
+hibernate.current_session_context_class=thread
+db-su-user=postgres
+postgresql-password=rLqRHeY4C5
+pms_db_schema=pms
+km_db_schema=keymgr
+master_db_schema=master
+audit_db_schema=audit
+ida_db_schema=ida
+db-server=dev3.mosip.net
+keycloak-external-url=https://iam.dev3.mosip.net
+audit_url=jdbc:postgresql://dev3.mosip.net:5432/mosip_audit
+driver_class=org.postgresql.Driver
+pool_size=1
+dialect=org.hibernate.dialect.PostgreSQLDialect
+show_sql=true
+current_session_context_class=thread
+db-su-user=postgres
+postgresql-password=rLqRHeY4C5
+postgresqlUser=postgresql
+db-port=5432
+db-server=dev3.mosip.net
+
+
+s3-user-key=admin
+s3-user-secret=password
+s3-host=http://127.0.0.1:9000
+s3-account=uiautomation
+s3-region=null
+reportExpirationInDays=3
+# supported values yes or no
+push-reports-to-s3=yes
+enableDebug=no
+# supported values are 1 to 8
+threadCount=1
+# supported values are 0 ,1, 2 based on number of env languages
+langselect=0
+#----------------------------------AuthDemoService Host properties----------------------------------------------------------#
+#To run locally
+authDemoServiceBaseURL=http://localhost
+authDemoServicePort=8082
+
+#To run in Docker
+#authDemoServiceBaseURL=http://authdemo.apitestrig
+#authDemoServicePort=80
+
+
+#----------------------------------IdP properties----------------------------------------------------------#
+
+currentUserURI=/#/uinservices/viewhistory
+actuatorEndpoint=/resident/v1/actuator/env
+actuatorIDAEndpoint=/idauthentication/v1/actuator/env
+actuatorRegprocEndpoint=/registrationprocessor/v1/registrationtransaction/actuator/env
+tokenEndpoint=/v1/esignet/oauth/token
+validateBindingEndpoint=esignet-binding
+
+#To run in Docker
+#authCertsPath=/home/mosip/authcerts
+
+#To run locally
+authCertsPath=
+
+PmpPortalPath=https://pmp.dev3.mosip.net/
+apiEnvUser=api-internal.dev3
+apiInternalEndPoint=https://api-internal.dev3.mosip.net
diff --git a/pmptest/src/main/resources/config/Kernel123.properties b/pmptest/src/main/resources/config/Kernel123.properties
new file mode 100644
index 000000000..fd7f50b29
--- /dev/null
+++ b/pmptest/src/main/resources/config/Kernel123.properties
@@ -0,0 +1,244 @@
+#Kernel resource uris
+#Make sure all resource apis are covered
+authclientidsecretkeyURL=/v1/authmanager/authenticate/clientidsecretkey
+authentication=/v1/authmanager/authenticate/useridPwd
+authenticationInternal=/v1/authmanager/authenticate/internal/useridPwd
+keycloakAuthURL=/auth/realms/master/protocol/openid-connect/token
+auditLog_URI = /v1/auditmanager/audits
+CentetMachineUserMappingToMasterData_uri= /v1/masterdata/registrationmachineusermappings
+EmailNotification_URI= /v1/notifier/email/send
+encrypt_URI=/v1/keymanager/encrypt
+decrypt_URI=/v1/keymanager/decrypt
+FetchApplication_URI=/v1/masterdata/applicationtypes
+FetchApplication_lang_URI=/v1/masterdata/applicationtypes/{langcode}
+FetchApplication_id_lang_URI=/v1/masterdata/applicationtypes/{code}/{langcode}
+FetchBiometricAttribute_URI=/v1/masterdata/getbiometricattributesbyauthtype/{langcode}/{biometrictypecode}
+FetchBiometricAuthType_URI=/v1/masterdata/biometrictypes/{langcode}
+FetchBlackListedWord_URI=/v1/masterdata/blacklistedwords/{langcode}
+FetchDevice_lang_URI = /v1/masterdata/devices/{languagecode}
+FetchDevice_id_lang_URI = /v1/masterdata/devices/{languagecode}/{deviceType}
+FetchDeviceSpec_lang_URI = /v1/masterdata/devicespecifications/{langcode}
+FetchDeviceSpec_id_lang_URI = /v1/masterdata/devicespecifications/{langcode}/{devicetypecode}
+FetchDocumentCategories_URI = /v1/masterdata/documentcategories/{langcode}
+FetchDocumentCategories_URI_withcodeAndLangCode = /v1/masterdata/documentcategories/{code}/{langcode}
+FetchDocumentTypes_URI = /v1/masterdata/documenttypes/{documentcategorycode}/{langcode}
+FetchGenderType_URI = /v1/masterdata/gendertypes
+FetchGenderType_id_lang_URI = /v1/masterdata/gendertypes/{langcode}
+FetchHolidays_URI = /v1/masterdata/holidays
+FetchHolidays_id_URI = /v1/masterdata/holidays/{holidayid}
+FetchHolidays_id_lang_URI = /v1/masterdata/holidays/{holidayid}/{langcode}
+FetchIDlist_URI = /v1/masterdata/idtypes/{langcode}
+FetchLocationHierarchy_URI_withlangCode = /v1/masterdata/locations/{langcode}
+FetchLocationHierarchy_URI_locationcode = /v1/masterdata/locations/{locationcode}/{langcode}
+FetchLocationHierarchy_URI_hierarchyname = /v1/masterdata/locations/locationhierarchy/{hierarchyname}
+FetchMachine_URI=/v1/masterdata/machines
+FetchMachine_lang_URI=/v1/masterdata/machines/{langcode}
+FetchMachine_id_lang_URI=/v1/masterdata/machines/{id}/{langcode}
+FetchMachineHistory_URI = /v1/masterdata/machineshistories/{id}/{langcode}/{effdatetimes}
+FetchRegCent_URI = /v1/masterdata/registrationcenters
+FetchRegCent_id_lang_URI = /v1/masterdata/registrationcenters/{id}/{langcode}
+FetchRegCent_loc_lang_URI = /v1/masterdata/getlocspecificregistrationcenters/{langcode}/{locationcode}
+FetchRegCent_hir_name_lang_URI = /v1/masterdata/registrationcenters/{langcode}/{hierarchylevel}/{name}
+FetchRegCent_prox_lang_URI = /v1/masterdata/getcoordinatespecificregistrationcenters/{langcode}/{longitude}/{latitude}/{proximitydistance}
+FetchRegCentHistory_URI = /v1/masterdata/registrationcentershistory/{registrationCenterId}/{langcode}/{effectiveDate}
+FetchRegCentHolidays_URI = /v1/masterdata/getregistrationcenterholidays/{langcode}/{registrationcenterid}/{year}
+FetchRegcentMachUserMaping_URI = /v1/masterdata/getregistrationmachineusermappinghistory/{effdtimes}/{registrationcenterid}/{machineid}/{userid}
+FetchRejectionReason_URI = /v1/masterdata/packetrejectionreasons/{reasoncategorycode}/{langcode}
+FetchTemplate_URI = /v1/masterdata/templates
+FetchTemplate_lang_URI = /v1/masterdata/templates/{langcode}
+FetchTemplate_id_lang_URI = /v1/masterdata/templates/{langcode}/{templatetypecode}
+FetchTitle_URI = /v1/masterdata/title/{langcode}
+fetchAllTemplate = /v1/masterdata/templates/templatetypecodes/{code}
+getApplicantType = /v1/masterdata/getApplicantType
+fetchDeviceHistory = /v1/masterdata/deviceshistories/{id}/{langcode}/{effdatetimes}
+getDocType_DocCatByAppID = /v1/masterdata/applicanttype/{applicantId}/languages
+getDocTypeDocCatByLangCode = /v1/masterdata/validdocuments/{languagecode}
+fetchImmediateChildLocation = /v1/masterdata/locations/immediatechildren/{locationcode}/{langcode}
+getIndividualType = /v1/masterdata/individualtypes
+getRoles = /v1/syncdata/roles
+fetchRegCenter = /v1/masterdata/registrationcenters/validate/{id}/{langCode}/{timestamp}
+fetchRegistrationCenterDeviceHistory = /v1/masterdata/registrationcenterdevicehistory/{regcenterid}/{deviceid}/{effdatetimes}
+getusersBasedOnRegCenter = /v1/syncdata/userdetails/{regid}
+licKeyGenerator = /v1/keymanager/license/generate
+mapLicenseKey = /v1/keymanager/license/permission
+fetchmapLicenseKey = /v1/keymanager/license/permission
+OTPGeneration = /v1/otpmanager/otp/generate
+OTPValidation = /v1/otpmanager/otp/validate
+otpNotifier = /v1/otpnotifier/otp/send
+RIDGenerator_URI = /v1/ridgenerator/generate/rid/{centerid}/{machineid}
+SmsNotification_URI = /v1/notifier/sms/send
+syncConf = /v1/syncdata/configs
+fetchIncrementalData = /v1/syncjob/syncjobdef
+fetchmasterdata = /v1/syncdata/masterdata
+fetchmasterdatawithRID = /v1/syncdata/masterdata/{regcenterId}
+SyncPublicKeyToRegClient_URI = /v1/keymanager/publickey/
+uingenerator = /v1/idgenerator/uin
+validateGenderByName = /v1/masterdata/gendertypes/validate/{gendername}
+validateLocationByName = /v1/masterdata/locations/validate/{locationname}
+tokenIdGenerator_URI = /v1/keymanager/{uin}/{partnercode}
+getRIDByUserId = /v1/authmanager/rid/{appid}/{userid}
+syncMdatawithKeyIndex = /v1/syncdata/clientsettings
+syncMdatawithRegCentIdKeyIndex = /v1/syncdata/clientsettings/{regcenterid}
+uploadpublickey = /v1/syncdata/tpm/publickey
+getUserHistory = /v1/masterdata/users/{id}/{eff_dtimes}
+sendOtp = /v1/authmanager/authenticate/sendotp
+useridOTP = /v1/authmanager/authenticate/useridOTP
+#preregSendOtp = /preregistration/v1/login/sendOtp
+preregSendOtp = /preregistration/v1/login/sendOtp/langcode
+preregValidateOtp = /preregistration/v1/login/validateOtp
+zoneMappingUrl=/v1/masterdata/zoneuser
+zoneNameUrl=/v1/masterdata/zones/zonename
+zoneMappingActivateUrl=/v1/masterdata/zoneuser
+userCenterMappingUrl=/v1/masterdata/usercentermapping
+bulkUploadUrl=/v1/admin/bulkupload
+mountPath=/home/mosip/mountvolume
+packetUtilityBaseUrl=http://localhost:8080
+mountPathForScenario=D:/centralized/mountvolume
+# OTP Details
+OTPTimeOut = 181
+attempt = 10
+ConfigParameters=mosip.kernel.rid.length,mosip.kernel.uin.length,mosip.kernel.sms.country.code,mosip.kernel.sms.number.length,mosip.kernel.otp.default-length,mosip.kernel.otp.expiry-time,mosip.kernel.otp.key-freeze-time,mosip.kernel.otp.validation-attempt-threshold,mosip.kernel.otp.min-key-length,mosip.kernel.otp.max-key-length,mosip.kernel.licensekey.length,mosip.supported-languages
+#Below users are used for authentication
+#PARTNER
+#Dont change the partner id
+pmsAuthInternal=true
+mosip_pms_app_id=partner
+partner_password=mosip123
+partner_userName=111997
+partner_user_password=mosip123
+mosip_pms_client_id=mosip-pms-client
+mosip_pms_client_secret=Tkx3jw9INusggEDW
+policytest_password=mosip123
+policytest_userName=111998
+#RESIDENT & IDA
+mosip_resident_app_id=resident
+mosip_resident_client_id=mosip-resident-client
+mosip_resident_client_secret=UGq78khkAst6fjbn
+#IDREPO
+mosip_idrepo_app_id=idrepo
+mosip_idrepo_client_id=mosip-idrepo-client
+mosip_idrepo_client_secret=wJ21F8gXzdy2RM9q
+#admin
+mosip_admin_app_id=admin
+admin_password=mosip123
+admin_userName=auto
+mosip_admin_client_id=mosip-admin-client
+mosip_admin_client_secret=7Vvj405Z5a35eAod
+#admin
+admin_zone_password=mosip123
+admin_zone_userName=globaladmin
+mosip_regclient_app_id=registrationclient
+mosip_reg_client_id=mosip-reg-client
+mosip_reg_client_secret=SGqovDBMh7McnAxw
+#mparter_mobile
+mpartner_default_mobile_client_id=mpartner-default-mobile
+mpartner_default_mobile_secret=Gif10hl5sFH6WCUi
+
+
+
+
+#This credentials are used to execute auth demo service
+AuthClientID=mosip-resident-client
+AuthClientSecret=UGq78khkAst6fjbn
+AuthAppID=resident
+mosip_hotlist_app_id=hotlist
+mosip_hotlist_client_id=mosip-hotlist-client
+mosip_hotlist_client_secret=8Q1SLvLXt5Cwd9QN
+###Keycloak_User-Creation_Properties
+#Dontchange the partner user_111997
+
+new_Resident_User=111995
+new_Resident_Password=mosip123
+new_Resident_Role=default-roles-mosip,PARTNER_ADMIN
+roles.111995=PARTNER_ADMIN,default-roles-mosip
+
+
+keycloak_UserName = admin
+keycloak_Password = oY6ijJuIL8
+
+keycloak-external-url=https://iam.dev3.mosip.net
+mosip_testrig_client_id=mosip-testrig-client
+mosip_testrig_client_secret=aOCfcQC2dYm2Iotg
+
+keycloak-realm-id=mosip
+iam-users-to-create=auto,globaladmin
+#iam-users-to-create=111997,220005,111992
+iam-users-password=mosip123,mosip123
+roles.auto=GLOBAL_ADMIN,ID_AUTHENTICATION,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN
+roles.globaladmin=GLOBAL_ADMIN,REGISTRATION_ADMIN,uma_authorization,ZONAL_ADMIN,default-roles-mosip
+##DB_Connectivity
+driver_class=org.postgresql.Driver
+pool_size=1
+dialect=org.hibernate.dialect.PostgreSQLDialect
+show_sql=true
+current_session_context_class=thread
+#audit details
+audit_url=jdbc:postgresql://dev3.mosip.net:5432/mosip_audit
+audit_username=postgres
+audit_password=rLqRHeY4C5
+audit_default_schema=audit
+#ida-partner details
+DB_PORT=
+installation-domain=
+partner_url=jdbc:postgresql://dev3.mosip.net:5432/mosip_ida
+partner_username=postgres
+partner_password=rLqRHeY4C5
+partner_default_schema=partner
+reportLogPath=automationLogAndReport
+#--------minio proprties----------------
+s3-user-key=minioadmin
+s3-user-secret=minioadmin
+s3-host=http://minio.minio:9000
+s3-account=automation
+s3-region=null
+reportExpirationInDays=3
+# supported values yes or no
+push-reports-to-s3=no
+enableDebug=no
+# supported values are 1 to 8
+threadCount=1
+# supported values are 0 ,1, 2 based on number of env languages
+langselect=0
+#----------------------------------Database properties----------------------------------------------------------#
+postgresqlUser=postgresql
+db-port=5432
+db-server=dev3.mosip.net
+hibernate.connection.driver_class=org.postgresql.Driver
+hibernate.connection.pool_size=1
+hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
+hibernate.show_sql=true
+hibernate.current_session_context_class=thread
+db-su-user=postgres
+postgresql-password=rLqRHeY4C5
+pms_db_schema=pms
+km_db_schema=keymgr
+master_db_schema=master
+audit_db_schema=audit
+ida_db_schema=ida
+
+#----------------------------------AuthDemoService Host properties----------------------------------------------------------#
+#To run locally
+authDemoServiceBaseURL=http://localhost
+authDemoServicePort=8082
+
+#To run in Docker
+#authDemoServiceBaseURL=http://authdemo.apitestrig
+#authDemoServicePort=80
+
+
+#----------------------------------IdP properties----------------------------------------------------------#
+
+currentUserURI=/#/uinservices/viewhistory
+actuatorEndpoint=/resident/v1/actuator/env
+actuatorIDAEndpoint=/idauthentication/v1/actuator/env
+actuatorRegprocEndpoint=/registrationprocessor/v1/registrationtransaction/actuator/env
+tokenEndpoint=/v1/esignet/oauth/token
+validateBindingEndpoint=esignet-binding
+
+#To run in Docker
+authCertsPath=/home/mosip/authcerts
+
+#To run locally
+authCertsPath=
+preconfiguredOtp=111111
+usePreConfiguredOtp=true
\ No newline at end of file
diff --git a/pmptest/src/main/resources/config/application.properties b/pmptest/src/main/resources/config/application.properties
new file mode 100644
index 000000000..53517d978
--- /dev/null
+++ b/pmptest/src/main/resources/config/application.properties
@@ -0,0 +1,6 @@
+# common properties
+
+preregLoginConfigUrl=/preregistration/v1/login/config
+masterSchemaURL=/v1/masterdata/idschema/latest
+addIdentityURL=/idrepository/v1/identity/
+idRepoGenVidURL=/idrepository/v1/vid
\ No newline at end of file
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/AuthPolicyTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/AuthPolicyTest.class
deleted file mode 100644
index 40be02209..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/AuthPolicyTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/DataSharePolicyTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/DataSharePolicyTest.class
deleted file mode 100644
index 0dfa9d4ee..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/DataSharePolicyTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/DeviceDetailsTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/DeviceDetailsTest.class
deleted file mode 100644
index 5a9cba7d1..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/DeviceDetailsTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/FtmDetailsTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/FtmDetailsTest.class
deleted file mode 100644
index f683d25a4..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/FtmDetailsTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/PartnerPolicyMappingTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/PartnerPolicyMappingTest.class
deleted file mode 100644
index faa5faa3a..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/PartnerPolicyMappingTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/PolicyGroupTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/PolicyGroupTest.class
deleted file mode 100644
index b08557f2d..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/PolicyGroupTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/SbiDetailsTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/SbiDetailsTest.class
deleted file mode 100644
index c4660f1f6..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/SbiDetailsTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/testcase/UploadFtmCaCertTest.class b/pmptest/target/classes/io/mosip/test/pmptest/testcase/UploadFtmCaCertTest.class
deleted file mode 100644
index 1ecd630ee..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/testcase/UploadFtmCaCertTest.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/utility/BaseClass.class b/pmptest/target/classes/io/mosip/test/pmptest/utility/BaseClass.class
deleted file mode 100644
index 30c43ee9c..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/utility/BaseClass.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/utility/Commons.class b/pmptest/target/classes/io/mosip/test/pmptest/utility/Commons.class
deleted file mode 100644
index 946b5d8b8..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/utility/Commons.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/utility/DateUtil.class b/pmptest/target/classes/io/mosip/test/pmptest/utility/DateUtil.class
deleted file mode 100644
index 5e705b356..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/utility/DateUtil.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/utility/JsonUtil.class b/pmptest/target/classes/io/mosip/test/pmptest/utility/JsonUtil.class
deleted file mode 100644
index a1ff7f7b5..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/utility/JsonUtil.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/utility/PropertiesUtil.class b/pmptest/target/classes/io/mosip/test/pmptest/utility/PropertiesUtil.class
deleted file mode 100644
index eba84f434..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/utility/PropertiesUtil.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/utility/SetTestName.class b/pmptest/target/classes/io/mosip/test/pmptest/utility/SetTestName.class
deleted file mode 100644
index dbed1f278..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/utility/SetTestName.class and /dev/null differ
diff --git a/pmptest/target/classes/io/mosip/test/pmptest/utility/TestRunner.class b/pmptest/target/classes/io/mosip/test/pmptest/utility/TestRunner.class
deleted file mode 100644
index 7183a47ba..000000000
Binary files a/pmptest/target/classes/io/mosip/test/pmptest/utility/TestRunner.class and /dev/null differ