Verifies issue 37520 : Modified automated test 'I33057_VerifyGenericProductsAsBestSeller'
authorRanjith S R <ranjith@qualiantech.com>
Wed, 10 Jan 2018 19:03:11 +0530
changeset 6961 aa4c32fa609c
parent 6960 493768360275
child 6962 c83d66648a77
Verifies issue 37520 : Modified automated test 'I33057_VerifyGenericProductsAsBestSeller'
src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/bestsellers/I32445_FilterByBrandAndBestseller.java
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/I33057_VerifyGenericProductsAsBestSeller.java
src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I32445_FilterByBrandAndBestseller.java
--- a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/bestsellers/I32445_FilterByBrandAndBestseller.java	Wed Jan 10 18:48:12 2018 +0530
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/bestsellers/I32445_FilterByBrandAndBestseller.java	Wed Jan 10 19:03:11 2018 +0530
@@ -30,7 +30,7 @@
 import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
 import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperInsertUpdateOrDelete;
 
-@TestClassAnnotations(isHighVolumeCompatible = false)
+@TestClassAnnotations(isHighVolumeCompatible = true)
 public class I32445_FilterByBrandAndBestseller extends WebPOSExtModulesTerminalHelper {
 
   @Test
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/I33057_VerifyGenericProductsAsBestSeller.java	Wed Jan 10 18:48:12 2018 +0530
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/I33057_VerifyGenericProductsAsBestSeller.java	Wed Jan 10 19:03:11 2018 +0530
@@ -27,22 +27,30 @@
 
 import org.junit.Test;
 import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperInsertUpdateOrDelete;
-import org.openbravo.test.mobile.retail.mobilecore.javascript.MobileCoreAPI;
 import org.openbravo.test.mobile.retail.pack.API.WebPOSAPI;
 import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack;
 import org.openbravo.test.mobile.retail.pack.selenium.terminals.WebPOSTerminalHelper;
 
 public class I33057_VerifyGenericProductsAsBestSeller extends WebPOSTerminalHelper {
 
+  final String productName = "Thermal t-shirt";
+
   @Test
   public void test() {
-    final String productName = "Thermal t-shirt";
+    // By Default best seller product count will be 7
     tap(TestIdPack.BUTTON_BROWSE);
+    long productCount = TestIdPack.TABLE_PRODUCTS.enyoNode().getCountRows();
+    assertThat("Best seller product count is not same as expected", (long) 7, equalTo(productCount));
 
-    final long productCount = TestIdPack.TABLE_PRODUCTS.enyoNode().getCountRows();
-    assertThat("Best seller product count is not same as expected", (long) 6, equalTo(productCount));
+    // Set Variant as best seller
+    updateProductToBestSeller(true);
+    reload();
+
+    // If variant is set as best seller, then generic product will added to best seller
+    tap(TestIdPack.BUTTON_BROWSE);
+    productCount = TestIdPack.TABLE_PRODUCTS.enyoNode().getCountRows();
+    assertThat("Best seller product count is not same as expected", (long) 8, equalTo(productCount));
     tap(TestIdPack.TABLE_PRODUCTS, productName);
-
     assertThat(WebPOSAPI.getLastTabShown(), equalTo("searchCharacteristic"));
     verify(TestIdPack.LABEL_PRODUCT_ROW1, productName);
     verify(TestIdPack.LABEL_PRODUCT_ROW2, productName);
@@ -51,19 +59,16 @@
     final Long productSearchCount = TestIdPack.TABLE_SEARCHPRODUCTS.enyoNode().getCountRows();
     assertThat("Generic Product count is not same as expected", (long) 4,
         equalTo(productSearchCount));
-
     tap(TestIdPack.BUTTON_SCAN);
   }
 
   @Override
   public void beforeWithReload() {
-    MobileCoreAPI.localStorageClear();
-    updateProductToBestSeller(true);
+
   }
 
   @Override
   public void afterWithReload() {
-    MobileCoreAPI.localStorageClear();
     updateProductToBestSeller(false);
   }
 
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I32445_FilterByBrandAndBestseller.java	Wed Jan 10 18:48:12 2018 +0530
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I32445_FilterByBrandAndBestseller.java	Wed Jan 10 19:03:11 2018 +0530
@@ -25,7 +25,7 @@
 import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack;
 import org.openbravo.test.mobile.retail.pack.selenium.terminals.WebPOSTerminalHelper;
 
-@TestClassAnnotations(isHighVolumeCompatible = false)
+@TestClassAnnotations(isHighVolumeCompatible = true)
 public class I32445_FilterByBrandAndBestseller extends WebPOSTerminalHelper {
 
   @Test