Attached Files | bestseller_automatic_test.diff [^] (5,472 bytes) 2015-09-01 18:14 [Show Content] [Hide Content]# HG changeset patch
# User reinaldoguerra
# Date 1440648200 18000
# Wed Aug 26 23:03:20 2015 -0500
# Node ID 51d8bf37abdaeb6331d4bda34b55e393abb4d377
# Parent 087c0a6e691949fc6aacda50d3218b4920ffea23
New automatic test case created to test that a image flag is shown for products defined as bestseller.
diff -r 087c0a6e6919 -r 51d8bf37abda src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java
--- a/src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java Wed Aug 19 15:12:24 2015 -0500
+++ b/src-test/org/openbravo/test/mobile/common/selenium/javascript/TestId.java Wed Aug 26 23:03:20 2015 -0500
@@ -238,6 +238,11 @@
EnyoKind.PRODUCT), //
BUTTON_PRODUCT_BESTSELLERS_INSECTREPELLENT("Insect repellent", EnyoKind.PRODUCT), //
BUTTON_PRODUCT_BESTSELLERS_PRODUCTOSUPERIMPUESTO("producto Super Impuesto", EnyoKind.PRODUCT), //
+ IMAGE_BROWSEPRODUCT_AVALANCHE_TRANS_FLAGBESTSELLER("productTable_row1_bestseller",
+ EnyoKind.UNKOWN), //
+ IMAGE_SEARCHPRODUCT_AVALANCHE_TRANS_FLAGBESTSELLER("products_row1_bestseller", EnyoKind.UNKOWN), //
+ BUTTON_PRODUCT_BSELLERS_AVALANCHETRANSCEIVER("WVG/M0019 - Avalanche transceiver",
+ EnyoKind.PRODUCT), //
// Category backpacks and travel
BUTTON_CATEGORY_BACKPACKSANDTRAVEL("Backpacks & Travel", EnyoKind.CATEGORY), //
BUTTON_PRODUCT_BACKPACKSANDTRAVEL_ADHESIVEBODYWARNMERS("Adhesive body warmers", EnyoKind.PRODUCT), //
diff -r 087c0a6e6919 -r 51d8bf37abda src-test/org/openbravo/test/mobile/retail/pack/selenium/suites/CheckBestSellerSuite.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/suites/CheckBestSellerSuite.java Wed Aug 26 23:03:20 2015 -0500
@@ -0,0 +1,31 @@
+/*
+ *************************************************************************
+ * 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) 2015 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.suites;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.openbravo.test.mobile.retail.pack.selenium.tests.products.CheckBestSellerFlag;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ CheckBestSellerFlag.class // this have to be the last test in the suite
+})
+public class CheckBestSellerSuite {
+
+}
diff -r 087c0a6e6919 -r 51d8bf37abda src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/CheckBestSellerFlag.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/products/CheckBestSellerFlag.java Wed Aug 26 23:03:20 2015 -0500
@@ -0,0 +1,43 @@
+/*
+ *************************************************************************
+ * 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) 2015 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.products;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
+
+public class CheckBestSellerFlag extends WebPOSTerminalHelper {
+
+ @Test
+ public void test() {
+ // Checking when browsing best sellers
+ tap(TestId.BUTTON_BROWSE);
+ tap(TestId.BUTTON_CATEGORY_BESTSELLERS);
+ isVisible(TestId.IMAGE_BROWSEPRODUCT_AVALANCHE_TRANS_FLAGBESTSELLER, true);
+
+ // Checking when searching best sellers
+ tap(TestId.BUTTON_SEARCH);
+ write(TestId.FIELD_SEARCH_TEXT, "Avalanche transceiver");
+ tap(TestId.BUTTON_SEARCH_EXECUTE);
+ verify(TestId.BUTTON_PRODUCT_BSELLERS_AVALANCHETRANSCEIVER, "WVG/M0019 - Avalanche transceiver");
+ isVisible(TestId.IMAGE_SEARCHPRODUCT_AVALANCHE_TRANS_FLAGBESTSELLER, true);
+ }
+
+}
bestSeller.diff [^] (7,508 bytes) 2016-02-16 12:06 [Show Content] [Hide Content]# HG changeset patch
# User Asier Martirena <asier.martirena@openbravo.com>
# Date 1440639517 18000
# Wed Aug 26 20:38:37 2015 -0500
# Node ID 6a5b15e02a77c672a3c6d08080b71afb83261f83
# Parent dbeb2e74b510764b604e1c3c5c14fc17254dc3bc
[Best Seller] A new component was added when products are rendered, to show an image's flag if procuct is defined as bestseller.
diff --git a/web/org.openbravo.retail.posterminal/img/iconBestsellerSmall.png b/web/org.openbravo.retail.posterminal/img/iconBestsellerSmall.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..024db58c1d473fc28e3e0dd66f646d65a1f1907e
GIT binary patch
literal 724
zc$@*$0xSKAP)<h;3K|Lk000e1NJLTq000gE000mO1^@s7QImeG00007bV*G`2j2)8
z5gjrZf}>Rc000SaNLh0L08StP08StQ7JZrC00004XF*Lt006O%3;baP0007GNkl<Z
zc-n<hT}YEr7(VBG^K(BrD=H-ei}|xi=ufGzU?k?1L|s@n<wa$sOh?1$AHuAtjQwOf
z?WVfx!Y+a$G4;la$eX~_NrS=(t!TAuZqx0Y-uKkE#t3@h`*?ZZ=Xu`0LkL*?{hOU+
zzqf-5Fmkl}(mssR?LME-5k5&9-RH_C^c(ybWkhg_&Nj%F#^=gH)a;ajnx4Dg%9Ft|
z$n>F*KtAJ?5zQC@;IXduJSmUAN?$Kjq-g{PUm?7eHMp<TYKiftrayE+QiOSAwBgqI
z1A+YY0|=s!NHT@IJ#n1UU0%;r%wV!sPmC(vuE!j~)gIUT1%t^Vna$oat7nxpjs>bV
z7xD0+M=jR|Wkb-69rdw}W+**=@)Tu2b!iE$Ar39!Zdj7Azf)!~V?-@xDoIUdvd~gg
zAqkc<Bpce?|3K(?ifE%)A|DPuIeX(Nvw80HVxk1ryk&kS53A3tunb7~t^NJN7>fqR
zS{)@AXmK22V->cPAr_rZFSOBn!8Vn%?p2)SGPo|$Ccr%lN{OB)_{ODR%|rY3QK`D8
z$884iN7%!1nl-LGSYKb-7r&479Yl(mktgb4*J)BVID0jSMGjk=_&lQWWEk7|pCJaZ
z$dTy1-rGeG>j|s*^-PF=k~jcXE=Ha~`t-29eNJA=`o$mqsWa`+<^VOWilqF|*WMmt
z5G&h0+~KVB7h2yi&PfX1TfvWz<E8VWJF{9{S7%$uT;NjRZX8}k`KReBrF7@+`RFq9
zi`>PyD4Y$}KEHf*B)iSP;PC6JicR;H^y(_8)n@z}dG`x{6$hSv&7V^M0000<MNUMn
GLSTXlo>wOT
diff --git a/web/org.openbravo.retail.posterminal/js/components/renderproduct.js b/web/org.openbravo.retail.posterminal/js/components/renderproduct.js
--- a/web/org.openbravo.retail.posterminal/js/components/renderproduct.js
+++ b/web/org.openbravo.retail.posterminal/js/components/renderproduct.js
@@ -39,13 +39,19 @@
allowHtml: true
}]
}, {
- style: 'float: right; width: 27%;',
+ style: 'float: right; width: 32%;',
components: [{
- style: 'width: 100%; text-align: right; font-weight:bold;',
- name: 'price'
+ name: 'bestseller',
+ style: 'width: 14px; height: 16px;',
+ kind: 'OB.UI.Thumbnail',
+ 'default': 'img/iconBestsellerSmall.png',
+ showing: false
+ }, {
+ name: 'price',
+ style: 'float: right; text-align: right; font-weight: bold;'
}, {
name: 'priceList',
- style: 'width: 100%; text-align: right; font-weight:bold; color: grey; font-size: 14px;'
+ style: 'width: 100%; text-align: right; font-weight: bold; color: grey; font-size: 14px;'
}]
}, {
style: 'clear:both;'
@@ -95,6 +101,10 @@
this.$.icon.parent.hide();
}
+ if (this.model.get('bestseller')) {
+ this.$.bestseller.show();
+ }
+
if (OB.MobileApp.model.hasPermission('OBPOS_HideProductImagesInSearchAndBrowse', true)) {
this.$.thumbnail.hide();
this.$.icon.parent.hide();
# HG changeset patch
# User Asier Martirena <asier.martirena@openbravo.com>
# Date 1455540645 -3600
# Mon Feb 15 13:50:45 2016 +0100
# Node ID 78f278c0fa99582dc545496d66a1aa75a32aea8b
# Parent 6a5b15e02a77c672a3c6d08080b71afb83261f83
[Best Seller] Browser list componets refactor for bestsellers
diff --git a/web/org.openbravo.retail.posterminal/js/components/renderproduct.js b/web/org.openbravo.retail.posterminal/js/components/renderproduct.js
--- a/web/org.openbravo.retail.posterminal/js/components/renderproduct.js
+++ b/web/org.openbravo.retail.posterminal/js/components/renderproduct.js
@@ -13,45 +13,56 @@
name: 'OB.UI.RenderProduct',
kind: 'OB.UI.listItemButton',
components: [{
- style: 'float: left; width: 25%',
+ style: 'max-width: 100%;',
components: [{
- tag: 'div',
- classes: 'image-wrap',
- contentType: 'image/png',
- style: 'width: 49px; height: 49px',
+ style: 'display: table-cell; vertical-align: top; width: 50px;',
components: [{
- tag: 'img',
- name: 'icon',
- style: 'margin: auto; height: 100%; width: 100%; background-size: contain; background-repeat:no-repeat; background-position:center;'
+ tag: 'div',
+ classes: 'image-wrap',
+ contentType: 'image/png',
+ style: 'width: 49px; height: 49px;',
+ components: [{
+ tag: 'img',
+ name: 'icon',
+ style: 'margin: auto; height: 100%; width: 100%; background-size: contain; background-repeat:no-repeat; background-position:center;'
+ }]
+ }, {
+ kind: 'OB.UI.Thumbnail',
+ name: 'thumbnail'
}]
}, {
- kind: 'OB.UI.Thumbnail',
- name: 'thumbnail'
- }]
- }, {
- style: 'float: left;',
- name: 'identifierContainer',
- components: [{
- name: 'identifier'
+ style: 'display: table-cell; min-width: 10px;'
}, {
- style: 'color: #888888',
- name: 'filterAttr',
- allowHtml: true
- }]
- }, {
- style: 'float: right; width: 32%;',
- components: [{
+ style: 'display: table-cell; vertical-align: top; width: 100%; word-break: break-word;',
+ name: 'identifierContainer',
+ components: [{
+ name: 'identifier',
+ style: 'max-height: 70px; overflow: hidden;'
+ }, {
+ style: 'color: #888888',
+ name: 'filterAttr',
+ allowHtml: true
+ }]
+ }, {
+ style: 'display: table-cell; min-width: 10px;'
+ }, {
name: 'bestseller',
- style: 'width: 14px; height: 16px;',
- kind: 'OB.UI.Thumbnail',
+ style: 'display: table-cell; min-width: 21px; height: 16px;',
+ kind: 'OB.UI.Thumbnail.Bestseller',
'default': 'img/iconBestsellerSmall.png',
showing: false
}, {
- name: 'price',
- style: 'float: right; text-align: right; font-weight: bold;'
- }, {
- name: 'priceList',
- style: 'width: 100%; text-align: right; font-weight: bold; color: grey; font-size: 14px;'
+ style: 'display: table-cell; vertical-align: top; ',
+ components: [{
+ style: 'width: 100%;',
+ components: [{
+ name: 'price',
+ style: 'float: right; text-align: right; font-weight: bold;'
+ }, {
+ name: 'priceList',
+ style: 'width: 100%; text-align: right; font-weight: bold; color: grey; font-size: 14px;'
+ }]
+ }]
}]
}, {
style: 'clear:both;'
@@ -101,8 +112,10 @@
this.$.icon.parent.hide();
}
- if (this.model.get('bestseller')) {
- this.$.bestseller.show();
+ if (this.model.get('bestseller') !== true) {
+ this.$.bestseller.applyStyle('min-width', '0px !important');
+ this.$.bestseller.applyStyle('width', '0px');
+ this.$.bestseller.$.image.hide();
}
if (OB.MobileApp.model.hasPermission('OBPOS_HideProductImagesInSearchAndBrowse', true)) {
@@ -119,4 +132,19 @@
setIdentifierContent: function () {
return this.model.get('_identifier');
}
+});
+
+enyo.kind({
+ name: 'OB.UI.Thumbnail.Bestseller',
+ kind: 'OB.UI.Thumbnail',
+ drawImage: function () {
+ this.inherited(arguments);
+ this.$.image.applyStyle('background-position', '0px 0px');
+ this.$.image.applyStyle('background-color', 'transparent');
+ this.$.image.applyStyle('background-size', '14px 16px !important');
+ },
+ initComponents: function () {
+ this.inherited(arguments);
+ this.removeClass('image-wrap');
+ }
});
\ No newline at end of file
|