Related to issue 28963 and issue 28933: Added the 'I28963_DoNotShowUseCreditButtonOnLayaways' test
authorRafa Alonso <rafael.alonso@openbravo.com>
Thu, 19 Feb 2015 17:28:23 +0100
changeset 4039 9442eaf65f61
parent 4038 1defb8d9db52
child 4040 476601b5002c
Related to issue 28963 and issue 28933: Added the 'I28963_DoNotShowUseCreditButtonOnLayaways' test
src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/AllLayawaysTests.java
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/I28963_DoNotShowUseCreditButtonOnLayaways.java
--- a/src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java	Tue Feb 17 21:33:12 2015 +0100
+++ b/src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java	Thu Feb 19 17:28:23 2015 +0100
@@ -248,6 +248,7 @@
   // Pay tab
   BUTTON_PAY_EXACT("paymentTabContent_exactButton", EnyoKind.BUTTON), //
   BUTTON_PAY_DONE("paymentTabContent_doneButton", EnyoKind.BUTTON), //
+  BUTTON_PAY_USECREDIT("paymentTabContent_creditsalesaction", EnyoKind.BUTTON), //
   LABEL_PAYMENT_LIMITEDAMOUNT_EXCEEDED("paymentTabContent_errorMaxlimitamount"), //
 
   // Receipt edit tab
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/AllLayawaysTests.java	Tue Feb 17 21:33:12 2015 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/AllLayawaysTests.java	Thu Feb 19 17:28:23 2015 +0100
@@ -28,7 +28,7 @@
 
 @RunWith(Suite.class)
 @SuiteClasses({ CreateLayawayII.class, I27615_PartiallyPaidLayaway.class,
-    LAWa010_CreateLayaway.class })
+    LAWa010_CreateLayaway.class, I28963_DoNotShowUseCreditButtonOnLayaways.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/I28963_DoNotShowUseCreditButtonOnLayaways.java	Thu Feb 19 17:28:23 2015 +0100
@@ -0,0 +1,48 @@
+/*
+ *************************************************************************
+ * 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.layaway;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
+
+public class I28963_DoNotShowUseCreditButtonOnLayaways 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_MOUNTAINEERING);
+    tap(TestId.BUTTON_PRODUCT_MOUNTAINEERING_HARNESSFOURSEASON);
+    verify(TestId.LABEL_TOTALTOPAY, "45.90");
+    tap(TestId.BUTTON_PAY);
+    isVisible(TestId.BUTTON_PAY_USECREDIT, false);
+
+    // restore
+    tap(TestId.BUTTON_DELETERECEIPT);
+    tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+  }
+
+}