Related to issue 38888: Failing SS Build
authorMartin Taal <martin.taal@openbravo.com>
Sun, 25 Nov 2018 20:46:01 +0100
changeset 7906 08c34265a179
parent 7905 de65d0ab00ec
child 7907 620ffec4c95f
Related to issue 38888: Failing SS Build
Move the send message logic up to the super class
src-test/org/openbravo/test/mobile/retail/multiserver/selenium/terminals/WebPOSCentralOfflineTerminalHelper.java
src-test/org/openbravo/test/mobile/retail/multiserver/selenium/tests/offline/OfflineMSCentral003_CreateMultiorder.java
--- a/src-test/org/openbravo/test/mobile/retail/multiserver/selenium/terminals/WebPOSCentralOfflineTerminalHelper.java	Sun Nov 25 12:06:10 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/multiserver/selenium/terminals/WebPOSCentralOfflineTerminalHelper.java	Sun Nov 25 20:46:01 2018 +0100
@@ -65,8 +65,8 @@
     tap(TestIdMultiserver.BUTTON_SCAN);
     tap(TestIdMultiserver.BUTTON_SEARCH);
 
-    // wait some time to give the store time to go offline
-    OBUtils.pause(5000);
+    // wait a little time to give the store time to go offline
+    OBUtils.pause(1000);
     if (isScrimShowing()) {
       handleOffline();
       return;
@@ -79,7 +79,7 @@
         TestIdMultiserver.BUTTON_SEARCHPRODUCT_ADHESIVEBODYWARNMERS.getRowName());
 
     // wait a little
-    OBUtils.pause(5000);
+    OBUtils.pause(1000);
     if (isScrimShowing()) {
       handleOffline();
       return;
@@ -89,7 +89,7 @@
     tap(TestIdPack.BUTTON_SEARCH);
     write(TestIdPack.FIELD_SEARCH_TEXT, TestIdPack.BUTTON_SEARCHPRODUCT_ALPINESKIING.getRowName());
     // extra popup sometimes occurs at this time
-    OBUtils.pause(5000);
+    OBUtils.pause(1000);
     if (isScrimShowing()) {
       handleOffline();
       return;
@@ -101,6 +101,12 @@
     tap(TestIdPack.BUTTON_LAYAWAY);
 
     handleOffline();
+
+    // send any messages that got stuck due to transition to offline
+    TestLogger.getLogger().debug("Sending any messages");
+    SeleniumHelper.executeScript("OB.RR.ServTypeTransaction.sendMessages()");
+    TestLogger.getLogger().debug("Forcing the WebPOS to check the connectivity status");
+    SeleniumHelper.executeScript("OB.UTIL.checkConnectivityStatus(null, null, true)");
   }
 
   protected void handleOffline() {
--- a/src-test/org/openbravo/test/mobile/retail/multiserver/selenium/tests/offline/OfflineMSCentral003_CreateMultiorder.java	Sun Nov 25 12:06:10 2018 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/multiserver/selenium/tests/offline/OfflineMSCentral003_CreateMultiorder.java	Sun Nov 25 20:46:01 2018 +0100
@@ -7,8 +7,6 @@
 import java.sql.SQLException;
 
 import org.junit.Test;
-import org.openbravo.test.mobile.core.selenium.SeleniumHelper;
-import org.openbravo.test.mobile.core.utils.TestLogger;
 import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
 import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperSelect;
 import org.openbravo.test.mobile.retail.mobilecore.javascript.BackboneHelper;
@@ -30,12 +28,6 @@
 
     goCentralOffline();
 
-    // send any messages that got stuck due to transition to offline
-    TestLogger.getLogger().debug("Sending any messages");
-    SeleniumHelper.executeScript("OB.RR.ServTypeTransaction.sendMessages()");
-    TestLogger.getLogger().debug("Forcing the WebPOS to check the connectivity status");
-    SeleniumHelper.executeScript("OB.UTIL.checkConnectivityStatus(null, null, true)");
-
     String totalToPay1;
     String totalToPay2;
     String totalGross;