Commit 3c7fbcf4 authored by holivier's avatar holivier

Some corrections after first test for screen page

parent 5892bdf8
......@@ -290,6 +290,10 @@
<value xml:lang="en">Pb in content field </value>
<value xml:lang="fr">Problème de contenu du champ </value>
</property>
<property key="pbWithContainer">
<value xml:lang="en">Pb showing container </value>
<value xml:lang="fr">Problème d'affichage du container </value>
</property>
<property key="pbWithPortlet">
<value xml:lang="en">Pb showing portlet </value>
<value xml:lang="fr">Problème d'affichage de la portlet </value>
......
......@@ -28,7 +28,7 @@ import org.ofbizextra.ofbswd.use.NavigationActions;
* <p>All the unit actions or testing method are not in this class but in the class {@link ExampleVueJsScreens}.</p>
*
*/
@FixMethodOrder(MethodSorters.DEFAULT) // default order is method in class; needed because status change needed to know which new status is possible
@FixMethodOrder(MethodSorters.NAME_ASCENDING) // needed because status change needed to know which new status is possible
public class ExampleVuejsTestSuite extends SimpleTestSuite {
private static final String module = ExampleVuejsTestSuite.class.getName();
......@@ -177,7 +177,7 @@ public class ExampleVuejsTestSuite extends SimpleTestSuite {
* @throws Exception
*/
@Test
public void exampleMgmtPPFrontJs() throws Exception {
public void aexampleMgmtPPFrontJs() throws Exception {
ResourceBundle userLabel = this.getUserLabel();
DataObj login = testCaseData.getDataObj("login");
// login to examplefjs
......@@ -412,7 +412,7 @@ public class ExampleVuejsTestSuite extends SimpleTestSuite {
* @throws Exception
*/
@Test
public void exampleRecapPPFrontJs() throws Exception {
public void bexampleRecapPPFrontJs() throws Exception {
//ResourceBundle userLabel = this.getUserLabel();
DataObj login = testCaseData.getDataObj("login");
NavigationActions.login(this, login, "Simple test for frontJsExampleRecap");
......@@ -632,12 +632,12 @@ public class ExampleVuejsTestSuite extends SimpleTestSuite {
* <li>test if portlet ShowExample contain exampleId with the correct value via {@link OfbizSWdHelper#testFieldFormDescIs testFieldFormDescIs}</li>
* </ul>
* </li>
* </ol> TODO
* </ol>
*
* @throws Exception
*/
@Test
public void exampleMgmtPg() throws Exception {
public void cexampleMgmtPg() throws Exception {
ResourceBundle userLabel = this.getUserLabel();
DataObj login = testCaseData.getDataObj("login");
// login to examplefjs
......@@ -706,15 +706,15 @@ public class ExampleVuejsTestSuite extends SimpleTestSuite {
ExampleVueJsScreens.toggleCollapseScreenlet(this, "ListExampleLayer");
OfbizSWdHelper.clickOnLinkKey(this, "listExample", exampleId );
OfbizSWdHelper.testScreenletIsOk(this, "showExample_show", "Show Example");
OfbizSWdHelper.clickScreenletSubmenu(this, "detailMenu", "Items", null);
// test ExampleItems
OfbizSWdHelper.clickScreenletSubmenu(this, "detailMenu", "Items", null);
DataObj exampleItem = testCaseData.getDataObj("item1");
LogSelenium.showInfoPanel(module, this, "Test ExampleItems screenlet, First Add one ");
int nbLine = ExampleVueJsScreens.howNbLineInListById(this, "listExampleItem_show");
OfbizSWdHelper.clickScreenletSubmenu(this, "listExampleItem_show", null, "mdi-plus-circle");
ExampleVueJsScreens.addExampleItem(this, exampleItem, null);
assertEquals(userLabel.getString("pbWithScreenLet")+"ExampleItems",ExampleVueJsScreens.howNbLineInListById(this, "listExampleItem_show"), nbLine+1);
assertEquals(userLabel.getString("pbWithScreenlet")+"ExampleItems",ExampleVueJsScreens.howNbLineInListById(this, "listExampleItem_show"), nbLine+1);
exampleItem.remove("description");
OfbizSWdHelper.clickScreenletSubmenu(this, "listExampleItem_show", null, "mdi-plus-circle");
......@@ -722,7 +722,7 @@ public class ExampleVuejsTestSuite extends SimpleTestSuite {
OfbizSWdHelper.clickOnLinkKey(this, "listExampleItem_show", String.format("%05d", nbLine+1) );
ExampleVueJsScreens.editExampleItem(this, testCaseData.getDataObj("item1.1"), null);
ExampleVueJsScreens.deleteExampleItem(this, "ExampleItems", nbLine+1, null);
assertEquals(userLabel.getString("pbWithScreenLet")+"ExampleItems",ExampleVueJsScreens.howNbLineInListById(this, "listExampleItem_show"), nbLine);
assertEquals(userLabel.getString("pbWithScreenlet")+"ExampleItems",ExampleVueJsScreens.howNbLineInListById(this, "listExampleItem_show"), nbLine);
// test ExampleStatus
LogSelenium.showInfoPanel(module, this, "Test ExampleStatus history screenlet, First check current status");
......@@ -733,14 +733,14 @@ public class ExampleVuejsTestSuite extends SimpleTestSuite {
OfbizSWdHelper.clickScreenletSubmenu(this, "showExample_show", null, "mdi-pencil");
ExampleVueJsScreens.updateExample(this, testCaseData.getDataObj("updateEx2Status"+(nbStatus+1)), "Change status for example and check if new value is in history ");
OfbizSWdHelper.clickScreenletSubmenu(this, "detailMenu", "Status history", null);
assertEquals(userLabel.getString("pbWithScreenLet")+"ExampleStatus",ExampleVueJsScreens.howNbLineInListById(this, "statusExample_show"), nbStatus+1);
assertEquals(userLabel.getString("pbWithScreenlet")+"ExampleStatus",ExampleVueJsScreens.howNbLineInListById(this, "statusExample_show"), nbStatus+1);
OfbizSWdHelper.testFieldFormDescIs(this, "ExampleStatus_statusEndDate", nbStatus, "");
if (nbStatus == 0) {
OfbizSWdHelper.clickScreenletSubmenu(this, "detailMenu", "Show", null);
OfbizSWdHelper.clickScreenletSubmenu(this, "showExample_show", null, "mdi-pencil");
ExampleVueJsScreens.updateExample(this, testCaseData.getDataObj("updateEx2Status2"), "Change status for example and check new values is in history ");
OfbizSWdHelper.clickScreenletSubmenu(this, "detailMenu", "Status history", null);
assertEquals(userLabel.getString("pbWithScreenLet")+"ExampleStatus",ExampleVueJsScreens.howNbLineInListById(this, "statusExample_show"), 2);
assertEquals(userLabel.getString("pbWithScreenlet")+"ExampleStatus",ExampleVueJsScreens.howNbLineInListById(this, "statusExample_show"), 2);
nbStatus = 1;
}
ExampleVueJsScreens.testIfEndDateEqualDate(this, "ExampleStatus_status", nbStatus-1);
......
......@@ -674,7 +674,7 @@ public class SimpleTestSuite {
public void selectByVisibleText(By by, String text) {
waitElementPresenceAndVisibility(by);
if (vuejs) {
actions.moveToElement(driver.findElement(By.cssSelector("div#portal"))).perform();
actions.moveToElement(driver.findElement(By.cssSelector("div#app"))).perform();
actions.moveToElement(driver.findElement(by)).perform();
actions.click().perform();
List<WebElement> menuItems = driver.findElements(By.cssSelector("div.v-menu__content div.v-list span"));
......@@ -739,7 +739,7 @@ public class SimpleTestSuite {
waitElementPresenceAndVisibility(by);
if (vuejs) {
if (!value.isEmpty()) {
actions.moveToElement(driver.findElement(By.cssSelector("div#portal"))).perform();
actions.moveToElement(driver.findElement(By.cssSelector("div#app"))).perform();
actions.moveToElement(driver.findElement(by)).perform();
actions.click().perform();
Boolean found = false;
......@@ -1073,7 +1073,7 @@ public class SimpleTestSuite {
if (element.getText().contains(optionText)) {
foundText = true;
// workaround for firefox : first moveTo to go to the middle of screen
actions.moveToElement(driver.findElement(By.cssSelector("div#portal"))).perform();
actions.moveToElement(driver.findElement(By.cssSelector("div#app"))).perform();
actions.moveToElement(element).perform();
actions.click().perform();
}
......
......@@ -754,7 +754,7 @@ public class OfbizSWdHelper {
WebDriver driver = testSuite.getDriver();
assertEquals(userLabel.getString("pbWithScreenlet")+screenletId,
screenletDesc,
driver.findElement(By.cssSelector("div#"+screenletId+"- header.screenlet-title-bar div.title")).getText());
driver.findElement(By.cssSelector("div#"+screenletId+" header.screenlet-title-bar div.title")).getText());
}
/**
* test if portletName is present and if title is portletDesc
......
......@@ -110,7 +110,7 @@ public class ExampleVueJsScreens {
ResourceBundle userLabel = testSuite.getUserLabel();
WebDriver driver = testSuite.getDriver();
WebElement portlet = driver.findElement(By.cssSelector("div#"+containerId));
assertEquals(userLabel.getString("pbWithContainer ")+containerId,
assertEquals(userLabel.getString("pbWithContainer")+containerId,
1,
portlet.findElements(By.cssSelector("div")).size());
}
......@@ -468,19 +468,20 @@ public class ExampleVueJsScreens {
//testSuite.checkVueJsErrorMessage("The following required parameter is missing: [createExampleItem.description]");
}
/**
* Delete ExampleItem for line ${line} and {@link SimpleTestSuite#checkVueJsEventMessage SimpleTestSuite.checkVueJsEventMessage} for standard entity-auto delete message.
* Delete ExampleItem for line ${line} and {@link SimpleTestSuite#checkVueJsEventMessage SimpleTestSuite.checkVueJsEventMessage} for
* standard entity-auto delete message.
* @param testSuite
* @param portletName
* @param formName grid formName
* @param line with first line equal 0 not 1
* @param logMessage if null std message DeleteItemForLine is show
* @throws Exception
*/
public static void deleteExampleItem(SimpleTestSuite testSuite, String portletName, int line, String logMessage) throws Exception {
public static void deleteExampleItem(SimpleTestSuite testSuite, String formName, int line, String logMessage) throws Exception {
ResourceBundle userLabel = testSuite.getUserLabel();
LogSelenium.showInfoPanel(module, testSuite,
(logMessage != null) ? logMessage : String.format(userLabel.getString("DeleteItemForLine"), String.format("%02d", line)));
WebElement ws = testSuite.getDriver().findElement(By.cssSelector("div#vue-portlet_"+portletName+"-00001 tr:nth-child("+(line+1)+") td[fieldname='deleteLink'] button"));
testSuite.clickWithAlert(By.cssSelector("div#vue-portlet_"+portletName+"-00001 tr:nth-child("+(line+1)+") td[fieldname='deleteLink'] button"),
WebElement ws = testSuite.getDriver().findElement(By.cssSelector("table#"+formName+" tr:nth-child("+(line+1)+") td[fieldname='deleteLink'] button"));
testSuite.clickWithAlert(By.cssSelector("table#"+formName+" tr:nth-child("+(line+1)+") td[fieldname='deleteLink'] button"),
"Do you confirm the suppression?");
testSuite.checkVueJsEventMessage("Example Item Entity deleted successfully");
testSuite.getDriverWait().until(ExpectedConditions.stalenessOf(ws));
......
......@@ -169,7 +169,7 @@
</test-case>
</test-suite>
<test-suite name="ExampleVuejsTestSuite">
<test-case name="exampleRecapPPFrontJs">
<test-case name="bexampleRecapPPFrontJs">
<extend-object data-obj="updateEx2Status1" test-case="exampleOverview" test-suite="ExampleScreensOverview" scenario="default"/>
<extend-object data-obj="updateEx2Status2" test-case="exampleOverview" test-suite="ExampleScreensOverview" scenario="default"/>
<data-obj name="login">
......@@ -216,8 +216,8 @@
<string name="exampleTypeId" value="MADE_UP"/>
</data-obj>
</test-case>
<test-case name="exampleMgmtPPFrontJs">
<extend-object data-obj="login" test-case="exampleRecapPPFrontJs" test-suite="ExampleVuejsTestSuite" scenario="default"/>
<test-case name="aexampleMgmtPPFrontJs">
<extend-object data-obj="login" test-case="bexampleRecapPPFrontJs" test-suite="ExampleVuejsTestSuite" scenario="default"/>
<data-obj name="menuFjsMgmt">
<integer name="menuNum" value="-1"/>
<string name="optionName" value="Examples management (MgmtPageFrontJs)"/>
......@@ -247,8 +247,8 @@
<string name="amount" value="20"/>
</data-obj>
</test-case>
<test-case name="exampleMgmtPg">
<extend-object data-obj="login" test-case="exampleRecapPPFrontJs" test-suite="ExampleVuejsTestSuite" scenario="default"/>
<test-case name="cexampleMgmtPg">
<extend-object data-obj="login" test-case="bexampleRecapPPFrontJs" test-suite="ExampleVuejsTestSuite" scenario="default"/>
<data-obj name="menuMgmtPg">
<integer name="menuNum" value="-1"/>
<string name="optionName" value="Examples management"/>
......@@ -258,7 +258,7 @@
<extend-object data-obj="criteria_Id2" test-case="exampleOverview" test-suite="ExampleScreensOverview" scenario="default"/>
<extend-object data-obj="updateEx2Status1" test-case="exampleOverview" test-suite="ExampleScreensOverview" scenario="default"/>
<extend-object data-obj="updateEx2Status2" test-case="exampleOverview" test-suite="ExampleScreensOverview" scenario="default"/>
<extend-object data-obj="updateEx2Status3" test-case="exampleRecapPPFrontJs" test-suite="ExampleVuejsTestSuite" scenario="default"/>
<extend-object data-obj="updateEx2Status3" test-case="bexampleRecapPPFrontJs" test-suite="ExampleVuejsTestSuite" scenario="default"/>
<data-obj name="exTest3">
<string name="exampleIdRef" value="EX10"/>
<indexed name="exampleId" value="EX1"/>
......
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