Related to issue 28932: Added test 'I28932_AddToReceiptRequiredOnceIfStockedGroupedProductsUseScan'
authorRafa Alonso <rafael.alonso@openbravo.com>
Sat, 14 Feb 2015 17:21:10 +0100
changeset 4032 adc51b4691fb
parent 4031 8c252926a31c
child 4033 45eeb64360ed
Related to issue 28932: Added test 'I28932_AddToReceiptRequiredOnceIfStockedGroupedProductsUseScan'
src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/AllReceiptsSuite.java
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I28932_AddToReceiptRequiredOnceIfStockedGroupedProductsUseScan.java
--- a/src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java	Sat Feb 14 11:05:28 2015 +0100
+++ b/src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java	Sat Feb 14 17:21:10 2015 +0100
@@ -173,6 +173,7 @@
   BUTTON_RECEIPTDISCOUNTS_APPLY("discountsEdit_btnApply", EnyoKind.BUTTON), //
   FIELD_VERIFIEDRETURN_SEARCH("prslistitemprinter_filterText"), // Verified Returns search
   BUTTON_RECEIPT_INVOICE("orderview_divbtninvoice"), //
+  BUTTON_STOCK_ADDTORECEIPT("productDetailsView_ButtonAddToTicket", EnyoKind.BUTTON), //
 
   // Taxes
   LABEL_RECEIPT_TAX_ROW1_TITLE("listTaxLines_row1_tax"), //
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/AllReceiptsSuite.java	Sat Feb 14 11:05:28 2015 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/AllReceiptsSuite.java	Sat Feb 14 17:21:10 2015 +0100
@@ -31,7 +31,8 @@
     I27864_SurplusReceiptWhenLayawayIsRetrieved.class,
     I28314_ReceiptDiscountsMenuEntryVisibility.class, I28582_NoNewReceiptWhenQueueExists.class,
     I28588_UndefinedQuotationDate.class, I28728_UndoButtonRemovesInformation.class,
-    ReceiptsSearchExample.class, ReceiptRetrievalWithinOrganization.class })
+    ReceiptsSearchExample.class, ReceiptRetrievalWithinOrganization.class,
+    I28932_AddToReceiptRequiredOnceIfStockedGroupedProductsUseScan.class })
 public class AllReceiptsSuite {
-  
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I28932_AddToReceiptRequiredOnceIfStockedGroupedProductsUseScan.java	Sat Feb 14 17:21:10 2015 +0100
@@ -0,0 +1,62 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo S.L.U.
+ * All portions are Copyright (C) 2008-2015 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author RAL
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.receipts;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
+
+public class I28932_AddToReceiptRequiredOnceIfStockedGroupedProductsUseScan extends WebPOSTerminalHelper {
+
+  @Test
+  public void test() {
+    addStockGroupedProduct();
+    tap(TestId.BUTTON_STOCK_ADDTORECEIPT); // only required the first time
+    verify(TestId.LABEL_TOTALTOPAY, "7.90");
+    addStockGroupedProduct();
+    verify(TestId.LABEL_TOTALTOPAY, "15.80");
+
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+  private void addStockGroupedProduct() {
+    tap(TestId.BUTTON_KEYPAD_2);
+    tap(TestId.BUTTON_KEYPAD_1);
+    tap(TestId.BUTTON_KEYPAD_1);
+    tap(TestId.BUTTON_KEYPAD_2);
+    tap(TestId.BUTTON_KEYPAD_3);
+    tap(TestId.BUTTON_KEYPAD_4);
+    tap(TestId.BUTTON_KEYPAD_5);
+    tap(TestId.BUTTON_KEYPAD_0);
+    tap(TestId.BUTTON_KEYPAD_0);
+    tap(TestId.BUTTON_KEYPAD_0);
+    tap(TestId.BUTTON_KEYPAD_0);
+    tap(TestId.BUTTON_KEYPAD_3);
+    tap(TestId.BUTTON_KEYPAD_9);
+    tap(TestId.BUTTON_KEYPAD_ENTER);
+  }
+
+}