Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e3859fd
MOSIP-43846 : Reporting Enhancements for Admin UI Automation
BhuvanaShreeBS Dec 2, 2025
79e3077
MOSIP-43846 : Reporting Enhancements for Admin UI Automation
BhuvanaShreeBS Dec 2, 2025
4d17a61
resolved codeRabbit comments
BhuvanaShreeBS Dec 2, 2025
ba96af3
Resolved codeRabbit comments
BhuvanaShreeBS Dec 2, 2025
bbeeb7b
Addressed codeRabbit comment
BhuvanaShreeBS Dec 2, 2025
faf58e2
Added method to push report to Minio
BhuvanaShreeBS Dec 4, 2025
f5c932a
changed base image in Dockerfile
BhuvanaShreeBS Dec 4, 2025
c5884b8
changed base image in Dockerfile
BhuvanaShreeBS Dec 4, 2025
cc75283
In Docker file base image updated
BhuvanaShreeBS Dec 5, 2025
1baf7a2
Updated docker file
BhuvanaShreeBS Dec 5, 2025
86dcfdd
Updated docker file
BhuvanaShreeBS Dec 5, 2025
9fa44b4
Addressed the comments and made changes
BhuvanaShreeBS Dec 5, 2025
3d5e740
Updated Dockerfile
BhuvanaShreeBS Dec 8, 2025
9f02e93
MOSIP-43846 : Add Known Issue (KI) Support to Emailable & Extent Reports
BhuvanaShreeBS Dec 11, 2025
d7757bf
Updated DockerFile
BhuvanaShreeBS Dec 11, 2025
b07fa39
addressed codeRabbit Comments
BhuvanaShreeBS Dec 11, 2025
cbdf154
Resolved codeRabbit comment
BhuvanaShreeBS Dec 12, 2025
e64dd75
Corrected the typo spelling mistake
BhuvanaShreeBS Dec 15, 2025
bda525b
Fixed duplicate reports pushing into minio bucket
BhuvanaShreeBS Dec 15, 2025
32cb50d
Solved codeRabbit comments
BhuvanaShreeBS Dec 15, 2025
36917c4
Improved Known Issue reporting with bug ID links
BhuvanaShreeBS Dec 19, 2025
d5e5cc1
Solved codeRabbit comments
BhuvanaShreeBS Dec 19, 2025
23f3262
Solved codeRabbit comments
BhuvanaShreeBS Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 37 additions & 31 deletions uitest-admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
# Start with a base image that includes Java 21
FROM openjdk:21-slim
# --- Base image ---
FROM eclipse-temurin:21-jre-alpine

# Install additional dependencies, such as Selenium, Chrome, and kubectl
USER root

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
# --- Build-time arguments (MUST be declared before LABEL) ---
ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME

# Set labels for metadata
# --- Metadata labels (used by CI for validation) ---
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
# --- Additional build-time args ---
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}/

# 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}/

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

# --- Environment variables ---
ENV DISPLAY=:99
ENV work_dir=/home/${container_user}

