Skip to content
Open
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 @@ -206,6 +206,8 @@ public void userloginTest() {
assertTrue(dashboardPage.isUserIDDisplayed(), "Verify if user ID displayed");
assertTrue(dashboardPage.isUserNameDisplayed(), "Verify if user name displayed");
assertTrue(dashboardPage.isStatusTitleDisplayed(), "Verify if status displayed");
dashboardPage.logPacketCounts();
assertTrue(dashboardPage.isLoginUserActive(), "Verify if Loggedin user is active");

assertTrue(registrationTasksPage.isProfileTitleDisplayed(), "Verify if profile title display on homepage");
registrationTasksPage.clickProfileButton();
Expand Down
18 changes: 18 additions & 0 deletions ui-test/src/main/java/regclient/page/BasePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -909,4 +909,22 @@ protected void waitForElementToBeVisible(By locator, int waitTime) {
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(waitTime));
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
}

protected boolean isValuePresentInTable(WebElement tableElement,String rowIdentifier,int valueLineOffset,String expectedValue) {
String tableData = getVisibleValue(tableElement);
if (tableData == null || tableData.isEmpty()) {
return false;
}
String[] lines = tableData.split("\\R");
for (int i = 0; i < lines.length; i++) {
if (lines[i].trim().equals(rowIdentifier)) {
int valueIndex = i + valueLineOffset;
if (valueIndex < lines.length) {
String actualValue = lines[valueIndex].trim();
return actualValue.toLowerCase().contains(expectedValue);
}
}
}
return false;
}
Comment thread
maheswaras marked this conversation as resolved.
}
4 changes: 4 additions & 0 deletions ui-test/src/main/java/regclient/page/DashboardPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ public DashboardPage(AppiumDriver driver) {
public abstract boolean isUserNameDisplayed();

public abstract boolean isStatusTitleDisplayed();

public abstract void logPacketCounts();

public abstract boolean isLoginUserActive();
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
package regclient.pages.arabic;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.WebElement;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import regclient.api.KeycloakUserManager;
import regclient.page.DashboardPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DashboardPageArabic extends DashboardPage {

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

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"لوحة القيادة\"]/following-sibling::android.view.View[3]")
private WebElement packetUploadedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"لوحة القيادة\"]/following-sibling::android.view.View[2]")
private WebElement packetSyncedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"لوحة القيادة\"]/following-sibling::android.view.View[1]")
private WebElement packetCreatedNumber;

@AndroidFindBy(accessibility = "لوحة القيادة")
private WebElement dashboardPageTitle;
Expand All @@ -25,6 +33,9 @@ public class DashboardPageArabic extends DashboardPage {

@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc, 'حالة')]")
private WebElement statusTitle;

@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc,'المستخدمين')]")
private WebElement userTable;

public DashboardPageArabic(AppiumDriver driver) {
super(driver);
Expand Down Expand Up @@ -54,4 +65,29 @@ public boolean isStatusTitleDisplayed() {
return isElementDisplayed(statusTitle);
}

public String getPacketsCreatedCount() {
return getVisibleValue(packetCreatedNumber);
}

public String getPacketsSyncedCount() {
return getVisibleValue(packetSyncedNumber);
}

public String getPacketsUploadedCount() {
return getVisibleValue(packetUploadedNumber);
}

public void logPacketCounts() {
String created = getPacketsCreatedCount();
String synced = getPacketsSyncedCount();
String uploaded = getPacketsUploadedCount();
logger.info("No. of Packets Created : " + created);
logger.info("No. of Packets Synced : " + synced);
logger.info("No. of Packets Uploaded : " + uploaded);
}

public boolean isLoginUserActive() {
return isValuePresentInTable(userTable, KeycloakUserManager.moduleSpecificUser,2,"active");
}

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
package regclient.pages.english;

import org.openqa.selenium.WebElement;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import regclient.api.KeycloakUserManager;
import regclient.page.DashboardPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class DashboardPageEnglish extends DashboardPage {


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


@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[3]")
private WebElement packetUploadedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[2]")
private WebElement packetSyncedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[1]")
private WebElement packetCreatedNumber;


@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Packets Uploaded\"]")
private WebElement packetUploadedLabel;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Packets Synced\"]")
private WebElement packetSyncedLabel;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Packets Created\"]")
private WebElement packetCreatedLabel;


@AndroidFindBy(accessibility = "Dashboard")
private WebElement dashboardPageTitle;
Expand All @@ -25,6 +46,9 @@ public class DashboardPageEnglish extends DashboardPage {

@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc, \"Status\")]")
private WebElement statusTitle;

@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc,'User ID')]")
private WebElement userTable;
Comment thread
maheswaras marked this conversation as resolved.

