Related to issue 41719: Trying to stabilize test OP_Test12_PickingAndDeliveredQtyInOpenedTicket
authorAlejandro <alekosmp86@gmail.com>
Mon, 02 Sep 2019 15:13:22 -0400
changeset 8964 94d2a66e4373
parent 8963 4275a69722f6
child 8965 4d6a6ebc3417
Related to issue 41719: Trying to stabilize test OP_Test12_PickingAndDeliveredQtyInOpenedTicket
in HighVolume mode
src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/orderpreparationawo/OP_Test12_PickingAndDeliveredQtyInOpenedTicket.java
--- a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/orderpreparationawo/OP_Test12_PickingAndDeliveredQtyInOpenedTicket.java	Mon Sep 02 18:32:09 2019 +0530
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/orderpreparationawo/OP_Test12_PickingAndDeliveredQtyInOpenedTicket.java	Mon Sep 02 15:13:22 2019 -0400
@@ -26,15 +26,13 @@
 import static org.junit.Assert.assertThat;
 
 import org.junit.Test;
-import org.openbravo.test.mobile.core.junit.TestAnnotations;
-import org.openbravo.test.mobile.core.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.core.junit.SequentialTestInfo;
 import org.openbravo.test.mobile.core.utils.OBUtils;
 import org.openbravo.test.mobile.retail.extmodules.selenium.TestIdExtModules;
 import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
 import org.openbravo.test.mobile.retail.mobilecore.javascript.BackboneHelper;
 import org.openbravo.test.mobile.retail.mobilecore.selenium.TestIdConstructor;
 import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack;
-import org.openqa.selenium.Keys;
 
 @TestClassAnnotations(isHighVolumeCompatible = true)
 public class OP_Test12_PickingAndDeliveredQtyInOpenedTicket extends OrderPreparationTerminalHelper {
@@ -81,7 +79,6 @@
    * </ul>
    */
   @Test
-  @TestAnnotations(waitFixOf = 41719)
   public void test() {
     String ticketId = BackboneHelper.getDocumentNo();
 
@@ -89,28 +86,40 @@
         PICK_IN_STORE_DELIVERY_MODE);
 
     payTicketInCash();
-    openReceipt(ticketId);
 
-    OBUtils.pause(500);
-    SeleniumHelper.pressKey(Keys.F7);
+    if (SequentialTestInfo.getHighVolumenMode()) {
+      tap(new TestIdConstructor("confirmationPopup_btnPrepare"));
+    } else {
+      openOrderPreparationPopup();
+      write(TestIdExtModules.ORDER_PREPARATION_POPUP_FILTER, ticketId);
+      tap(TestIdExtModules.ORDER_PREPARATION_POPUP_SEARCH);
+    }
+    isVisible(TestIdExtModules.ORDER_PREPARATION_ORDER_LIST_ROW1, true);
 
     setQuantityToPrepare(1);
     prepareSelectedLines();
     final String firstPickingList = getDocumentNoOfLastCreatedPickingList();
 
+    openReceipt(ticketId);
     TestIdConstructor rowControl5 = TestIdExtModules.LINE_ROW_CONTROL_5;
     TestIdConstructor rowControl8 = TestIdExtModules.LINE_ROW_CONTROL_8;
     TestIdConstructor rowControl11 = TestIdExtModules.LINE_ROW_CONTROL_11;
 
     assertThat("Quantity in Picking = 1",
         rowControl8.enyoNode().getContent().contains("Quantity in picking (1)"), equalTo(true));
+    OBUtils.pause(1000);
+    tap(TestIdPack.BUTTON_DELETERECEIPT);
 
-    SeleniumHelper.pressKey(Keys.F7);
+    openOrderPreparationPopup();
+    write(TestIdExtModules.ORDER_PREPARATION_POPUP_FILTER, ticketId);
+    tap(TestIdExtModules.ORDER_PREPARATION_POPUP_SEARCH);
+    isVisible(TestIdExtModules.ORDER_PREPARATION_ORDER_LIST_ROW1, true);
 
     setQuantityToPrepare(2);
     prepareSelectedLines();
     final String secondPickingList = getDocumentNoOfLastCreatedPickingList();
 
+    openReceipt(ticketId);
     waitUntilIsVisible(rowControl8, true);
     assertThat("Quantity in Picking should be three",
         rowControl8.enyoNode().getContent().contains("Quantity in picking (3)"), equalTo(true));
@@ -157,7 +166,10 @@
         rowControl5.enyoNode().getContent().contains("Delivered Quantity: 3"), equalTo(true));
     assertThat("Quantity in Picking should not be visible", exists(rowControl11), equalTo(false));
 
-    SeleniumHelper.pressKey(Keys.F7);
+    openOrderPreparationPopup();
+    write(TestIdExtModules.ORDER_PREPARATION_POPUP_FILTER, ticketId);
+    tap(TestIdExtModules.ORDER_PREPARATION_POPUP_SEARCH);
+    isVisible(TestIdExtModules.ORDER_PREPARATION_ORDER_LIST_ROW1, true);
 
     waitUntilIsVisible(TestIdExtModules.ORDER_PREPARATION_ORDER_LIST_ROW1_ORDERLINEINFO, true);
     assertThat("Pending Quantity should be two",