# --- Install dependencies & setup user ---
RUN apk -q update && \
apk add --no-cache wget curl unzip xvfb libxi chromium chromium-chromedriver bash shadow && \
\
addgroup -g ${container_user_gid} ${container_user_group} && \
adduser -s /bin/sh -u ${container_user_uid} -G ${container_user_group} -h /home/${container_user} --disabled-password ${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/ && \
\
mkdir -p ${work_dir}/src/test/resources/ \
${work_dir}/test-output/SparkReport/ \
${work_dir}/screenshots/ && \
chmod -R 775 ${work_dir}

# 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 the working directory
WORKDIR /home/${container_user}/
# --- Fix permissions for entrypoint and JARs ---
RUN chmod +x ${work_dir}/entrypoint.sh && \
find ${work_dir} -name "*.jar" -exec chmod 644 {} \; && \
chown -R ${container_user}:${container_user} ${work_dir};

# --- Switch to non-root user ---
USER ${container_user_uid}:${container_user_gid}

# --- Set working directory ---
WORKDIR ${work_dir}

# Entrypoint for the container
ENTRYPOINT ["/bin/bash", "-c", "./entrypoint.sh"]
# --- Default entrypoint ---
ENTRYPOINT ["bash", "entrypoint.sh"]
2 changes: 1 addition & 1 deletion uitest-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>5.0.9</version>
<version>5.1.2</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,38 @@
import io.mosip.testrig.adminui.utility.BaseClass;
import io.mosip.testrig.adminui.utility.Commons;


public class BlockListTest extends BaseClass {

@Test
public void blocklistedwordsCRUD() throws IOException {
String blocklistedWord=ConfigManager.getdummyData();
String idBlocklisted="admin/masterdata/blocklisted-words/view";
Commons.click(driver(), By.xpath("//a[@href='#/admin/masterdata']"));
Commons.click(driver(), By.id(idBlocklisted));
Commons.click(driver(), By.id("Create"));
Commons.enter(driver(), By.id("word"), blocklistedWord);
Commons.enter(driver(), By.id("description"), data);
Commons.create(driver());
Commons.filter(driver(), By.id("word"), blocklistedWord);
Commons.edit(driver(),blocklistedWord+"auto",By.id("word"));
Commons.filter(driver(), By.id("word"), blocklistedWord+"A");
Commons.activate(driver());
Commons.edit(driver(),blocklistedWord+"B",By.id("word"));
Commons.filter(driver(), By.id("word"), blocklistedWord+"B");
Commons.deactivate(driver());
String blocklistedWord = ConfigManager.getdummyData();
String idBlocklisted = "admin/masterdata/blocklisted-words/view";

Commons.click(driver(), By.xpath("//a[@href='#/admin/masterdata']"), "Clicked on Master Data menu");

Commons.click(driver(), By.id(idBlocklisted), "Opened Blocklisted Words page");

Commons.click(driver(), By.id("Create"), "Clicked on Create Blocklisted Word button");

Commons.enter(driver(), By.id("word"), blocklistedWord, "Entered new blocklisted word");

Commons.enter(driver(), By.id("description"), data, "Entered description for blocklisted word");

Commons.create(driver(), "Submitted Blocklisted Word creation");

Commons.filter(driver(), By.id("word"), blocklistedWord, "Filtered using created word");

Commons.edit(driver(), blocklistedWord + "auto", By.id("word"), "Edited blocklisted word first time");

Commons.filter(driver(), By.id("word"), blocklistedWord + "A", "Filtered using updated word");

Commons.activate(driver(), "Activated the word record");

Commons.edit(driver(), blocklistedWord + "B", By.id("word"), "Edited blocklisted word second time");

Commons.filter(driver(), By.id("word"), blocklistedWord + "B", "Filtered after second update");

Commons.deactivate(driver(), "Deactivated the word record");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,50 @@
import io.mosip.testrig.adminui.utility.Screenshot;
import io.mosip.testrig.adminui.utility.TestRunner;


public class BulkUploadTest extends BaseClass {

private static final Logger logger = Logger.getLogger(BulkUploadTest.class);
private static final Logger logger = Logger.getLogger(BulkUploadTest.class);

@Test (dataProvider = "data-provider")
@Test(dataProvider = "data-provider")
public void bulkUploadCRUD(String table) throws Exception {

Commons.click(driver(),By.id("admin/bulkupload"));
Commons.click(driver(),By.xpath("//a[@href='#/admin/bulkupload/masterdataupload']"));

for(int count=0;count<=2;count++) {
Commons.click(driver(),By.id("Upload Data"));

if(count==0) Commons.dropdown(driver(),By.id("operation"),By.id("Insert"));
if(count==1) Commons.dropdown(driver(),By.id("operation"),By.id("Update"));
if(count==2) Commons.dropdown(driver(),By.id("operation"),By.id("Delete"));
Commons.dropdown(driver(),By.id("tableName"),By.id(table));
String filePath = TestRunner.getResourcePath()+ "//BulkUploadFiles//"+ ConfigManager.getloginlang()+"//"+table+".csv";
Commons.enter( driver(), By.id("fileInput"), filePath);

Commons.click(driver(),By.xpath("//button[@id='createButton']"));
Commons.click(driver(),By.id("confirmpopup"));
Commons.wait(2000);
String divText=driver().findElement(By.xpath("//div[@class='mat-dialog-content']//div")).getText();
String divTextArr[]=divText.split(":");
logger.info(divTextArr[1].trim());
Commons.click(driver(),By.id("confirmmessagepopup")); //DONE
Commons.wait(2000);
String transId=driver().findElement(By.xpath("//table[@class='mat-table']//tr[2]//td[1]")).getText();
String status=driver().findElement(By.xpath("//table[@class='mat-table']//tr[2]//td[5]")).getText();
Reporter.log("<p><img src='data:image/png;base64," + Screenshot.ClickScreenshot(driver()) + "' width='900' height='450'/></p>");
Commons.click(driver(), By.id("admin/bulkupload"), "Clicked on Bulk Upload menu");
Commons.click(driver(), By.xpath("//a[@href='#/admin/bulkupload/masterdataupload']"),
"Opened Master Data Upload page");

for (int count = 0; count <= 2; count++) {

Commons.click(driver(), By.id("Upload Data"), "Clicked on Upload Data button");

if (count == 0)
Commons.dropdown(driver(), By.id("operation"), By.id("Insert"), "Selected Insert operation");
if (count == 1)
Commons.dropdown(driver(), By.id("operation"), By.id("Update"), "Selected Update operation");
if (count == 2)
Commons.dropdown(driver(), By.id("operation"), By.id("Delete"), "Selected Delete operation");

Commons.dropdown(driver(), By.id("tableName"), By.id(table), "Selected table: " + table);

String filePath = TestRunner.getResourcePath() + "//BulkUploadFiles//" + ConfigManager.getloginlang() + "//"
+ table + ".csv";
Commons.enter(driver(), By.id("fileInput"), filePath, "Entered file path for table: " + table);

Commons.click(driver(), By.xpath("//button[@id='createButton']"), "Clicked on Create/Upload button");
Commons.click(driver(), By.id("confirmpopup"), "Confirmed the upload in popup");
Commons.waitForElementVisible(driver(), By.xpath("//div[@class='mat-dialog-content']//div"));

String divText = driver().findElement(By.xpath("//div[@class='mat-dialog-content']//div")).getText();
String divTextArr[] = divText.split(":");
logger.info("Bulk Upload Result: " + divTextArr[1].trim());

Commons.click(driver(), By.id("confirmmessagepopup"), "Closed the confirmation message popup");
Commons.waitForElementVisible(driver(), By.xpath("//table[@class='mat-table']//tr[2]//td[1]"));
String transId = driver().findElement(By.xpath("//table[@class='mat-table']//tr[2]//td[1]")).getText();
String status = driver().findElement(By.xpath("//table[@class='mat-table']//tr[2]//td[5]")).getText();
Reporter.log("<p><img src='data:image/png;base64," + Screenshot.ClickScreenshot(driver())
+ "' width='900' height='450'/></p>");
Assert.assertTrue(transId.equals(divTextArr[1].trim()));
Assert.assertTrue(status.equalsIgnoreCase("COMPLETED"),"Status Should be COMPLETED");
Assert.assertTrue(status.equalsIgnoreCase("COMPLETED"), "Status Should be COMPLETED");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,75 @@
import io.mosip.testrig.adminui.utility.BaseClass;
import io.mosip.testrig.adminui.utility.BaseTestCaseFunc;
import io.mosip.testrig.adminui.utility.Commons;
public class CenterTest extends BaseClass{

public class CenterTest extends BaseClass {

@Test

public void centerCRUD() throws Exception {
int totalHierarchyLevels=BaseTestCaseFunc.getHierarchyNumbers();
Reporter.log("centerCRUD",true);
String holidayDate=ConfigManager.getholidayDateCenter();
Commons.click(driver(),By.id("admin/resources"));
Commons.click(driver(),By.id("/admin/resources/centers"));
Commons.click(driver(), By.id("Create Center"));
Commons.enter(driver(), By.id("name"), data);
Commons.dropdown(driver(),By.id("centerTypeCode"));
Commons.enter(driver(), By.id("contactPerson"),data);
Commons.enter(driver(),By.id("contactPhone"),data);
Commons.enter(driver(),By.id("longitude"),"1.1234");
Commons.enter(driver(),By.id("latitude"),"2.2345");
Commons.enter(driver(),By.id("addressLine1"),data);
Commons.enter(driver(),By.id("addressLine2"),data);
Commons.enter(driver(),By.id("addressLine3"),data);
for(int i=1;i<=totalHierarchyLevels;i++) {
Commons.dropdown(driver(), By.xpath("(//*[@id='fieldName'])["+i+"]"));
int totalHierarchyLevels = BaseTestCaseFunc.getHierarchyNumbers();
Reporter.log("centerCRUD", true);
String holidayDate = ConfigManager.getholidayDateCenter();

Commons.click(driver(), By.id("admin/resources"), "Clicked on Resources menu");
Commons.click(driver(), By.id("/admin/resources/centers"), "Opened Centers page");
Commons.click(driver(), By.id("Create Center"), "Clicked on Create Center button");

Commons.enter(driver(), By.id("name"), data, "Entered Center name");
Commons.dropdown(driver(), By.id("centerTypeCode"), "Selected Center Type");
Commons.enter(driver(), By.id("contactPerson"), data, "Entered contact person");
Commons.enter(driver(), By.id("contactPhone"), data, "Entered contact phone");
Commons.enter(driver(), By.id("longitude"), "1.1234", "Entered longitude");
Commons.enter(driver(), By.id("latitude"), "2.2345", "Entered latitude");
Commons.enter(driver(), By.id("addressLine1"), data, "Entered address line 1");
Commons.enter(driver(), By.id("addressLine2"), data, "Entered address line 2");
Commons.enter(driver(), By.id("addressLine3"), data, "Entered address line 3");

for (int i = 1; i <= totalHierarchyLevels; i++) {
Commons.dropdown(driver(), By.xpath("(//*[@id='fieldName'])[" + i + "]"), "Selected hierarchy level " + i);
}
try{
Commons.dropdown(driver(), By.id("zone"));

}catch(Exception e) {
try {
Commons.dropdown(driver(), By.id("zone"), "Selected Zone");
} catch (Exception e) {
Reporter.log("Zone dropdown not available", true);
}
Commons.dropdown(driver(), By.id("holidayZone"));
Commons.enter(driver(),By.id("noKiosk"),"10");
Commons.dropdown(driver(),By.id("processingTime"),"45");
Commons.dropdown(driver(),By.id("startTime"),"9:00 AM");
Commons.dropdown(driver(),By.id("endTime"),"5:00 PM");
Commons.dropdown(driver(),By.id("lunchStartTime"),"1:00 PM");
Commons.dropdown(driver(),By.id("lunchEndTime"),"2:00 PM");
Commons.click(driver(),By.cssSelector(".mat-list-item:nth-child(1) .mat-pseudo-checkbox"));
Commons.click(driver(),By.cssSelector(".mat-list-item:nth-child(2) .mat-pseudo-checkbox"));
Commons.click(driver(),By.cssSelector(".mat-list-item:nth-child(3) > .mat-list-item-content"));
Commons.click(driver(),By.cssSelector(".mat-list-item:nth-child(4) > .mat-list-item-content"));
Commons.click(driver(),By.cssSelector(".mat-list-item:nth-child(5) > .mat-list-item-content"));
Commons.calendar(holidayDate);
Commons.click(driver(), By.id("createExceptionalHoliday"));
Commons.createRes(driver());
Commons.filterCenter(driver(), By.id("name"), data);
Commons.editCenter(driver(),data+1,By.id("name"));
Commons.filterCenter(driver(), By.id("name"), data+1);
Commons.activate(driver());
Commons.editCenter(driver(),data+2,By.id("name"));
Commons.filterCenter(driver(), By.id("name"), data+2);
Commons.deactivate(driver());
Commons.decommission(driver());

Commons.dropdown(driver(), By.id("holidayZone"), "Selected Holiday Zone");
Commons.enter(driver(), By.id("noKiosk"), "10", "Entered number of kiosks");
Commons.dropdown(driver(), By.id("processingTime"), "45", "Selected processing time");
Commons.dropdown(driver(), By.id("startTime"), "9:00 AM", "Selected start time");
Commons.dropdown(driver(), By.id("endTime"), "5:00 PM", "Selected end time");
Commons.dropdown(driver(), By.id("lunchStartTime"), "1:00 PM", "Selected lunch start time");
Commons.dropdown(driver(), By.id("lunchEndTime"), "2:00 PM", "Selected lunch end time");

Commons.click(driver(), By.cssSelector(".mat-list-item:nth-child(1) .mat-pseudo-checkbox"),
"Selected first service checkbox");
Commons.click(driver(), By.cssSelector(".mat-list-item:nth-child(2) .mat-pseudo-checkbox"),
"Selected second service checkbox");
Commons.click(driver(), By.cssSelector(".mat-list-item:nth-child(3) > .mat-list-item-content"),
"Selected third service");
Commons.click(driver(), By.cssSelector(".mat-list-item:nth-child(4) > .mat-list-item-content"),
"Selected fourth service");
Commons.click(driver(), By.cssSelector(".mat-list-item:nth-child(5) > .mat-list-item-content"),
"Selected fifth service");

Commons.calendar(holidayDate, "Selected exceptional holiday date");
Commons.click(driver(), By.id("createExceptionalHoliday"), "Created exceptional holiday");

Commons.createRes(driver(), "Submitted Center creation");
Commons.filterCenter(driver(), By.id("name"), data, "Filtered using created Center name");

Commons.editCenter(driver(), data + 1, By.id("name"), "Edited Center name first time");
Commons.filterCenter(driver(), By.id("name"), data + 1, "Filtered using updated Center name first time");

Commons.activate(driver(), "Activated the Center");

Commons.editCenter(driver(), data + 2, By.id("name"), "Edited Center name second time");
Commons.filterCenter(driver(), By.id("name"), data + 2, "Filtered using updated Center name second time");

Commons.deactivate(driver(), "Deactivated the Center");
Commons.decommission(driver(), "Decommissioned the Center");
}

}
Loading
Loading