From 23f0e8a3e8e6d6db6f6070c27b30023dabf92bff Mon Sep 17 00:00:00 2001 From: Eleonora Otz Date: Tue, 31 Jan 2023 21:36:33 -0300 Subject: [PATCH] feat: Inclui testIds nos blocos --- react/components/Html/styles.css | 4 ++ store/blocks/pdp/product.jsonc | 95 +++++++++++++++++++++++++++----- 2 files changed, 86 insertions(+), 13 deletions(-) diff --git a/react/components/Html/styles.css b/react/components/Html/styles.css index e28c0d3..2df4658 100644 --- a/react/components/Html/styles.css +++ b/react/components/Html/styles.css @@ -4,6 +4,10 @@ margin-bottom: 5px; } +[class*="html--cart-button"] { + width: 100%; +} + [class*="html--buy-button"] :global(.vtex-button) { height: 49px; background: black; diff --git a/store/blocks/pdp/product.jsonc b/store/blocks/pdp/product.jsonc index 0facc42..60b0872 100644 --- a/store/blocks/pdp/product.jsonc +++ b/store/blocks/pdp/product.jsonc @@ -14,6 +14,8 @@ "newsletter" ] }, + + // Breadcrumb "html#breadcrumb": { "props": { "tag": "section", @@ -22,6 +24,8 @@ }, "children": ["breadcrumb"] }, + + // Produto "flex-layout.row#specifications-title": { "children": ["rich-text#specifications"] }, @@ -71,6 +75,7 @@ ] }, + // Imagens de produto "flex-layout.col#stack": { "children": ["stack-layout"], "props": { @@ -79,8 +84,15 @@ } }, "flex-layout.row#product-image": { - "children": ["product-images"] + "children": ["html#product-images"] }, +"html#product-images": { + "children": ["product-images"], + "props": { + "testId": "product-images" + } +}, + "product-images": { "props": { "aspectRatio": { @@ -93,6 +105,8 @@ "thumbnailsOrientation": "horizontal" } }, + + // Especificações de produto "flex-layout.col#right-col": { "props": { "preventVerticalStretch": true, @@ -103,8 +117,10 @@ "product-identifier.product", "flex-layout.row#selling-price", "product-installments", - "Pix", - "sku-selector", + "html#pix-price", + // "Pix", + // "sku-selector", + "html#sku-selector", "html#buy-button", "product-gifts", "availability-subscriber", @@ -119,6 +135,13 @@ "children": ["vtex.store-components:product-name"] }, + "html#sku-selector": { + "children": ["sku-selector"], + "props": { + "testId": "sku-selector" + } + }, + "sku-selector": { "props": { "variationsSpacing": 3, @@ -127,6 +150,7 @@ } }, + // Parcelamento "product-installments": { "props": { "markers": ["discount"], @@ -135,13 +159,38 @@ } }, + // Quantidade e botão de compra "html#buy-button": { "props": { "blockClass": "buy-button" }, - "children": ["product-quantity#size", "add-to-cart-button"] + "children": [ "html#product-quantity-size", "html#cart-button"] }, + "html#cart-button": { + "children": ["add-to-cart-button"], + "props": { + "testId": "add-to-cart-button", + "blockClass": "cart-button" + } + }, + + "html#product-quantity-size": { + "children": ["product-quantity#size"], + "props": { + "testId": "product-quantity" + } + }, + + "product-quantity#size": { + "props": { + "size": "large", + "width": "28%", + "showLabel": false + } + }, + + // Produto indisponível "flex-layout.row#product-availability": { "props": { "colGap": 7, @@ -154,6 +203,7 @@ "flex-layout.col#right-col-availability" ] }, + "flex-layout.col#right-col-availability": { "props": { "preventVerticalStretch": true, @@ -167,6 +217,8 @@ "sku-selector" ] }, + + // Formulário produto indisponível "flex-layout.row#availability": { "props": { "blockClass": "message-availability" @@ -174,14 +226,15 @@ "children": ["availability-subscriber"] }, - "product-quantity#size": { + // Desconto Pix + "html#pix-price": { + "children": ["Pix"], "props": { - "size": "large", - "width": "28%", - "showLabel": false + "testId": "pix-price" } }, + // Descrição "tab-layout": { "children": ["tab-list", "tab-content"], "props": { @@ -328,6 +381,7 @@ } }, + // Prateleira de produtos "rich-text#carousel": { "props": { "text": "Você também pode gostar:", @@ -338,6 +392,25 @@ }, "product-summary.shelf#carousel": { + "children": ["html#product-summary"] + }, + + "list-context.product-list#product-carousel": { + "blocks": ["product-summary.shelf#carousel"], + "children": ["html#product-summary-list"] + }, + + "html#product-summary-list": { + "children": ["slider-layout#demo-products"], + "props": { + "testId": "product-summary-list" + } + }, + + "html#product-summary": { + "props": { + "testId": "vtex-product-summary" + }, "children": [ "product-summary-image", "product-summary-name", @@ -345,11 +418,7 @@ ] }, - "list-context.product-list#product-carousel": { - "blocks": ["product-summary.shelf#carousel"], - "children": ["slider-layout#demo-products"] - }, - + // Newsletter "newsletter": { "props": { "label": "Assine nossa newsletter",