diff --git a/.github/workflows/test-ui-gh_runner.yml b/.github/workflows/test-ui-gh_runner.yml index 5031f8c6a53..82d18bf3353 100644 --- a/.github/workflows/test-ui-gh_runner.yml +++ b/.github/workflows/test-ui-gh_runner.yml @@ -148,7 +148,8 @@ jobs: export PATH=$PATH:$JAVA_HOME/bin wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt-get install -y ./google-chrome-stable_current_amd64.deb - wget https://storage.googleapis.com/chrome-for-testing-public/126.0.6478.126/linux64/chromedriver-linux64.zip + #wget https://storage.googleapis.com/chrome-for-testing-public/126.0.6478.126/linux64/chromedriver-linux64.zip + wget https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/linux64/chromedriver-linux64.zip unzip chromedriver-linux64.zip -d chromedriver sudo mv chromedriver/chromedriver-linux64/chromedriver /usr/bin/chromedriver sudo chown root:root /usr/bin/chromedriver diff --git a/esp/src/test-ui/tests/framework/pages/ActivitiesTest.java b/esp/src/test-ui/tests/framework/pages/ActivitiesTest.java index 9229481f79a..db21a3ac064 100644 --- a/esp/src/test-ui/tests/framework/pages/ActivitiesTest.java +++ b/esp/src/test-ui/tests/framework/pages/ActivitiesTest.java @@ -39,19 +39,28 @@ public void testActivitiesPage() { private void testForNavigationLinks(List navWebElements) { Common.logDebug("Tests started for: Activities page: Testing Navigation Links"); - + for (NavigationWebElement element : navWebElements) { + StringBuilder erorMmsg = new StringBuilder("OK"); + try { element.webElement().click(); - if (testTabsForNavigationLinks(element)) { + if (testTabsForNavigationLinks(element, erorMmsg)) { String msg = "Success: Navigation Menu Link for " + element.name() + ". URL : " + element.hrefValue(); Common.logDetail(msg); + if ( erorMmsg.length() > 0 ){ + String currentPage = getCurrentPage(); + String warningMsg = " Warning: on '" + currentPage + "' page there is missing/not matching element(s):" + erorMmsg; + 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(); + 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); + // Needs to log the error into the logDetails as well. } } catch (Exception ex) { Common.logException("Failure: Exception in Navigation Link for " + element.name() + ". URL : " + element.hrefValue() + " Error: " + ex.getMessage(), ex); @@ -80,19 +89,29 @@ private String getCurrentPage() { return "Invalid Page"; } - private boolean testTabsForNavigationLinks(NavigationWebElement element) { + private boolean testTabsForNavigationLinks(NavigationWebElement element, StringBuilder msg) { + msg.delete(0, msg.length()); + boolean retVal = true; + List tabsList = URLConfig.tabsListMap.get(element.name()); + int numOfElemets = tabsList.size(); + double elementFound = 0.0; // It is double for calculating ratio later. for (String tab : tabsList) { try { WebElement webElement = Common.waitForElement(By.xpath("//a[text()='" + tab + "']")); urlMap.get(element.name()).getUrlMappings().put(tab, new URLMapping(tab, webElement.getAttribute("href"))); + elementFound += 1.0; } catch (TimeoutException ex) { - return false; + msg.append("'" + tab + "', "); } } - - return true; + + if ( (elementFound / numOfElemets) < 0.5 ) { + retVal = false; + } + Common.logDebug("In testTabsForNavigationLinks(element = '" + element.name() + "') -> numOfElemets:" + numOfElemets + ", elementFound:" + elementFound + ", ratio: " + (elementFound / numOfElemets) + ", retVal:" + retVal + "." ); + return retVal; } private List getNavWebElements() {