Related issue 40023: Keep BP Filters test
authorEduardo Becerra <ebec70@yahoo.com>
Fri, 01 Feb 2019 13:43:17 +0100
changeset 8219 962d5f90377f
parent 8218 6c54dc015a00
child 8220 55e70c0a5d3d
child 8281 376c36f2c803
Related issue 40023: Keep BP Filters test
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customer/I40023_KeepFiltersInBPSelector.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customer/I40023_KeepFiltersInBPSelector.java	Fri Feb 01 13:43:17 2019 +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) 2019 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.customer;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack;
+import org.openbravo.test.mobile.retail.pack.selenium.terminals.WebPOSTerminalHelper;
+
+public class I40023_KeepFiltersInBPSelector extends WebPOSTerminalHelper {
+  final static String CUSTOMER_NAME = "VBS";
+
+  @Test
+  public void testNoKeepFilters() {
+    // Change BP filter
+    tap(TestIdPack.BUTTON_RECEIPT_CUSTOMER);
+    write(TestIdPack.FIELD_CUSTOMER_MODAL, CUSTOMER_NAME);
+    tap(TestIdPack.BUTTON_CUSTOMER_MODAL_SEARCH);
+    tap(TestIdPack.LABEL_CUSTOMER_LIST_ROW1);
+    verify(TestIdPack.BUTTON_RECEIPT_CUSTOMER, "VBS Customer");
+    // Test BP filter is not keep
+    tap(TestIdPack.BUTTON_RECEIPT_CUSTOMER);
+    verify(TestIdPack.FIELD_CUSTOMER_MODAL, "");
+    tap(TestIdPack.BUTTON_CUSTOMER_SELECTOR_CLOSE);
+  }
+
+  @Test
+  public void testOpenReceiptKeepFilters() {
+    // Open Receipt Selector
+    tap(TestIdPack.BUTTON_MENU);
+    tap(TestIdPack.BUTTON_MENU_OPENRECEIPT);
+    TestIdPack.FIELD_OPEN_RECEIPT_FILTER_COMBO.enyoNode().executeExtension(".setSelected(1)");
+    TestIdPack.FIELD_OPEN_RECEIPT_FILTER_COMBO.enyoNode().executeExtension(".change()");
+    TestIdPack.FIELD_OPEN_RECEIPT_FILTER_COMBO.enyoNode()
+        .executeExtension(".waterfall('onchange')");
+    // Open BP selector
+    tap(TestIdPack.BUTTON_OPEN_RECEIPT_FILTER_CUSTOMER);
+    write(TestIdPack.FIELD_CUSTOMER_MODAL, CUSTOMER_NAME);
+    tap(TestIdPack.BUTTON_CUSTOMER_MODAL_SEARCH);
+    tap(TestIdPack.LABEL_CUSTOMER_LIST_ROW1);
+    verify(TestIdPack.BUTTON_OPEN_RECEIPT_FILTER_CUSTOMER, "VBS Customer");
+    // Open BP Selector again
+    tap(TestIdPack.BUTTON_OPEN_RECEIPT_FILTER_CUSTOMER);
+    verify(TestIdPack.FIELD_CUSTOMER_MODAL, CUSTOMER_NAME);
+    tap(TestIdPack.LABEL_CUSTOMER_LIST_ROW1);
+    verify(TestIdPack.BUTTON_OPEN_RECEIPT_FILTER_CUSTOMER, "VBS Customer");
+    tap(TestIdPack.BUTTON_OPEN_RECEIPT_CLOSE);
+  }
+
+}