# HG changeset patch
# User Ranjith S R <ranjith@qualiantech.com>
# Date 1510134069 -19800
#      Wed Nov 08 15:11:09 2017 +0530
# Node ID 902c91e500934fbf00d11bce6096c528a4693e4c
# Parent  85fda510dfd10937290e59b1fa9febc0812ea5ab
Verifies issue 37044 : Modified automated test 'I32878_CheckDeleteKeyOnReceipt'

diff -r 85fda510dfd1 -r 902c91e50093 src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/rfid/AddMultipleRFIDProducts.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/rfid/AddMultipleRFIDProducts.java	Wed Nov 08 11:43:23 2017 +0530
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/rfid/AddMultipleRFIDProducts.java	Wed Nov 08 15:11:09 2017 +0530
@@ -21,8 +21,10 @@
  */
 package org.openbravo.test.mobile.retail.pack.selenium.tests.rfid;
 
+import java.text.DecimalFormat;
+
 import org.openbravo.test.mobile.core.selenium.SeleniumHelper;
-import org.openbravo.test.mobile.core.utils.OBUtils;
+import org.openbravo.test.mobile.core.utils.OBNumber;
 import org.openbravo.test.mobile.core.utils.OBWait;
 import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
 import org.openbravo.test.mobile.retail.mobilecore.javascript.SynchronizationHelper;
@@ -61,37 +63,15 @@
         throw new RuntimeException("isRfidController was expected to be true.");
       }
     };
+
     // Add 20 Base Camp Duffel in row with different serial numbers
-    sendEpcCode("303C000000A4DDC000000001");
-    OBUtils.pause(1000);
-    sendEpcCode("303C000000A4DDC000000002");
-    sendEpcCode("303C000000A4DDC000000003");
-    OBUtils.pause(2000);
-    sendEpcCode("303C000000A4DDC000000004");
-    sendEpcCode("303C000000A4DDC000000005");
-    OBUtils.pause(1000);
-    sendEpcCode("303C000000A4DDC000000006");
-    sendEpcCode("303C000000A4DDC000000007");
-    OBUtils.pause(2000);
-    sendEpcCode("303C000000A4DDC000000008");
-    sendEpcCode("303C000000A4DDC000000009");
-    OBUtils.pause(1000);
-    sendEpcCode("303C000000A4DDC000000010");
-    sendEpcCode("303C000000A4DDC000000011");
-    OBUtils.pause(2000);
-    sendEpcCode("303C000000A4DDC000000012");
-    sendEpcCode("303C000000A4DDC000000013");
-    OBUtils.pause(1000);
-    sendEpcCode("303C000000A4DDC000000014");
-    sendEpcCode("303C000000A4DDC000000015");
-    OBUtils.pause(2000);
-    sendEpcCode("303C000000A4DDC000000016");
-    sendEpcCode("303C000000A4DDC000000017");
-    OBUtils.pause(1000);
-    sendEpcCode("303C000000A4DDC000000018");
-    sendEpcCode("303C000000A4DDC000000019");
-    OBUtils.pause(2000);
-    sendEpcCode("303C000000A4DDC000000020");
+    final DecimalFormat codeFormat = new DecimalFormat("00");
+    final OBNumber price = new OBNumber("89.50");
+    for (int i = 1; i <= 20; i++) {
+      sendEpcCode("303C000000A4DDC0000000" + codeFormat.format(i));
+      verify(TestIdPack.BUTTON_PAY, price.multiply(new OBNumber(i)).toString());
+    }
+
     tap(TestIdPack.BUTTON_PAY);
     new OBWait() {
       @Override
@@ -111,7 +91,5 @@
     tap(TestIdPack.BUTTON_PAY_EXACT);
     tap(TestIdPack.BUTTON_PAY_DONE);
     verify(TestIdPack.LABEL_NEW_RECEIPT, "New Receipt");
-
   }
-
 }
\ No newline at end of file
diff -r 85fda510dfd1 -r 902c91e50093 src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32878_CheckDeleteKeyOnReceipt.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32878_CheckDeleteKeyOnReceipt.java	Wed Nov 08 11:43:23 2017 +0530
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32878_CheckDeleteKeyOnReceipt.java	Wed Nov 08 15:11:09 2017 +0530
@@ -51,6 +51,7 @@
       verify(TestIdPack.LABEL_TOTALTOPAY, "190.40");
 
       SeleniumHelper.pressKey(Keys.DELETE);
+      verify(TestIdPack.LABEL_TOTALTOPAY, "150.50");
       SeleniumHelper.pressKey(Keys.DELETE);
       verify(TestIdPack.LABEL_TOTALTOPAY, "0.00");
 
diff -r 85fda510dfd1 -r 902c91e50093 src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/externalInput/I35661_VerifyKeyEventOnButton.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/externalInput/I35661_VerifyKeyEventOnButton.java	Wed Nov 08 11:43:23 2017 +0530
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/externalInput/I35661_VerifyKeyEventOnButton.java	Wed Nov 08 15:11:09 2017 +0530
@@ -80,6 +80,7 @@
     SeleniumHelper.pressKey(Keys.NUMPAD7);
     SeleniumHelper.pressKey(Keys.NUMPAD6);
     SeleniumHelper.pressKey(Keys.NUMPAD6);
+    verify(TestIdPack.INPUT_POINTOFSALE, "99887766");
     SeleniumHelper.pressKey(Keys.ENTER);
   }
 
