# HG changeset patch # User Gorka Gil # Date 1498816768 -7200 # Fri Jun 30 11:59:28 2017 +0200 # Node ID 4e6ad7dba01cefdaad263534e9c5706795327417 # Parent 5e5f451329eae5ac15d68d9f366420f9980cf985 Related to issue 35517: Search filter not removed under some circumstances Added test cases for: pack: product with service button -> product generic product with service button -> product with service button product with service button -> product with service mandatory proposal product generic -> product with service mandatory proposal product generic -> product with service button product generic -> product generic (NOT IMPLEMENTED) --- NOT done because there is no 2 generic products in sampledata nor in test sampledata product with service mandatory proposal -> product with service mandatory proposal product with service mandatory proposal -> product with service button product with service mandatory proposal -> product generic ext-modules: complementary -> product with service mandatory proposal product with service mandatory proposal -> complementary complementary -> complementary Note: tests implemented to work in remote and local, but since generic only works in local these tests are skipped in remote diff -r 5e5f451329ea -r 4e6ad7dba01c src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/complementaryproducts/I35517_CustomSearchFilterNoReset_complementary.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/complementaryproducts/I35517_CustomSearchFilterNoReset_complementary.java Fri Jun 30 11:59:28 2017 +0200 @@ -0,0 +1,114 @@ +/* + ************************************************************************* + * 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 GGI + * + */ + +package org.openbravo.test.mobile.retail.extmodules.selenium.tests.complementaryproducts; + +import org.junit.Test; +import org.openbravo.test.mobile.retail.extmodules.selenium.TestIdExtModules; +import org.openbravo.test.mobile.retail.extmodules.selenium.terminals.WebPOSExtModulesTerminalHelper; +import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations; +import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack; + +@TestClassAnnotations(isHighVolumeCompatible = true) +public class I35517_CustomSearchFilterNoReset_complementary extends WebPOSExtModulesTerminalHelper { + + // summary of cases + // + // pack: ( in file I35517_CustomSearchFilterNoReset ) + // product with service button -> product generic + // product with service button -> product with service button + // product with service button -> product with service mandatory proposal + // product generic -> product with service mandatory proposal + // product generic -> product with service button + // product generic -> product generic (NOT IMPLEMENTED) + // --- NOT done because there is no 2 generic products in sampledata nor in test sampledata + // product with service mandatory proposal -> product with service mandatory proposal + // product with service mandatory proposal -> product with service button + // product with service mandatory proposal -> product generic + // + // ext-modules: + // complementary -> product with service mandatory proposal (test1) + // product with service mandatory proposal -> complementary (test2) + // complementary -> complementary (test3) + + // complementary -> product with service mandatory proposal + @Test + public void test1() { + addProductComplementary_ThermalJacket(1); + addProductWithServiceMandatoryProposal_GpsNano(); + deleteReceipt(); + } + + // product with service mandatory proposal -> complementary + @Test + public void test2() { + addProductWithServiceMandatoryProposal_GpsNano(); + addProductComplementary_ThermalJacket(3); + deleteReceipt(); + } + + // complementary -> complementary + @Test + public void test3() { + addProductComplementary_ThermalJacket(1); + addProductComplementary_PolarGlasses(3); + deleteReceipt(); + } + + // utils functions + + private void addProductComplementary_ThermalJacket(int row) { + tap(TestIdExtModules.BUTTON_SEARCH); + write(TestIdPack.FIELD_SEARCH_TEXT, "WVG/CP002"); + tap(TestIdPack.BUTTON_SEARCH_EXECUTE); + tap(TestIdExtModules.BUTTON_SEARCHPRODUCT_THERMALJACKET); + tapUI("listOrderLines_row" + row + "_complementaryProduct"); + verify(TestIdExtModules.LABEL_PRODUCT_ROW1, "WVG/MWP002 - Plastic fly swatter"); + tap(TestIdExtModules.BUTTON_SEARCHPRODUCT_MOUNTAINEERING_PLASTICFLYSWATTER); + } + + private void addProductComplementary_PolarGlasses(int row) { + tap(TestIdExtModules.BUTTON_SEARCH); + write(TestIdPack.FIELD_SEARCH_TEXT, "WVG/CP001"); + tap(TestIdPack.BUTTON_SEARCH_EXECUTE); + tap(TestIdExtModules.BUTTON_SEARCHPRODUCT_POLARGLASSES); + tapUI("listOrderLines_row" + row + "_complementaryProduct"); + verify(TestIdExtModules.LABEL_PRODUCT_ROW1, "WVG/MWP001 - Insect repellent ultra"); + tap(TestIdExtModules.BUTTON_SEARCHPRODUCT_BACKPACKSANDTRAVEL_INSECTREPELLENTULTRA); + } + + private void addProductWithServiceMandatoryProposal_GpsNano() { + tap(TestIdExtModules.BUTTON_SEARCH); + write(TestIdPack.FIELD_SEARCH_TEXT, "seq010a"); + tap(TestIdPack.BUTTON_SEARCH_EXECUTE); + tap(TestIdExtModules.BUTTON_SEARCHPRODUCT_SEQ010A); // gps nano + verify(TestIdExtModules.LABEL_PRODUCT_ROW1, "seq_service - Configuration"); + tap(TestIdExtModules.BUTTON_SEARCHPRODUCT_SEQ_SERVICE); + tap(TestIdExtModules.BUTTON_EDIT); // continue + } + + private void deleteReceipt() { + tap(TestIdPack.BUTTON_DELETERECEIPT); + tap(TestIdExtModules.BUTTON_DELETERECEIPT_CONFIRM); + verify(TestIdExtModules.LABEL_TOTALTOPAY, "0.00"); + } +} diff -r 5e5f451329ea -r 4e6ad7dba01c src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/I35517_CustomSearchFilterNoReset.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/I35517_CustomSearchFilterNoReset.java Fri Jun 30 11:59:28 2017 +0200 @@ -0,0 +1,196 @@ +/* + ************************************************************************* + * 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 GGI + * + */ + +package org.openbravo.test.mobile.retail.pack.selenium.tests.products; + +import org.junit.Test; +import org.openbravo.test.mobile.core.junit.SequentialTestInfo; +import org.openbravo.test.mobile.retail.extmodules.selenium.TestIdExtModules; +import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations; +import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack; +import org.openbravo.test.mobile.retail.pack.selenium.terminals.WebPOSTerminalHelper; + +@TestClassAnnotations(isHighVolumeCompatible = true) +public class I35517_CustomSearchFilterNoReset extends WebPOSTerminalHelper { + + // summary of cases + // + // pack: + // product with service button -> product generic (test1) + // product with service button -> product with service button (test2) + // product with service button -> product with service mandatory proposal (test3) + // product generic -> product with service mandatory proposal (test4) + // product generic -> product with service button (test5) + // product generic -> product generic (NOT IMPLEMENTED) + // --- NOT done because there is no 2 generic products in sampledata nor in test sampledata + // product with service mandatory proposal -> product with service mandatory proposal (test6) + // product with service mandatory proposal -> product with service button (test7) + // product with service mandatory proposal -> product generic (test8) + // + // ext-modules: ( in file I35517_CustomSearchFilterNoReset_complementary ) + // complementary -> product with service mandatory proposal + // product with service mandatory proposal -> complementary + // complementary -> complementary + // product generic -> product generic + + // case of issue i35517 + // product with service button -> product generic + @Test + public void test1() { + if (SequentialTestInfo.getHighVolumenMode()) { + logger + .info("Test skipped in highvolume since generic custom filter only appears in browse, that is disabled in remote"); + } else { + addProductWithServiceButton_BabyCarrier(1); + addProductGeneric_ThermalTShirt(); + deleteReceipt(); + } + } + + // product with service button -> product with service button + @Test + public void test2() { + addProductWithServiceButton_AlpinePoles(1); + addProductWithServiceButton_BabyCarrier(3); + deleteReceipt(); + } + + // product with service button -> product with service mandatory proposal + @Test + public void test3() { + addProductWithServiceButton_BabyCarrier(1); + addProductWithServiceMandatoryProposal_CustomizeBlueTrousers(); + deleteReceipt(); + } + + // product generic -> product with service mandatory proposal + @Test + public void test4() { + if (SequentialTestInfo.getHighVolumenMode()) { + logger + .info("Test skipped in highvolume since generic custom filter only appears in browse, that is disabled in remote"); + } else { + addProductGeneric_ThermalTShirt(); + addProductWithServiceMandatoryProposal_CustomizeBlueTrousers(); + deleteReceipt(); + } + } + + // product generic -> product with service button + @Test + public void test5() { + if (SequentialTestInfo.getHighVolumenMode()) { + + logger + .info("Test skipped in highvolume since generic custom filter only appears in browse, that is disabled in remote"); + } else { + addProductGeneric_ThermalTShirt(); + addProductWithServiceButton_BabyCarrier(2); + deleteReceipt(); + } + } + + // product with service mandatory proposal -> product with service mandatory proposal + @Test + public void test6() { + addProductWithServiceMandatoryProposal_CustomizeBlueTrousers(); + addProductWithServiceMandatoryProposal_AvalancheTransceiverClassic(); + deleteReceipt(); + } + + // product with service mandatory proposal -> product with service button + @Test + public void test7() { + addProductWithServiceMandatoryProposal_CustomizeBlueTrousers(); + addProductWithServiceButton_BabyCarrier(3); + deleteReceipt(); + } + + // product with service mandatory proposal -> product generic + @Test + public void test8() { + if (SequentialTestInfo.getHighVolumenMode()) { + logger + .info("Test skipped in highvolume since generic custom filter only appears in browse, that is disabled in remote"); + } else { + addProductWithServiceMandatoryProposal_CustomizeBlueTrousers(); + addProductGeneric_ThermalTShirt(); + deleteReceipt(); + } + } + + // utils functions + + private void addProductWithServiceButton_BabyCarrier(int row) { + tap(TestIdPack.BUTTON_SEARCH); + write(TestIdPack.FIELD_SEARCH_TEXT, "WVG/B0004"); + tap(TestIdPack.BUTTON_SEARCH_EXECUTE); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_BABYCARRIER); + tapUI("listOrderLines_row" + row + "_showServicesButton"); + verify(TestIdPack.LABEL_PRODUCT_ROW1, "Fit in the car"); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_FITINTHECAR); + } + + private void addProductWithServiceButton_AlpinePoles(int row) { + tap(TestIdPack.BUTTON_SEARCH); + write(TestIdPack.FIELD_SEARCH_TEXT, "WVG/S0015"); + tap(TestIdPack.BUTTON_SEARCH_EXECUTE); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_ALPINEPOLES); + tapUI("listOrderLines_row" + row + "_showServicesButton"); + verify(TestIdPack.LABEL_PRODUCT_ROW1, "Repair boots"); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_REPAIRBOOTS); + } + + private void addProductWithServiceMandatoryProposal_CustomizeBlueTrousers() { + tap(TestIdPack.BUTTON_SEARCH); + write(TestIdPack.FIELD_SEARCH_TEXT, "WVG/B0023"); + tap(TestIdPack.BUTTON_SEARCH_EXECUTE); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_BLUETROUSERS); + verify(TestIdPack.LABEL_PRODUCT_ROW1, "Customize Blue Trousers"); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_ADAPTBLUETROUSERS); + tap(TestIdPack.BUTTON_EDIT); // continue + } + + private void addProductWithServiceMandatoryProposal_AvalancheTransceiverClassic() { + tap(TestIdPack.BUTTON_SEARCH); + write(TestIdPack.FIELD_SEARCH_TEXT, "WVG/M0100"); + tap(TestIdPack.BUTTON_SEARCH_EXECUTE); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVERCLASSIC); + verify(TestIdPack.LABEL_PRODUCT_ROW1, "Phone consulting MK2"); + tap(TestIdPack.BUTTON_SEARCHPRODUCT_PHONECONSULTINGMK2); + tap(TestIdPack.BUTTON_EDIT); // continue + } + + private void addProductGeneric_ThermalTShirt() { + tap(TestIdPack.BUTTON_BROWSE); + tap(TestIdPack.BUTTON_CATEGORY_MOUNTAINEERING); + tap(TestIdPack.BUTTON_PRODUCT_MOUNTAINEERING_THERMALTSHIRT); + verify(TestIdPack.LABEL_PRODUCT_ROW1, "Thermal t-shirt"); + tap(TestIdPack.BUTTON_SIMPLE_SEARCHRESULTS_PRODUCT); + } + + private void deleteReceipt() { + tap(TestIdPack.BUTTON_DELETERECEIPT); + tap(TestIdExtModules.BUTTON_DELETERECEIPT_CONFIRM); + verify(TestIdExtModules.LABEL_TOTALTOPAY, "0.00"); + } +}