Related to issue 28933. Verifies issue 28921: Added 'I28921_VoidLayawayDoneButton' test
authorRafa Alonso <rafael.alonso@openbravo.com>
Tue, 24 Feb 2015 11:22:48 +0100
changeset 4047 0d45662a39f4
parent 4046 85ca32b7735a
child 4048 5f16ca1401ec
Related to issue 28933. Verifies issue 28921: Added 'I28921_VoidLayawayDoneButton' test
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/AllLayawaysTests.java
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/I28921_VoidLayawayDoneButton.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/AllLayawaysTests.java	Mon Feb 23 17:44:44 2015 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/AllLayawaysTests.java	Tue Feb 24 11:22:48 2015 +0100
@@ -29,7 +29,7 @@
 @RunWith(Suite.class)
 @SuiteClasses({ CreateLayawayII.class, I27615_PartiallyPaidLayaway.class,
     LAWa010_CreateLayaway.class, I28963_DoNotShowUseCreditButtonOnLayaways.class,
-    I26458_LayawayCashupWrongTaxesInformation.class })
+    I26458_LayawayCashupWrongTaxesInformation.class, I28921_VoidLayawayDoneButton.class })
 public class AllLayawaysTests {
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/I28921_VoidLayawayDoneButton.java	Tue Feb 24 11:22:48 2015 +0100
@@ -0,0 +1,69 @@
+/*
+ *************************************************************************
+ * 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-2014 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author = RAL
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.layaway;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
+
+public class I28921_VoidLayawayDoneButton extends WebPOSTerminalHelper {
+
+  @Test
+  public void test() {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYTHISRECEIPT);
+    verify(TestId.LABEL_RECEIPT_TYPE, "To be laid away");
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_BACKPACKSANDTRAVEL);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_WHISTLE);
+    verify(TestId.LABEL_TOTALTOPAY, "2.90");
+    final String receiptNo = BackboneHelper.getDocumentNo();
+    final String customer = get(TestId.BUTTON_RECEIPT_CUSTOMER);
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // retrieve the layaway
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYS);
+    tap(TestId.BUTTON_LAYAWAYS_SEARCH);
+    tap(TestId.TABLE_RECEIPTSEARCH, String.format("%s - %s", receiptNo, customer));
+    // verifications
+    verify(TestId.LABEL_RECEIPT_TYPE, "Layaway");
+    verify(TestId.LABEL_RECEIPT_COUNTER, "1");
+    verify(TestId.LABEL_TOTALTOPAY, "2.90");
+
+    // void
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_VOIDLAYAWAY);
+    verify(TestId.LABEL_RECEIPT_TYPE, "Void this Layaway");
+    verify(TestId.LABEL_RECEIPT_COUNTER, "1");
+    verify(TestId.LABEL_TOTALTOPAY, "2.90");
+    isDisabled(TestId.BUTTON_PAY_DONE, false);
+    isDisabled(TestId.BUTTON_LAYAWAY, true);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+}