diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index a5500157a..617f2bd85 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -4,6 +4,7 @@ on: release: types: [published] pull_request: + types: [opened, reopened, synchronize] push: @@ -12,7 +13,7 @@ on: - release* - master - 1.0.* - - develop + - develop* - 1.1.* - MOSIP* - 1.2.* @@ -62,7 +63,7 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} build-maven-uitest-pmp: - uses: mosip/kattu/.github/workflows/maven-build.yml@master + uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21 with: SERVICE_LOCATION: uitest-pmp BUILD_ARTIFACT: uitest-pmp @@ -73,6 +74,7 @@ jobs: GPG_SECRET: ${{ secrets.GPG_SECRET }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + build-uitest-pmp-local: needs: build-maven-uitest-pmp runs-on: ubuntu-latest @@ -82,12 +84,12 @@ jobs: SERVICE_LOCATION: uitest-pmp BUILD_ARTIFACT: uitest-pmp-local steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v3 with: - ref: ${{ github.ref }} - java-version: 11 + distribution: 'temurin' + java-version: '21' server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file @@ -107,6 +109,7 @@ jobs: cd ${{ env.SERVICE_LOCATION}} mvn -U -B package -Dmaven.wagon.http.retryHandler.count=2 --file pom.xml -s $GITHUB_WORKSPACE/settings.xml + - name: Ready the springboot artifacts if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }} run: | @@ -128,19 +131,21 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required if: failure() # Pick up events even if the job fails or is canceled. + + build-dockers-uitest-pmp: needs: build-uitest-pmp-local - strategy: matrix: include: - SERVICE_LOCATION: 'uitest-pmp' SERVICE_NAME: 'uitest-pmp' + BUILD_ARTIFACT: 'uitest-pmp-local' fail-fast: false name: ${{ matrix.SERVICE_NAME }} - uses: mosip/kattu/.github/workflows/docker-build.yml@master + uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21 with: SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} SERVICE_NAME: ${{ matrix.SERVICE_NAME }} @@ -165,22 +170,4 @@ jobs: OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} GPG_SECRET: ${{ secrets.GPG_SECRET }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - build-dockers-pmp-reactjs-ui: - strategy: - matrix: - include: - - SERVICE_LOCATION: 'pmp-reactjs-ui' - SERVICE_NAME: 'pmp-reactjs-ui' - fail-fast: false - name: ${{ matrix.SERVICE_NAME }} - uses: mosip/kattu/.github/workflows/docker-build.yml@master - with: - SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} - SERVICE_NAME: ${{ matrix.SERVICE_NAME }} - secrets: - DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} - ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} - RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/uitest-pmp/Dockerfile b/uitest-pmp/Dockerfile index 845e6f7a4..5475b9d43 100644 --- a/uitest-pmp/Dockerfile +++ b/uitest-pmp/Dockerfile @@ -1,8 +1,18 @@ -FROM selenium/standalone-chrome:127.0.6533.119 +# Start with a base image that includes Java 21 +FROM openjdk:21-slim +# Install additional dependencies, such as Selenium, Chrome, and kubectl USER root -# Define build-time arguments +RUN apt-get update && \ + apt-get install -y wget curl unzip xvfb libxi6 libgconf-2-4 chromium chromium-driver + +# Install kubectl +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + chmod +x kubectl && \ + mv kubectl /usr/local/bin/kubectl + +# Define build-time arguments and labels ARG SOURCE ARG COMMIT_HASH ARG COMMIT_ID @@ -23,29 +33,21 @@ ARG container_user_gid=1001 # Set working directory for the user ENV work_dir=/home/${container_user}/ -ARG KUBECTL_VERSION=1.22.9 - -# install packages and create user +# Create a new user with specified permissions RUN groupadd -g ${container_user_gid} ${container_user_group} \ && useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/bash -m ${container_user} -d ${work_dir} \ - && chown -R ${container_user}:${container_user} /home/${container_user}/ \ - && curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ - && chmod +x kubectl \ - && mv kubectl /usr/local/bin/ + && chown -R ${container_user}:${container_user} /home/${container_user}/ # Switch to the specified user for the subsequent commands USER ${container_user_uid}:${container_user_gid} -# Copy files +# Copy your application files into the container COPY --chown=${container_user_uid}:${container_user} --chmod=771 ./entrypoint.sh ${work_dir}/entrypoint.sh COPY --chown=${container_user}:${container_user} ./src/main/resources/ ${work_dir}/resources/ COPY --chown=${container_user_uid}:${container_user} ./target/*.jar ${work_dir} -# Set working directory +# Set the working directory WORKDIR /home/${container_user}/ - - - # Entrypoint for the container ENTRYPOINT ["/bin/bash", "-c", "./entrypoint.sh"] diff --git a/uitest-pmp/pom.xml b/uitest-pmp/pom.xml index a886d9d13..0fdd9ac05 100644 --- a/uitest-pmp/pom.xml +++ b/uitest-pmp/pom.xml @@ -6,170 +6,32 @@ uitest-automation Parent project of uitest-automation https://github.com/mosip/Partner-management-portal - - - - MPL 2.0 - https://www.mozilla.org/en-US/MPL/2.0/ - - - - scm:git:git://github.com/mosip/Partner-management-portal.git - scm:git:ssh://github.com:mosip/Partner-management-portal.git - https://github.com/mosip/Partner-management-portal - HEAD - - - - Mosip - mosip.emailnotifier@gmail.com - io.mosip - https://github.com/mosip/admin-ui - - - - - 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 + + + MPL 2.0 + https://www.mozilla.org/en-US/MPL/2.0/ + + + + scm:git:git://github.com/mosip/Partner-management-portal.git + scm:git:ssh://github.com:mosip/Partner-management-portal.git + https://github.com/mosip/Partner-management-portal + HEAD + + + + Mosip + mosip.emailnotifier@gmail.com + io.mosip + https://github.com/mosip/pmpui + + + + + 31.1-jre + 7.10.1 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 @@ -182,474 +44,410 @@ 6.11 1.13 pmpui-1.2.1-SNAPSHOT-jar-with-dependencies - - - - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - maven-compiler-plugin - 3.5.1 - - 11 - 11 - -Dfile.encoding=UTF-8 - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - 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-antrun-plugin - 3.0.0 - - - make-jar-executable - package - - run - - - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.4 - - - - shade - - - ${fileName} - - - - - - io.mosip.testrig.pmpui.utility.TestRunner - - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - - - - - - - - selenium-tests - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - - attach-javadocs - - jar - - - - - 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 - true - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - - testng.xml - - - - - - - - - - - + + + + io.mosip.kernel + kernel-bom + 1.2.1-java21-SNAPSHOT + pom + import + + + + + org.seleniumhq.selenium selenium-java - 3.141.59 + + + com.google.guava + guava + + + + + org.json + json + + + com.fasterxml.jackson.core + jackson-core + + + + com.fasterxml.jackson.core + jackson-databind + + + com.amazonaws + aws-java-sdk-s3 + 1.12.470 + + + org.awaitility + awaitility + + + ch.qos.logback + logback-core + + + org.slf4j + slf4j-api - - - - - org.json - json - 20210307 - - - - - com.fasterxml.jackson.core - jackson-core - 2.12.5 - - - - com.fasterxml.jackson.core - jackson-databind - 2.12.5 - - - - - io.rest-assured - rest-assured - 4.3.3 - - - - - com.aventstack - extentreports - 3.1.5 - - - - - org.awaitility - awaitility - 4.0.3 - - - ch.qos.logback - logback-core - 1.2.6 - - - org.slf4j - slf4j-api - 1.7.30 - - - - - ch.qos.logback - logback-classic - 1.2.6 - - - com.paulhammant - ngwebdriver - 1.1.5 - - - - - - io.github.bonigarcia - webdrivermanager - 5.5.3 - - - - org.apache.logging.log4j - log4j-api - 2.11.1 + + ch.qos.logback + logback-classic - - org.testng - testng - 7.1.0 - - - - com.aventstack - extentreports - 5.0.9 - - - - - commons-io - 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.jboss.resteasy - resteasy-jaxrs - 3.15.0.Final - + + com.paulhammant + ngwebdriver + 1.1.5 - + + + com.aventstack + extentreports + 5.0.9 + + + javax.validation + validation-api + + + io.github.bonigarcia + webdrivermanager + 5.1.0 + + + com.google.guava + guava + + + + + commons-io + commons-io + + + org.jboss.resteasy + resteasy-jaxrs + 3.15.0.Final + + + junit + junit + test + + + org.testng + testng + ${testng.version} + + + org.postgresql + postgresql + 42.6.0 + + 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 + javax.ws.rs + javax.ws.rs-api + 2.1.1 org.keycloak keycloak-admin-client 17.0.1 + + + com.google.guava + guava + + commons-beanutils commons-beanutils - 1.9.4 + ${commons.beanutils.version} com.googlecode.json-simple json-simple - 1.1.1 org.apache.commons commons-collections4 - 4.4 - commons-lang - commons-lang - 2.6 + commons-lang + commons-lang + 2.6 + + + com.google.guava + guava + ${guava.version} + + + org.apache.httpcomponents.client5 + httpclient5 + 5.1.3 + + + org.apache.httpcomponents.core5 + httpcore5 + 5.1.3 - - - com.amazonaws - aws-java-sdk-s3 - 1.12.470 - - - + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + maven-compiler-plugin + 3.5.1 + + 21 + 21 + -Dfile.encoding=UTF-8 + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + 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-antrun-plugin + 3.0.0 + + + make-jar-executable + package + + run + + + + + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + + shade + + + ${fileName} + + + + + + io.mosip.testrig.pmpui.utility.TestRunner + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + + + + + + selenium-tests + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + attach-javadocs + + jar + + + + + 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 + true + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + + testng.xml + + + + + + + - + \ No newline at end of file diff --git a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/dbaccess/DBManager.java b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/dbaccess/DBManager.java new file mode 100644 index 000000000..cb66aaa7c --- /dev/null +++ b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/dbaccess/DBManager.java @@ -0,0 +1,112 @@ +package io.mosip.testrig.pmpui.dbaccess; + +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; + + + +import org.apache.log4j.Logger; +import org.hibernate.HibernateException; +//import org.hibernate.HibernateException; +//import org.hibernate.Session; +//import org.hibernate.SessionFactory; +//import org.hibernate.cfg.Configuration; +//import org.hibernate.cfg.Environment; +//import org.hibernate.jdbc.Work; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; +import org.hibernate.cfg.Environment; +import org.hibernate.jdbc.Work; + +import io.mosip.testrig.pmpui.kernel.util.ConfigManager; +import io.mosip.testrig.pmpui.utility.BaseClass; + +public class DBManager extends BaseClass { + + private static Logger logger = Logger.getLogger(DBManager.class); + + public static void clearPMSDbData() { + Session session = null; + try { + + logger.info("DB URL:: " + ConfigManager.getPMSDbUrl()); + logger.info("DbUser:: " + ConfigManager.getPMSDbUser()); + logger.info("DbPass:: " + ConfigManager.getPMSDbPass()); + logger.info("DbSchema:: " + ConfigManager.getPMSDbSchema()); + session = getDataBaseConnection(ConfigManager.getPMSDbUrl(), ConfigManager.getPMSDbUser(), + ConfigManager.getPMSDbPass(), ConfigManager.getPMSDbSchema()); + if (session != null) { + session.doWork((Work) new Work() { + + @Override + public void execute(Connection connection) throws SQLException { + Statement statement = connection.createStatement(); + // To Do --- Read the delete queries from a file and iterate + try { + ; + statement.addBatch("delete from partner_policy_request where part_id ='auth_v4"+data+"'"); + statement.addBatch("delete from partner_policy where part_id ='auth_v4"+data+"'"); + statement.addBatch("delete from partner where name ='AUTH_V4'"); + statement.addBatch("delete from partner_policy_request where part_id ='credential_v1"+data+"'"); + statement.addBatch("delete from partner_policy where part_id ='credential_v1"+data+"'"); + statement.addBatch("delete from partner where name ='CREDENTIAL_V1'"); + int[] result = statement.executeBatch(); + logger.info("Success:: Executed PMS DB quiries successfully."); + for (int i : result) { + logger.info("PMS db deleted records: " + i); + } + } finally { + statement.close(); + } + + } + + }); + } + } catch (Exception e) { + logger.error("Error:: While executing MASTER DB Quiries." + e.getMessage()); + } finally { + if (session != null) { + session.close(); + } + } + + } + + private static Session getDataBaseConnection(String dburl, String userName, String password, String schema) { + SessionFactory factory = null; + Session session = null; + + logger.info("dburl is" + dburl); + logger.info("userName is" + userName); + logger.info("password is" + password); + + + try { + Configuration config = new Configuration(); + config.setProperty(Environment.DRIVER, ConfigManager.getDbDriverClass()); + config.setProperty(Environment.URL, dburl); + logger.info("dburl is" + dburl); + config.setProperty(Environment.USER, userName); + logger.info("userName is" + userName); + config.setProperty(Environment.PASS, password); + logger.info("password is" + password); + config.setProperty(Environment.DEFAULT_SCHEMA, schema); + config.setProperty(Environment.POOL_SIZE, ConfigManager.getDbConnectionPoolSize()); + config.setProperty(Environment.DIALECT, ConfigManager.getDbDialect()); + config.setProperty(Environment.SHOW_SQL, ConfigManager.getShowSql()); + config.setProperty(Environment.CURRENT_SESSION_CONTEXT_CLASS, ConfigManager.getDbSessionContext()); + + factory = config.buildSessionFactory(); + session = factory.getCurrentSession(); + session.beginTransaction(); + } catch (HibernateException | NullPointerException e) { + logger.error("Error while getting the db connection for ::" + dburl); + } + return session; + } + +} + diff --git a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/kernel/util/ConfigManager.java b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/kernel/util/ConfigManager.java index af77b47a7..67277add4 100644 --- a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/kernel/util/ConfigManager.java +++ b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/kernel/util/ConfigManager.java @@ -22,39 +22,21 @@ public class ConfigManager { 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"; @@ -62,44 +44,17 @@ public class ConfigManager { 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 = "postgres-password"; - private static String MASTER_DB_SCHEMA = "master_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 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 SERVICES_NOT_DEPLOYED = "servicesNotDeployed"; - // private static String pms_client_secret; - // private static String pms_client_id; - // private static String pms_app_id; - private static String HolidayDateCenter = "holidayDateCenter"; private static String HolidayDate = "holidayDate"; @@ -136,14 +91,7 @@ public class ConfigManager { private static String holidayDateCenter; private static String policyData; private static String dataSharepolicyData; - // - // 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; @@ -153,33 +101,17 @@ public class ConfigManager { 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 serviceNotDeployedList; private static String enableDebug; private static String db_port; @@ -189,26 +121,10 @@ public class ConfigManager { 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 pms_db_user; + private static String pms_db_pass; + private static String pms_db_schema; private static String iamExternalURL; private static String iam_realm_id; @@ -217,13 +133,7 @@ public class ConfigManager { 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; @@ -257,14 +167,7 @@ public static void init() { logger.info("System.getenv(IAM_EXTERNAL_URL)=" + System.getenv(IAM_EXTERNAL_URL)); logger.info("iamExternalURL from getIAMUrl() =" + getIAMUrl()); - // 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); @@ -283,18 +186,10 @@ public static void init() { 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); @@ -308,21 +203,11 @@ public static void init() { 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); + + pms_db_user = getValueForKey(PMS_DB_USER); + pms_db_pass = getValueForKey(PMS_DB_PASS); + pms_db_schema = getValueForKey(PMS_DB_SCHEMA); + serviceNotDeployedList = System.getenv(SERVICES_NOT_DEPLOYED) == null ? propsKernel.getProperty(SERVICES_NOT_DEPLOYED) : System.getenv(SERVICES_NOT_DEPLOYED); @@ -350,48 +235,18 @@ public static void init() { admin_client_secret = System.getenv(MOSIP_ADMIN_CLIENT_SECRET) == null ? propsKernel.getProperty(MOSIP_ADMIN_CLIENT_SECRET) : System.getenv(MOSIP_ADMIN_CLIENT_SECRET); - // + logger.info("admin_client_secret="+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 holidayDateCenter =System.getenv(HolidayDateCenter) == null ? propsKernel.getProperty(HolidayDateCenter) : System.getenv(HolidayDateCenter); propsKernel.setProperty(HolidayDateCenter, holidayDateCenter); @@ -500,104 +355,26 @@ public static String getholidayDateCenter() { return holidayDateCenter; } - // 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; } @@ -615,186 +392,84 @@ public static String getIAMUrl() { return iamExternalURL+"/auth"; } - // - // 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 Boolean IsDebugEnabled() { return enableDebug.equalsIgnoreCase("yes"); } - // + 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; - } + + public static String getPMSDbUrl() { + return "jdbc:postgresql://" + db_domain + ":" + db_port + "/mosip_pms"; + } + + 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 getIAMRealmId() { return iam_realm_id; @@ -844,8 +519,4 @@ private static Properties getproperty(String path) { return prop; } - // public static String getAuthDemoServiceUrl() { - // return ConfigManager.getAuthDemoServiceBaseUrl() + ":" + ConfigManager.getAuthDemoServicePort(); - // } - } \ No newline at end of file diff --git a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/BaseClass.java b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/BaseClass.java index 15d758366..4da0aa26e 100644 --- a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/BaseClass.java +++ b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/BaseClass.java @@ -36,7 +36,7 @@ public class BaseClass { protected String userid = KeycloakUserManager.moduleSpecificUser; protected String[] allpassword = ConfigManager.getIAMUsersPassword().split(","); protected String password = allpassword[0]; - protected String data = Commons.appendDate.substring(0, Commons.getSplitdigit()); + protected static String data = Commons.appendDate.substring(0, Commons.getSplitdigit()); public static ExtentSparkReporter html; public static ExtentReports extent; public static ExtentTest test; diff --git a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/Commons.java b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/Commons.java index 56740db3a..f3d0c8ff1 100644 --- a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/Commons.java +++ b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/Commons.java @@ -6,6 +6,7 @@ import java.awt.datatransfer.StringSelection; import java.awt.event.KeyEvent; import java.io.IOException; +import java.time.Duration; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; @@ -115,7 +116,8 @@ public static void filterCenter(ExtentTest test,WebDriver driver, By by,String public static void click(ExtentTest test,WebDriver driver, By by) throws IOException { logger.info("Clicking " + by ); try { - (new WebDriverWait(driver, 20)).until(ExpectedConditions.elementToBeClickable(by)); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); + wait.until(ExpectedConditions.elementToBeClickable(by)); Thread.sleep(2000); driver.findElement(by).click(); Thread.sleep(2000); @@ -150,7 +152,8 @@ public static void clickWebelement(ExtentTest test,WebDriver driver, By by) thr logger.info("Clicking " + by ); try { - (new WebDriverWait(driver, 20)).until(ExpectedConditions.elementToBeClickable(by)); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); + wait.until(ExpectedConditions.elementToBeClickable(by)); Thread.sleep(500); WebElement checkbox= driver.findElement(by); js.executeScript("arguments[0].click();", checkbox); @@ -170,7 +173,8 @@ public static void enter(ExtentTest test,WebDriver driver, By by,String value) t logger.info("Entering " + by +value); //value="10"; try { - (new WebDriverWait(driver, 20)).until(ExpectedConditions.visibilityOfElementLocated(by)); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(40)); + wait.until(ExpectedConditions.visibilityOfElementLocated(by)); driver.findElement(by).clear(); driver.findElement(by).sendKeys(value); try { diff --git a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/TestRunner.java b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/TestRunner.java index 6ddc74b58..e200858ca 100644 --- a/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/TestRunner.java +++ b/uitest-pmp/src/main/java/io/mosip/testrig/pmpui/utility/TestRunner.java @@ -11,8 +11,7 @@ import org.testng.xml.XmlSuite; import org.testng.xml.XmlTest; - -//import io.mosip.testrig.pmpui.dbaccess.DBManager; +import io.mosip.testrig.pmpui.dbaccess.DBManager; import io.mosip.testrig.pmpui.fw.util.AdminTestUtil; import io.mosip.testrig.pmpui.kernel.util.ConfigManager; import io.mosip.testrig.pmpui.testcase.*; @@ -37,34 +36,10 @@ public class TestRunner { public static void main(String[] args) throws Exception { - // if (checkRunType().equalsIgnoreCase("JAR")) { - // ExtractResource.removeOldMosipTestTestResource(); - // ExtractResource.extractResourceFromJar(); - // } + AdminTestUtil.initialize(); - //DBManager.clearMasterDbData(); - //ConfigManager.getMasterDbPass(); - /* 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(); + DBManager.clearPMSDbData(); + startTestRunner(); } @@ -218,8 +193,7 @@ public static void startTestRunner() throws Exception { + "-run-" + System.currentTimeMillis() + "-report.html"); runner.run(); - - // DBManager.clearMasterDbData(); + DBManager.clearPMSDbData(); System.exit(0); } diff --git a/uitest-pmp/src/main/resources/config/Kernel.properties b/uitest-pmp/src/main/resources/config/Kernel.properties index ac6c36324..f91cce81c 100644 --- a/uitest-pmp/src/main/resources/config/Kernel.properties +++ b/uitest-pmp/src/main/resources/config/Kernel.properties @@ -12,62 +12,64 @@ bulkUploadUrl=/v1/admin/bulkupload #IDREPO mosip_idrepo_app_id=idrepo mosip_idrepo_client_id=mosip-idrepo-client -mosip_idrepo_client_secret=IGsZkHXcAoqGKRTA +mosip_idrepo_client_secret= #IDREPO mosip_idrepo_app_id=idrepo mosip_idrepo_client_id=mosip-idrepo-client -mosip_idrepo_client_secret=IGsZkHXcAoqGKRTA +mosip_idrepo_client_secret= keycloak-realm-id=mosip -keycloak-external-url=https://iam.dev2.mosip.net +keycloak-external-url=https://iam.dev1.mosip.net mosip_testrig_client_id=mosip-testrig-client -mosip_testrig_client_secret=Xup50UX3AybAkzkH +mosip_testrig_client_secret= admin mosip_admin_app_id=admin admin_password=mosip123 admin_userName=auto11 mosip_admin_client_id=mosip-admin-client -mosip_admin_client_secret=E4386XMrYOvoHMJ5 +mosip_admin_client_secret= #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=3H9qsSxmYn4bXBk8 +mosip_reg_client_secret= iam-users-to-create=auto11 #iam-users-to-create=111997,220005,111992 iam-users-password=mosip123 roles=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://dev2.mosip.net:5432/mosip_ida +partner_url=jdbc:postgresql://dev1.mosip.net:5432/mosip_ida #----------------------------------Database properties----------------------------------------------------------# postgresqlUser=postgresql db-port=5432 -db-server=dev2.mosip.net +db-server=dev1.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 -postgres-password=d52kjJuxp2 +postgres-password=aRWP1G52uu pms_db_schema=pms km_db_schema=keymgr master_db_schema=master audit_db_schema=audit ida_db_schema=ida -db-server=dev2.mosip.net -keycloak-external-url=https://iam.dev2.mosip.net -audit_url=jdbc:postgresql://dev2.mosip.net:5432/mosip_audit +db-server=dev1.mosip.net +keycloak-external-url=https://iam.dev1.mosip.net +audit_url=jdbc:postgresql://dev1.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 -postgres-password=d52kjJuxp2 +postgres-password= +pms_db_pass = +postgresql-password= postgresqlUser=postgresql db-port=5432 -db-server=dev2.mosip.net +db-server=dev1.mosip.net s3-user-key=minioadmin @@ -112,9 +114,9 @@ authCertsPath= servicesNotDeployed= -PmpPortalPath=https://pmp.dev2.mosip.net/ -apiEnvUser=api-internal.dev2 -apiInternalEndPoint=https://api-internal.dev2.mosip.net +PmpPortalPath=https://pmp.dev1.mosip.net/ +apiEnvUser=api-internal.dev1 +apiInternalEndPoint=https://api-internal.dev1.mosip.net #----------------------------------Test_data--------------------------------------------- pmpscenariosToExecute=