Skip to content

Commit

Permalink
Changes based on review.
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Vamos <[email protected]>
  • Loading branch information
AttilaVamos committed Jan 7, 2025
1 parent 7063862 commit fc84c3d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-ui-gh_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
- name: Get content
working-directory: /home/runner/HPCCSystems-regression/log
shell: "bash"
run: |
run: |
curl localhost:8010/WsWorkunits/WUQuery.json | python3 -m json.tool > workunits.json
curl localhost:8010/WsDfu/DFUQuery.json?PageSize=250 | python3 -m json.tool > files.json
curl localhost:8010/FileSpray/GetDFUWorkunits.json | python3 -m json.tool > dfu-workunits.json
Expand Down
24 changes: 14 additions & 10 deletions esp/src/test-ui/tests/framework/pages/ActivitiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,27 @@ public void testActivitiesPage() {
private void testForNavigationLinks(List<NavigationWebElement> navWebElements) {

Common.logDebug("Tests started for: Activities page: Testing Navigation Links");

for (NavigationWebElement element : navWebElements) {

StringBuilder erorMmsg = new StringBuilder("OK");
StringBuilder errorMsg = new StringBuilder("OK");

try {
element.webElement().click();

if (testTabsForNavigationLinks(element, erorMmsg)) {
if (testTabsForNavigationLinks(element, errorMsg)) {
String msg = "Success: Navigation Menu Link for " + element.name() + ". URL : " + element.hrefValue();
Common.logDetail(msg);
if ( erorMmsg.length() > 0 ){
if ( errorMsg.length() > 0 ){
String currentPage = getCurrentPage();
String warningMsg = " Warning: on '" + currentPage + "' page there is missing/not matching element(s):" + erorMmsg;
String warningMsg = " Warning: on '" + currentPage + "' page there is missing/not matching element(s):" + errorMsg;
Common.logDetail(warningMsg);
}
} else {
// Needs to report why it is failed
String currentPage = getCurrentPage();
String errorMsg = "Failure: Navigation Menu Link for " + element.name() + " page failed. The current navigation page that we landed on is " + currentPage + ". Current URL : " + element.hrefValue() + ". Missing element(s): " + erorMmsg;
Common.logError(errorMsg);
String failureMsg = "Failure: Navigation Menu Link for " + element.name() + " page failed. The current navigation page that we landed on is " + currentPage + ". Current URL : " + element.hrefValue() + ". Missing element(s): " + errorMsg;
Common.logError(failureMsg);
// Needs to log the error into the logDetails as well.
}
} catch (Exception ex) {
Expand Down Expand Up @@ -94,7 +94,11 @@ private boolean testTabsForNavigationLinks(NavigationWebElement element, StringB
boolean retVal = true;

List<String> tabsList = URLConfig.tabsListMap.get(element.name());
int numOfElemets = tabsList.size();
int numOfElements = tabsList.size();
if ( numOfElements == 0 ) {
return retVal;
}

double elementFound = 0.0; // It is double for calculating ratio later.

for (String tab : tabsList) {
Expand All @@ -107,10 +111,10 @@ private boolean testTabsForNavigationLinks(NavigationWebElement element, StringB
}
}

if ( (elementFound / numOfElemets) < 0.5 ) {
if ( (elementFound / numOfElements) < 0.5 ) {
retVal = false;
}
Common.logDebug("In testTabsForNavigationLinks(element = '" + element.name() + "') -> numOfElemets:" + numOfElemets + ", elementFound:" + elementFound + ", ratio: " + (elementFound / numOfElemets) + ", retVal:" + retVal + "." );
Common.logDebug("In testTabsForNavigationLinks(element = '" + element.name() + "') -> numOfElements:" + numOfElements + ", elementFound:" + elementFound + ", ratio: " + (elementFound / numOfElements) + ", retVal:" + retVal + "." );
return retVal;
}

Expand Down

0 comments on commit fc84c3d

Please sign in to comment.