Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #217

Merged
merged 4 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CommonLibrary extends BaseTestCaseFunc {


public String getResourcePath() {
return TestRunner.getGlobalResourcePath() + "/";
return TestRunner.getResourcePath() + "/";
}

public String getResourcePathForKernel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void centerCRUD() throws Exception {
Commons.click(test,driver,By.cssSelector(".mat-list-item:nth-child(4) > .mat-list-item-content"));
Commons.click(test,driver,By.cssSelector(".mat-list-item:nth-child(5) > .mat-list-item-content"));

// Commons.enter(test,driver,By.id("holidayDate"),holidayDate);
// Commons.enter(test,driver,By.id("holidayDate"),holidayDate);
Commons.calendar(holidayDate);
Commons.click(test,driver, By.id("createExceptionalHoliday"));
test.log(Status.INFO, "Click on Exceptional Holiday");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public void deviceCRUD() throws InterruptedException {

Commons.enter(test,driver, By.id("ipAddress"),"2.2345");
// Commons.enter(test,driver, By.id("validity"),validityDate);
Commons.calendar(validityDate);

Commons.calendar(validityDate);
Commons.dropdown(test,driver,By.id("deviceSpecId"));
// Commons.dropdown(test,driver,By.id("zone"));
Commons.dropdown(test,driver,By.id("regCenterId"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.mosip.testrig.adminui.testcase;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -48,8 +49,8 @@ public void holidaysCRUD() throws Exception {

Commons.enter(test,driver,By.id("holidayName"),data);
Commons.enter(test,driver,By.id("holidayDesc"),data);
// Commons.enter(test,driver,By.id("holidayDate"),holidayDate);
Commons.calendar(holidayDate);
// Commons.enter(test,driver,By.id("holidayDate"),holidayDate);
Commons.calendar(holidayDate);
test.log(Status.INFO, "Click on Enters HolidayDate");
Commons.dropdown(test,driver,By.id("locationCode"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void machineCRUD() throws Exception {
Commons.enter(test,driver,By.id("macAddress"),"1.2.3.4.5.6");
Commons.enter(test,driver,By.id("ipAddress"),"2.3.4.5.6");
test.log(Status.INFO, "ENter IpAddress");
// Commons.enter(test,driver,By.id("validity"),holidayDateCenter);
// Commons.enter(test,driver,By.id("validity"),holidayDateCenter);
Commons.calendar(holidayDateCenter);
Commons.dropdown(test,driver,By.id("machineSpecId"));
Commons.enter(test,driver,By.id("publicKey"),publicKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,17 @@ public void setUp() throws Exception {
test=extent.createTest(getCommitId(),getCommitId());

ChromeOptions options = new ChromeOptions();

String headless=JsonUtil.JsonObjParsing(Commons.getTestData(),"headless");


if(headless.equalsIgnoreCase("yes")) {
options.addArguments("--headless=new");
}
WebDriverManager.chromedriver().setup();
driver=new ChromeDriver(options);

WebDriverManager.chromedriver().setup();
driver=new ChromeDriver(options);


//
js = (JavascriptExecutor) driver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ public static String getPreAppend()
}
return preappend;
}

public static void calendar(String date) {
String a=date.replaceAll("/","");
String mon="";
Expand Down Expand Up @@ -462,5 +463,4 @@ public static void calendar(String date) {
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public class ExtentReportManager extends BaseClass {
public static ExtentReports getReports() {
if(extent==null) {
extent=new ExtentReports();
Filepath=System.getProperty("user.dir")+"/Reports/"+"mosip-admin-ui-test-report-"+Commons.appendDate+".html";
extent=new ExtentReports();
Filepath=System.getProperty("user.dir")+"/Reports/"+"admin-ui-report-"+Commons.appendDate+".html";
html=new ExtentSparkReporter(Filepath);
extent.attachReporter(html);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,18 @@ public static List<String> JsonObjArrayListParsing(String jsonIdentity, String i
public static String readJsonFileText(String document) {

String jsonTxt = null;
File f=null;

try {

File f = new File(System.getProperty("user.dir") + "\\"+document);

if (TestRunner.checkRunType().equalsIgnoreCase("JAR")) {
f = new File(TestRunner.getResourcePath() + "/" +document);
} else if (TestRunner.checkRunType().equalsIgnoreCase("IDE")) {


f = new File(System.getProperty("user.dir") + System.getProperty("path.config")+ "/"+document);
}
if (f.exists()) {
InputStream is = new FileInputStream(f);
jsonTxt = IOUtils.toString(is, "UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@ 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";
String path=null;

if (TestRunner.checkRunType().equalsIgnoreCase("JAR")) {
path = TestRunner.getResourcePath()+"/Screenshots/"+System.currentTimeMillis()+".png";
} else if (TestRunner.checkRunType().equalsIgnoreCase("IDE")) {


path = System.getProperty("user.dir") + System.getProperty("path.config")+ "/Screenshots/"+System.currentTimeMillis()+".png";
}




// String path=System.getProperty("user.dir")+"/resources/Screenshots/"+System.currentTimeMillis()+".png";
File des=new File(path);
FileHandler.copy(so, des);
FileInputStream fis=new FileInputStream(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) throws Exception {
//startTestRunner();

testNg=new TestNG();
//testNg.addListener(MyListener.class);

String listExcludedGroups=JsonUtil.JsonObjParsing(Commons.getTestData(),"setExcludedGroups");
testNg.setExcludedGroups(listExcludedGroups);
testNg.setTestClasses(new Class[] {
Expand All @@ -60,7 +60,6 @@ public static void main(String[] args) throws Exception {
// testNg.addListener(tla);
testNg.run();


}
public static String getGlobalResourcePath() {
if (checkRunType().equalsIgnoreCase("JAR")) {
Expand All @@ -77,10 +76,12 @@ public static String getGlobalResourcePath() {

public static String getResourcePath() {
if (checkRunType().equalsIgnoreCase("JAR")) {
return new File(jarUrl).getParentFile().getAbsolutePath();
return new File(jarUrl).getParentFile().getAbsolutePath().toString()+"/resources/";
} else if (checkRunType().equalsIgnoreCase("IDE")) {
String path = new File(TestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath()
.toString();
String path = System.getProperty("user.dir") + System.getProperty("path.config");

// String path = new File(TestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath()
// .toString();
if (path.contains("test-classes"))
path = path.replace("test-classes", "classes");
return path;
Expand Down
8 changes: 4 additions & 4 deletions admintest/src/main/resources/TestData.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"15templateCRUD": "T",
"BELOW_ARE_STATIC_KEYWORDS": "We are using this setExcludedGroups to exclude scenarios",
"setExcludedGroups": "BU",
"holidayDateCenter": "23/12/2025",
"holidayDate": "13/09/2025",
"holidayDateCenter": "10/12/2025",
"holidayDate": "10/09/2025",
"validityDate":"10/12/2026",
"loginlang": "sin",
"preappend": "0",
"jsonObjName": "identity",
"headless": "no",
"bulkwait": "10000",
"dummyData":"blocklistwordss",
"publicKey": "AAEACwACAHIAIINxl2dEhLP4GpDMjUal1yT9UtduBlILZPKh2hszFGmqABAAFwALCAAAAQABAQDDg75ctP0GxwDUvaKneXZ4wbdfr98beJ9jEdvANZpHdjlXTGkxy3tzqE9NQCd83Vy4fni-mA14kqNdmCjs3AAGJToC86EC_QqG81TeeG-MfQuIbBlc1uDLHAcLypEMkjnubyTKUpfkA7t3lqSRgn0ck5XRwZjjNlF9Gj16P9fEY668oeUUe_3rPM5AkEC9OY21Jkod81etdYWuNBuBCXa0S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XdzKUOXbPgcLY1B5bJe9E7fn-gPKYki35RgwphHraSKaYZ1yELpXiT3KPoWXzDvZE5Lqx317bgMGh2RPkf80alJks-iv-aEPDWlSWE5jr3t68gUYx4r_eixdw6tx1ADGCqK1ZEKCul73ptnR8eWorN1njcxlxUaoECvf3rCEuvfZAprBKSWBEnaFPkfgc9lYSBwtP4YKJHttmPX0Dzc85wa6V17SIwNVEiCsQ",
"langcode": [
{
"language": "tam",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ db-server=dev3.mosip.net
s3-user-key=minioadmin
s3-user-secret=minioadmin
s3-host=http://minio.minio:9000
s3-account=uiautomation
s3-account=automation
s3-region=null
reportExpirationInDays=3
# supported values yes or no
push-reports-to-s3=no
push-reports-to-s3=yes
enableDebug=no
# supported values are 1 to 8
threadCount=1
Expand Down
2 changes: 1 addition & 1 deletion admintest/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</triggeringPolicy>
</appender>

<logger name="io.mosip.testrig.pmpui" level="INFO" additivity="false">
<logger name="io.mosip.testrig.adminui" level="INFO" additivity="false">
<appender-ref ref="applicationLogAutomation" />
</logger>

Expand Down