Skip to content

Commit

Permalink
MOSIP-31484
Browse files Browse the repository at this point in the history
Signed-off-by: Jayesh Kharode <[email protected]>
  • Loading branch information
Jayesh Kharode committed Feb 6, 2024
1 parent 01fe3e5 commit 4f6a6c7
Show file tree
Hide file tree
Showing 127 changed files with 7,262 additions and 3,862 deletions.
45 changes: 45 additions & 0 deletions admintest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM selenium/standalone-chrome:latest

USER root

# Define build-time arguments
ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME

# Set labels for metadata
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

# Define build-time arguments for user and group
ARG container_user=mosip
ARG container_user_group=mosip
ARG container_user_uid=1001
ARG container_user_gid=1001

# Set working directory for the user
ENV work_dir=/home/${container_user}/

# install packages and create user
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}/

# Switch to the specified user for the subsequent commands
USER ${container_user_uid}:${container_user_gid}

# Copy files
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
WORKDIR /home/${container_user}/



# Entrypoint for the container
ENTRYPOINT ["/bin/bash", "-c", "./entrypoint.sh"]
16 changes: 14 additions & 2 deletions admintest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Selenium webdriver based Admin Portal Automation covers CRUD(create, read, updat
## Build
1. Build jar `mvn clean install`
2. Place jar in one folder along with src/main/resources files and folder
3. Run jar with vm args- ``` java -Dpath=https://env.mosip.net/ -Duserid=user -Dpassword=pwd -jar nameofAdminJar.jar```
3. Run jar with vm args- ``` -Dpath=https://admin.dev.mosip.net/ -DKeyclockURL=https://iam.dev.mosip.net -Denv.user=api-internal.dev -Denv.endpoint=https://api-internal.dev.mosip.net jar nameofAdminJar.jar```

## Configurations
1. Update below keys from `Config.properties`
Expand Down Expand Up @@ -36,9 +36,21 @@ Selenium webdriver based Admin Portal Automation covers CRUD(create, read, updat
* machineTypesCRUD: MT
* templateCRUD: T

## Headless Mode
*Update below key from `TestData.json`
* hedless: "no" --To run in normal mode.
* hedless : "yes" --To run in headless mode

## 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. Extent results are present `\admintest\Reports`

#Usercreation
1.In config folder `\config\kernal.property`
2.on line no 27,36,38 chnage we can change the user(keep same at all three place)
3.


## License
This project is licensed under the terms of [Mozilla Public License 2.0](../LICENSE).
Expand Down
4 changes: 4 additions & 0 deletions admintest/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

java --version
java -jar adminui-*-jar-with-dependencies.jar
Loading

0 comments on commit 4f6a6c7

Please sign in to comment.