public DashboardPageEnglish(AppiumDriver driver) {
super(driver);
Expand Down Expand Up @@ -53,4 +77,30 @@ public boolean isUserNameDisplayed() {
public boolean isStatusTitleDisplayed() {
return isElementDisplayed(statusTitle);
}


public String getPacketsCreatedCount() {
return getVisibleValue(packetCreatedNumber);
}

public String getPacketsSyncedCount() {
return getVisibleValue(packetSyncedNumber);
}

public String getPacketsUploadedCount() {
return getVisibleValue(packetUploadedNumber);
}

public void logPacketCounts() {
String created = getPacketsCreatedCount();
String synced = getPacketsSyncedCount();
String uploaded = getPacketsUploadedCount();
logger.info("No. of Packets Created : " + created);
logger.info("No. of Packets Synced : " + synced);
logger.info("No. of Packets Uploaded : " + uploaded);
}

public boolean isLoginUserActive() {
return isValuePresentInTable(userTable, KeycloakUserManager.moduleSpecificUser,2,"active");
}
Comment thread
maheswaras marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
package regclient.pages.french;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.WebElement;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import regclient.api.KeycloakUserManager;
import regclient.page.DashboardPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class DashboardPageFrench extends DashboardPage {


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

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[3]")

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Tableau de bord\"]/following-sibling::android.view.View[3]")
private WebElement packetUploadedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[2]")
@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Tableau de bord\"]/following-sibling::android.view.View[2]")
private WebElement packetSyncedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Tableau de bord\"]/following-sibling::android.view.View[1]")
private WebElement packetCreatedNumber;

@AndroidFindBy(accessibility = "Tableau de bord")
private WebElement dashboardPageTitle;
Expand All @@ -26,6 +37,9 @@ public class DashboardPageFrench extends DashboardPage {
@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc, \"Statut\")]")
private WebElement statusTitle;

@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc,'Utilisatrices')]")
private WebElement userTable;

public DashboardPageFrench(AppiumDriver driver) {
super(driver);
}
Expand Down Expand Up @@ -53,4 +67,29 @@ public boolean isUserNameDisplayed() {
public boolean isStatusTitleDisplayed() {
return isElementDisplayed(statusTitle);
}

public String getPacketsCreatedCount() {
return getVisibleValue(packetCreatedNumber);
}

public String getPacketsSyncedCount() {
return getVisibleValue(packetSyncedNumber);
}

public String getPacketsUploadedCount() {
return getVisibleValue(packetUploadedNumber);
}

public void logPacketCounts() {
String created = getPacketsCreatedCount();
String synced = getPacketsSyncedCount();
String uploaded = getPacketsUploadedCount();
logger.info("No. of Packets Created : " + created);
logger.info("No. of Packets Synced : " + synced);
logger.info("No. of Packets Uploaded : " + uploaded);
}

public boolean isLoginUserActive() {
return isValuePresentInTable(userTable, KeycloakUserManager.moduleSpecificUser,2,"active");
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package regclient.pages.french;

import java.time.Duration;

import org.openqa.selenium.WebElement;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import regclient.page.LoginPage;
import regclient.page.RegistrationTasksPage;


public class LoginPageFrench extends LoginPage {

public LoginPageFrench(AppiumDriver driver) {
Expand Down Expand Up @@ -144,4 +143,5 @@ public void selectLanguage() {
public void clickOnSkipToHomeButton() {
clickOnElement(skipToHomeButton);
}

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
package regclient.pages.hindi;


import org.openqa.selenium.WebElement;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import regclient.api.KeycloakUserManager;
import regclient.page.DashboardPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;



public class DashboardPageHindi extends DashboardPage {

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


@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[3]")
private WebElement packetUploadedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[2]")
private WebElement packetSyncedNumber;

@AndroidFindBy(xpath = "//android.view.View[@content-desc=\"Dashboard\"]/following-sibling::android.view.View[1]")
private WebElement packetCreatedNumber;

@AndroidFindBy(accessibility = "Tableau de bord")
private WebElement dashboardPageTitle;
Expand All @@ -25,6 +37,9 @@ public class DashboardPageHindi extends DashboardPage {

@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc, \"Statut\")]")
private WebElement statusTitle;

@AndroidFindBy(xpath = "//android.view.View[contains(@content-desc,'User ID')]")
private WebElement userTable;

public DashboardPageHindi(AppiumDriver driver) {
super(driver);
Expand Down Expand Up @@ -53,5 +68,30 @@ public boolean isUserNameDisplayed() {
public boolean isStatusTitleDisplayed() {
return isElementDisplayed(statusTitle);
}

public String getPacketsCreatedCount() {
return getVisibleValue(packetCreatedNumber);
}

public String getPacketsSyncedCount() {
return getVisibleValue(packetSyncedNumber);
}

public String getPacketsUploadedCount() {
return getVisibleValue(packetUploadedNumber);
}

public void logPacketCounts() {
String created = getPacketsCreatedCount();
String synced = getPacketsSyncedCount();
String uploaded = getPacketsUploadedCount();
logger.info("No. of Packets Created : " + created);
logger.info("No. of Packets Synced : " + synced);
logger.info("No. of Packets Uploaded : " + uploaded);
}

public boolean isLoginUserActive() {
return isValuePresentInTable(userTable, KeycloakUserManager.moduleSpecificUser,2,"active");
}

}
Loading