Attached Files | i38863_mobile_core.diff [^] (490 bytes) 2018-06-29 10:44 [Show Content] [Hide Content]diff --git a/web/org.openbravo.mobile.core/assets/css/ob-standard.css b/web/org.openbravo.mobile.core/assets/css/ob-standard.css
--- a/web/org.openbravo.mobile.core/assets/css/ob-standard.css
+++ b/web/org.openbravo.mobile.core/assets/css/ob-standard.css
@@ -37,8 +37,8 @@
}
input.error {
- background-color: rgb(255, 0, 0);
- background-color: rgba(255, 0, 0, 0.5);
+ background-color: rgb(255, 0, 0) !important;
+ background-color: rgba(255, 0, 0, 0.5) !important;
}
button {
posterminal.diff [^] (2,681 bytes) 2018-07-25 07:23 [Show Content] [Hide Content]diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
@@ -64,6 +64,21 @@
this.waterfall('onDisableButton', {
disabled: false
});
+ if (this.args.focusError) {
+ _.each(this.$.body.$.edit_createcustomers_impl.$.customerAttributes.$, function (attribute) {
+ _.each(this.args.focusError, function (field, indx) {
+ if (attribute.name === 'line_' + field) {
+ var attr = attribute.$.newAttribute.$[field];
+ attr.addClass('error');
+ if (indx === 0) {
+ window.setTimeout(function () {
+ attr.focus();
+ }, 100);
+ }
+ }
+ });
+ }, this);
+ }
//show
return true;
} else {
@@ -75,16 +90,30 @@
}
},
executeOnHide: function () {
+ if (this.args.focusError) {
+ _.each(this.$.body.$.edit_createcustomers_impl.$.customerAttributes.$, function (attribute) {
+ _.each(this.args.focusError, function (field) {
+ if (attribute.name === 'line_' + field) {
+ var attr = attribute.$.newAttribute.$[field];
+ attr.removeClass('error');
+ attribute.$.labelLine.setStyle('color:black;');
+ }
+ });
+ }, this);
+ }
+
var navigationPath = this.customer || !this.args.cancelNavigationPath ? this.args.navigationPath : this.args.cancelNavigationPath;
- this.doShowPopup({
- popup: navigationPath[navigationPath.length - 1],
- args: {
- businessPartner: this.customer ? this.customer : this.args.businessPartner,
- target: this.args.target,
- navigationPath: OB.UTIL.BusinessPartnerSelector.cloneAndPop(navigationPath),
- makeSearch: this.customer !== undefined
- }
- });
+ if (navigationPath) {
+ this.doShowPopup({
+ popup: navigationPath[navigationPath.length - 1],
+ args: {
+ businessPartner: this.customer ? this.customer : this.args.businessPartner,
+ target: this.args.target,
+ navigationPath: OB.UTIL.BusinessPartnerSelector.cloneAndPop(navigationPath),
+ makeSearch: this.customer !== undefined
+ }
+ });
+ }
},
showingChanged: function () {
this.inherited(arguments);
mobileCore2.diff [^] (585 bytes) 2018-07-30 17:42 [Show Content] [Hide Content]diff --git a/web/org.openbravo.mobile.core/source/component/ob-commonbuttons.js b/web/org.openbravo.mobile.core/source/component/ob-commonbuttons.js
--- a/web/org.openbravo.mobile.core/source/component/ob-commonbuttons.js
+++ b/web/org.openbravo.mobile.core/source/component/ob-commonbuttons.js
@@ -403,6 +403,9 @@
}
},
focusInPopup: function () {
+ if (this.args.focusError) {
+ return true;
+ }
var allChildsArray = OB.UTIL.getAllChildsSorted(this),
isFirstFocusableElementObtained = false,
tagName, i, defaultActionCandidate, candidate;
emailtests.diff [^] (21,402 bytes) 2018-08-20 11:32 [Show Content] [Hide Content]diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/TestIdExtModules.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/TestIdExtModules.java
--- a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/TestIdExtModules.java
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/TestIdExtModules.java
@@ -881,4 +881,12 @@
// Product based on Gift Card
public static TestIdConstructor GIFTCARD_ONWER_BUTTON = new TestIdConstructor(
"giftcardobgcneGCOwner_businessPartnerGiftCard", EnyoKind.BUTTON); //
+
+ // Email And Phone Icons
+ public static TestIdConstructor BUTTON_OBEMLPH_RECEIPT_EMAIL = new TestIdConstructor(
+ "receiptButtons_OBEMLPH.UI.BPEmailButton", EnyoKind.BUTTON);
+ public static TestIdConstructor BUTTON_OBEMLPH_RECEIPT_PHONE = new TestIdConstructor(
+ "receiptButtons_OBEMLPH.UI.BPPhoneButton", EnyoKind.BUTTON);
+ public static TestIdConstructor BUTTON_OBEMLPH_ROW1_PHONE = new TestIdConstructor(
+ "stBPAssignToReceipt_row1_bPPhoneIcon", EnyoKind.BUTTON);
}
diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/suites/concurrent/job011/EmailPhoneIconsSuite.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/suites/concurrent/job011/EmailPhoneIconsSuite.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/suites/concurrent/job011/EmailPhoneIconsSuite.java
@@ -0,0 +1,49 @@
+/*
+ *************************************************************************
+ * 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) 2017 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author JGA
+ *
+ */
+
+package org.openbravo.test.mobile.retail.extmodules.selenium.suites.concurrent.job011;
+
+import org.junit.AfterClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+import org.openbravo.test.mobile.core.utils.SuiteHelper;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.emailphoneicons.AllEmailPhoneIconsTests;
+import org.openbravo.test.mobile.retail.pack.selenium.suites.concurrent.job011.DocumentNoSuite;
+import org.openbravo.test.mobile.retail.pack.selenium.tests.loginout.LogoutAndCloseBrowser;
+
+@RunWith(Suite.class)
+@SuiteClasses({
+//
+ AllEmailPhoneIconsTests.class, //
+
+ LogoutAndCloseBrowser.class, // this have to be the last test in the suite
+})
+public class EmailPhoneIconsSuite extends SuiteHelper {
+
+ @AfterClass
+ public static void afterclass() {
+ nameChild(DocumentNoSuite.class.getSimpleName());
+ SuiteHelper.afterclass();
+ }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/suites/concurrent/job011/EmailPhoneIconsSuiteHV.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/suites/concurrent/job011/EmailPhoneIconsSuiteHV.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/suites/concurrent/job011/EmailPhoneIconsSuiteHV.java
@@ -0,0 +1,49 @@
+/*
+ *************************************************************************
+ * 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) 2017 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author JGA
+ *
+ */
+
+package org.openbravo.test.mobile.retail.extmodules.selenium.suites.concurrent.job011;
+
+import org.junit.AfterClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+import org.openbravo.test.mobile.core.utils.SuiteHelper;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.emailphoneicons.AllEmailPhoneIconsTestsHV;
+import org.openbravo.test.mobile.retail.pack.selenium.suites.concurrent.job011.DocumentNoSuite;
+import org.openbravo.test.mobile.retail.pack.selenium.tests.loginout.LogoutAndCloseBrowser;
+
+@RunWith(Suite.class)
+@SuiteClasses({
+//
+ AllEmailPhoneIconsTestsHV.class, //
+
+ LogoutAndCloseBrowser.class, // this have to be the last test in the suite
+})
+public class EmailPhoneIconsSuiteHV extends SuiteHelper {
+
+ @AfterClass
+ public static void afterclass() {
+ nameChild(DocumentNoSuite.class.getSimpleName());
+ SuiteHelper.afterclass();
+ }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/terminals/EmailPhoneIconsTerminalHelper.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/terminals/EmailPhoneIconsTerminalHelper.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/terminals/EmailPhoneIconsTerminalHelper.java
@@ -0,0 +1,93 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.extmodules.selenium.terminals;
+
+import org.openbravo.test.mobile.retail.extmodules.selenium.TestIdExtModules;
+import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperInsertUpdateOrDelete;
+import org.openbravo.test.mobile.retail.mobilecore.javascript.TestRegistryHelper;
+import org.openbravo.test.mobile.retail.mobilecore.utils.RetailUtils;
+
+public class EmailPhoneIconsTerminalHelper extends WebPOSExtModulesTerminalHelper {
+
+ protected static final String bpCarlStudson = "Carl Studson";
+ final static String prefId1 = RetailUtils.getRandomUUID();
+ final static String prefId2 = RetailUtils.getRandomUUID();
+
+ protected void setPreferences() {
+
+ // Add "Show email and phone icons in search result" preferences
+ final String sqlAdPreference1 = String
+ .format(
+ "INSERT INTO ad_preference(ad_preference_id, ad_client_id, ad_org_id, isactive, createdby, updatedby, value, property, ispropertylist, selected) VALUES ('%s"
+ + "','39363B0921BB4293B48383844325E84C','0','Y','100','100','Y','OBEMLPH_showicons.searchresult','Y','Y')",
+ prefId1);
+ new DatabaseHelperInsertUpdateOrDelete().execute(sqlAdPreference1, 1);
+
+ // Add "Show email and phone icons in receipt header" preferences
+ final String sqlAdPreference2 = String
+ .format(
+ "INSERT INTO ad_preference(ad_preference_id, ad_client_id, ad_org_id, isactive, createdby, updatedby, value, property, ispropertylist, selected) VALUES ('%s"
+ + "','39363B0921BB4293B48383844325E84C','0','Y','100','100','Y','OBEMLPH_showicons.receipt','Y','Y')",
+ prefId2);
+ new DatabaseHelperInsertUpdateOrDelete().execute(sqlAdPreference2, 1);
+ }
+
+ protected void unsetPreferences() {
+ // Delete "Show email and phone icons in search result" preferences
+ // Delete "Show email and phone icons in receipt header" preferences
+ final String sqlAdPreference = String.format(
+ "DELETE FROM ad_preference WHERE ad_preference_id IN ('%s', '%s')", prefId1, prefId2);
+ new DatabaseHelperInsertUpdateOrDelete().execute(sqlAdPreference, 2);
+ }
+
+ protected void setEmailAndPhone(String email, String phone) {
+ tap(TestIdExtModules.BUTTON_RECEIPT_CUSTOMER);
+ write(TestIdExtModules.FIELD_CUSTOMER_MODAL, bpCarlStudson);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_MODAL_SEARCH);
+ tap(TestIdExtModules.BUTTON_POPUP_CUSTOMER_3DOTS);
+ tap(TestIdExtModules.BUTTON_POPUP_CUSTOMER_3DOTS_EDIT);
+ verify(TestIdExtModules.FIELD_VIEW_CUSTOMER_EDIT, "Edit Customer");
+ write(TestIdExtModules.FIELD_CUSTOMER_CUSTOMER_EMAIL_VIEW, email);
+ write(TestIdExtModules.FIELD_CUSTOMER_CUSTOMER_PHONE_VIEW, phone);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_SAVE);
+ TestRegistryHelper.waitForPopupToUpdate();
+ tap(TestIdExtModules.BUTTON_CUSTOMER_DETAILS_CLOSE);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_SELECTOR_CLOSE);
+ }
+
+ protected void restoreEmailAndPhone() {
+ tap(TestIdExtModules.BUTTON_RECEIPT_CUSTOMER);
+ write(TestIdExtModules.FIELD_CUSTOMER_MODAL, bpCarlStudson);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_MODAL_SEARCH);
+ tap(TestIdExtModules.BUTTON_POPUP_CUSTOMER_3DOTS);
+ tap(TestIdExtModules.BUTTON_POPUP_CUSTOMER_3DOTS_EDIT);
+ verify(TestIdExtModules.FIELD_VIEW_CUSTOMER_EDIT, "Edit Customer");
+ write(TestIdExtModules.FIELD_CUSTOMER_CUSTOMER_PHONE_VIEW, "");
+ write(TestIdExtModules.FIELD_CUSTOMER_CUSTOMER_EMAIL_VIEW, "jmo@openbravo.com");
+ tap(TestIdExtModules.BUTTON_CUSTOMER_SAVE);
+ TestRegistryHelper.waitForPopupToUpdate();
+ tap(TestIdExtModules.BUTTON_CUSTOMER_DETAILS_CLOSE);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_SELECTOR_CLOSE);
+ }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/AllEmailPhoneIconsTests.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/AllEmailPhoneIconsTests.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/AllEmailPhoneIconsTests.java
@@ -0,0 +1,33 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.emailphoneicons;
+
+import org.junit.runner.RunWith;
+import org.openbravo.test.mobile.core.junit.toolbox.SuiteClassesToolbox;
+import org.openbravo.test.mobile.retail.mobilecore.junit.OBWildcardPatternSuite;
+
+@RunWith(OBWildcardPatternSuite.class)
+@SuiteClassesToolbox()
+public class AllEmailPhoneIconsTests {
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/AllEmailPhoneIconsTestsHV.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/AllEmailPhoneIconsTestsHV.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/AllEmailPhoneIconsTestsHV.java
@@ -0,0 +1,35 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.emailphoneicons;
+
+import org.junit.runner.RunWith;
+import org.openbravo.test.mobile.core.junit.toolbox.SuiteClassesToolbox;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.SuiteAnnotations;
+import org.openbravo.test.mobile.retail.mobilecore.junit.OBWildcardPatternSuite;
+
+@RunWith(OBWildcardPatternSuite.class)
+@SuiteClassesToolbox()
+@SuiteAnnotations(activateHighVolumeMode = true)
+public class AllEmailPhoneIconsTestsHV {
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/ChangeCustomerToInvalidBPEmailAndPhone.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/ChangeCustomerToInvalidBPEmailAndPhone.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/ChangeCustomerToInvalidBPEmailAndPhone.java
@@ -0,0 +1,77 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.emailphoneicons;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.retail.extmodules.selenium.TestIdExtModules;
+import org.openbravo.test.mobile.retail.extmodules.selenium.terminals.EmailPhoneIconsTerminalHelper;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class ChangeCustomerToInvalidBPEmailAndPhone extends EmailPhoneIconsTerminalHelper {
+
+ @Override
+ public void beforeWithReload() {
+ setPreferences();
+ }
+
+ @Override
+ public void afterWithReload() {
+ unsetPreferences();
+ }
+
+ @Test
+ public void test() {
+ try {
+ logger.info("Initial state");
+ verify(TestIdExtModules.LABEL_TOTALTOPAY, "0.00");
+
+ tap(TestIdExtModules.BUTTON_RECEIPT_CUSTOMER);
+ write(TestIdExtModules.FIELD_CUSTOMER_MODAL, bpCarlStudson);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_MODAL_SEARCH);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_SEARCH_ROW1);
+
+ verify(TestIdExtModules.BUTTON_RECEIPT_CUSTOMER, bpCarlStudson);
+
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_EMAIL, false);
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_ROW1_PHONE, true);
+
+ setEmailAndPhone("", "");
+
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_EMAIL, true);
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_PHONE, true);
+
+ reload();
+ setEmailAndPhone("qwe12", "qwe12");
+
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_EMAIL, true);
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_PHONE, true);
+
+ reload();
+ } finally {
+ reload();
+ restoreEmailAndPhone();
+ }
+ }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/SetValidBPPhone.java b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/SetValidBPPhone.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/emailphoneicons/SetValidBPPhone.java
@@ -0,0 +1,73 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.emailphoneicons;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.retail.extmodules.selenium.TestIdExtModules;
+import org.openbravo.test.mobile.retail.extmodules.selenium.terminals.EmailPhoneIconsTerminalHelper;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+import org.openbravo.test.mobile.retail.mobilecore.javascript.TestRegistryHelper;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class SetValidBPPhone extends EmailPhoneIconsTerminalHelper {
+
+ @Override
+ public void beforeWithReload() {
+ setPreferences();
+ }
+
+ @Override
+ public void afterWithReload() {
+ unsetPreferences();
+ }
+
+ @Test
+ public void test() {
+ try {
+ logger.info("Initial state");
+ verify(TestIdExtModules.LABEL_TOTALTOPAY, "0.00");
+
+ tap(TestIdExtModules.BUTTON_RECEIPT_CUSTOMER);
+ write(TestIdExtModules.FIELD_CUSTOMER_MODAL, bpCarlStudson);
+ tap(TestIdExtModules.BUTTON_CUSTOMER_MODAL_SEARCH);
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_EMAIL, false);
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_ROW1_PHONE, true);
+
+ tap(TestIdExtModules.BUTTON_POPUP_CUSTOMER_3DOTS);
+ tap(TestIdExtModules.BUTTON_POPUP_CUSTOMER_3DOTS_EDIT);
+ verify(TestIdExtModules.FIELD_VIEW_CUSTOMER_EDIT, "Edit Customer");
+ write(TestIdExtModules.FIELD_CUSTOMER_CUSTOMER_PHONE_VIEW, "600-123-4567");
+ tap(TestIdExtModules.BUTTON_CUSTOMER_SAVE);
+ TestRegistryHelper.waitForPopupToUpdate();
+ tap(TestIdExtModules.BUTTON_CUSTOMER_DETAILS_CLOSE);
+
+ tap(TestIdExtModules.BUTTON_CUSTOMER_SEARCH_ROW1);
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_EMAIL, false);
+ isVisible(TestIdExtModules.BUTTON_OBEMLPH_RECEIPT_PHONE, false);
+ } finally {
+ reload();
+ restoreEmailAndPhone();
+ }
+ }
+
+}
|