Commit 1b494ed5 authored by holivier's avatar holivier

remove all vue-portlet_ in cssSelector after change in vueJs component

to use include-portal-page
parent 6c10133c
......@@ -739,7 +739,7 @@ public class OfbizSWdHelper {
* @throws Exception
*/
public static void clickOnLinkKeyInPortlet(SimpleTestSuite testSuite, String portletName, String keyId) throws Exception {
clickOnLinkKey(testSuite, "vue-portlet_" + portletName + "-00001", keyId);
clickOnLinkKey(testSuite, portletName + "-00001", keyId);
}
/**
......@@ -768,7 +768,7 @@ public class OfbizSWdHelper {
WebDriver driver = testSuite.getDriver();
assertEquals(userLabel.getString("pbWithPortlet")+portletName,
portletDesc,
driver.findElement(By.cssSelector("#vue-portlet_"+portletName+"-00001 header.screenlet-title-bar div.title")).getText());
driver.findElement(By.cssSelector("#"+portletName+"-00001 header.screenlet-title-bar div.title")).getText());
}
/**
......@@ -780,7 +780,7 @@ public class OfbizSWdHelper {
*/
public static void waitPortletIsPresent(SimpleTestSuite testSuite, String portletName, String portletDesc) throws Exception {
testSuite.getDriverWait().until(ExpectedConditions.textToBePresentInElementLocated(
By.cssSelector("#vue-portlet_"+portletName+"-00001 header.screenlet-title-bar div.title"),
By.cssSelector("#"+portletName+"-00001 header.screenlet-title-bar div.title"),
portletDesc));
}
......@@ -884,17 +884,17 @@ public class OfbizSWdHelper {
WebDriver driver = testSuite.getDriver();
List<WebElement> menuItems = null;
// open menu if there is the menu button
if (driver.findElements(By.cssSelector("div#vue-portlet_" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical")).size() > 0) {
WebElement menuButton = driver.findElement(By.cssSelector("div#vue-portlet_" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical"));
if (driver.findElements(By.cssSelector("div#" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical")).size() > 0) {
WebElement menuButton = driver.findElement(By.cssSelector("div#" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical"));
menuButton.click();
}
int try5 = 0;
boolean found = false;
do {
if (driver.findElements(By.cssSelector("div#vue-portlet_" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical")).size() > 0) {
if (driver.findElements(By.cssSelector("div#" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical")).size() > 0) {
menuItems = driver.findElements(By.cssSelector("div.v-menu__content div.v-list div#vue-link > span"));
} else {
menuItems = driver.findElements(By.cssSelector("div#vue-portlet_" + portletName + "-00001 header.screenlet-title-bar button > span"));
menuItems = driver.findElements(By.cssSelector("div#" + portletName + "-00001 header.screenlet-title-bar button > span"));
}
for (WebElement menuItem : menuItems) {
// double test lowerCase and UpperCase because depending on theme
......@@ -926,14 +926,14 @@ public class OfbizSWdHelper {
public static void clickPortletSubmenuIcon(SimpleTestSuite testSuite, String portletName, String mdiIcon) throws Exception {
WebDriver driver = testSuite.getDriver();
// open menu if there is the menu button
if (driver.findElements(By.cssSelector("div#vue-portlet_" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical")).size() > 0) {
WebElement menuButton = driver.findElement(By.cssSelector("div#vue-portlet_" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical"));
if (driver.findElements(By.cssSelector("div#" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical")).size() > 0) {
WebElement menuButton = driver.findElement(By.cssSelector("div#" + portletName + "-00001 header.screenlet-title-bar button span#mdi-dots-vertical"));
menuButton.click();
}
int try5 = 0;
boolean found = false;
do {
WebElement menuItem = driver.findElement(By.cssSelector("div#vue-portlet_" + portletName + "-00001 header.screenlet-title-bar span#"+mdiIcon));
WebElement menuItem = driver.findElement(By.cssSelector("div#" + portletName + "-00001 header.screenlet-title-bar span#"+mdiIcon));
if (menuItem != null) {
testSuite.click(menuItem);
found = true;
......
......@@ -1013,7 +1013,7 @@ public class Utils {
return searchLineC(driver, cssSelect, "", labelSearched, null, null, 0, 1, errorIfNotFound, true);
}
/** cf {@link #searchLineC(WebDriver, String, String, String, String, String, int, int, boolean, boolean)} with
* <br/>cssSelect = div#vue-portlet_"+portletName+"-00001 tr:nth-child(position) td span
* <br/>cssSelect = div#"+portletName+"-00001 tr:nth-child(position) td span
* <br/>positionStart = 2
* <br/>indexAdd = 1
* <br/>equals = true
......@@ -1022,7 +1022,7 @@ public class Utils {
*/
public static int searchLineInPortlet(SimpleTestSuite source, String portletName, String labelSearched, boolean errorIfNotFound) throws Exception {
WebDriver driver = source.getDriver();
return searchLineC(driver, "div#vue-portlet_"+portletName+"-00001 tr:nth-child(position) td span", "", labelSearched, null, null, 2, 1, errorIfNotFound, true) - 2;
return searchLineC(driver, "div#"+portletName+"-00001 tr:nth-child(position) td span", "", labelSearched, null, null, 2, 1, errorIfNotFound, true) - 2;
}
/**
......
......@@ -124,7 +124,7 @@ public class ExampleVueJsScreens {
public static void testPortletIsEmpty(SimpleTestSuite testSuite, String portletName) throws Exception {
ResourceBundle userLabel = testSuite.getUserLabel();
WebDriver driver = testSuite.getDriver();
WebElement portlet = driver.findElement(By.cssSelector("#vue-portlet_"+portletName+"-00001"));
WebElement portlet = driver.findElement(By.cssSelector("#"+portletName+"-00001"));
assertEquals(userLabel.getString("pbWithPortlet")+portletName,
1,
portlet.findElements(By.cssSelector("div")).size());
......@@ -163,14 +163,14 @@ public class ExampleVueJsScreens {
* return number of row there are in list in portletName.
* @param testSuite
* @param portletName
* @return nbLine By.cssSelector("tr#vue-item-row")).size() in div#vue-portlet_"+portletName+"-00001
* @return nbLine By.cssSelector("tr#vue-item-row")).size() in div#"+portletName+"-00001
* @throws Exception
*/
public static int howNbLineInList(SimpleTestSuite testSuite, String portletName) throws Exception {
WebDriver driver = testSuite.getDriver();
// wait until loader-wrapper disappear
testSuite.waitLoaderWrapper();
WebElement weForm = driver.findElement(By.cssSelector("div#vue-portlet_"+portletName+"-00001"));
WebElement weForm = driver.findElement(By.cssSelector("div#"+portletName+"-00001"));
return weForm.findElements(By.cssSelector("tr#vue-item-row")).size();
}
......@@ -201,7 +201,7 @@ public class ExampleVueJsScreens {
WebDriver driver = testSuite.getDriver();
assertEquals(userLabel.getString("pbWithPortlet")+portletName,
present,
driver.findElements(By.cssSelector("div#vue-portlet_"+portletName+"-00001 div#vue-next-prev" )).size()>0);
driver.findElements(By.cssSelector("div#"+portletName+"-00001 div#vue-next-prev" )).size()>0);
}
/**
......@@ -591,7 +591,7 @@ public class ExampleVueJsScreens {
LogSelenium.showInfoPanel(module, testSuite,
(logMessage != null) ? logMessage : userLabel.getString("GotoRecapPage"));
WebDriver driver = testSuite.getDriver();
WebElement portlet = driver.findElement(By.id("vue-portlet_ExampleDetailsMenu-00001"));
WebElement portlet = driver.findElement(By.id("ExampleDetailsMenu-00001"));
// click on second button in external menu
List<WebElement> items = portlet.findElements(By.cssSelector("header#vue-menu button a span"));
WebElement button = null;
......@@ -618,7 +618,7 @@ public class ExampleVueJsScreens {
LogSelenium.showInfoPanel(module, testSuite,
(logMessage != null) ? logMessage : userLabel.getString("GotoStdAddFeature"));
WebDriver driver = testSuite.getDriver();
WebElement portlet = driver.findElement(By.id("vue-portlet_ExampleFeatureAppls-00001"));
WebElement portlet = driver.findElement(By.id("ExampleFeatureAppls-00001"));
// click on second button in external menu
WebElement button = portlet.findElement(By.cssSelector("ul>div#vue-menu:nth-child(2) ul>li#vue-menu-item:nth-child(1)"));
testSuite.click(button);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment