From 89025c1a1e07fec98574fa3c54050139d2156da9 Mon Sep 17 00:00:00 2001 From: Gabriel Lehmann Date: Fri, 10 Feb 2023 23:33:16 -0300 Subject: [PATCH] feat: made-testid --- store/blocks/pdp/product.jsonc | 100 +++++++++++++++++++++++++++---- store/blocks/product-price.jsonc | 9 ++- 2 files changed, 98 insertions(+), 11 deletions(-) diff --git a/store/blocks/pdp/product.jsonc b/store/blocks/pdp/product.jsonc index 13b4dd4..3013b07 100644 --- a/store/blocks/pdp/product.jsonc +++ b/store/blocks/pdp/product.jsonc @@ -4,7 +4,7 @@ "html#breadcrumb", "condition-layout.product#availability", // "flex-layout.row#description", - "tab-layout#description", + "html#product-description", // "flex-layout.row#specifications-title", // "product-specification-group#table", // "shelf.relatedProducts", @@ -37,7 +37,17 @@ "blocks": ["product-summary.shelf#carousel-shelf"] }, - "product-summary.shelf#carousel-shelf": { + "html#slider": { + "props": { + "testId": "product-summary-list" + }, + "children": ["slider-layout#carousel-slider"] + }, + + "html#prateleira": { + "props": { + "testId": "vtex-product-summary" + }, "children": [ "product-summary-image", "product-summary-name", @@ -45,6 +55,10 @@ ] }, + "product-summary.shelf#carousel-shelf": { + "children": ["html#prateleira"] + }, + "tab-layout#description": { "children": ["tab-list#description", "tab-content#description"] }, @@ -166,6 +180,14 @@ }, "children": ["product-images#description", "flex-layout.col#description"] }, + + "html#product-description": { + "props": { + "testId": "product-description" + }, + "children": ["tab-layout#description"] + }, + "product-description#notitle": { "props": { "showTitle": false @@ -237,9 +259,17 @@ "rowGap": 0 } }, - "flex-layout.row#product-image": { + + "html#imagens": { + "props": { + "testId": "product-images" + }, "children": ["product-images"] }, + + "flex-layout.row#product-image": { + "children": ["html#imagens"] + }, "product-images": { "props": { "aspectRatio": { @@ -262,12 +292,12 @@ }, "children": [ "flex-layout.row#product-name", - "product-identifier.product", + "html#codigo", "product-rating-summary", // "flex-layout.row#list-price-savings", "flex-layout.row#selling-price", - "product-installments", - "pix-components", + "html#product-installments", + "html#pixzap", // "product-separator", "sku-selector", "flex-layout.row#quantity-and-add-button", @@ -276,10 +306,39 @@ // "product-gifts", // "flex-layout.row#buy-button", "availability-subscriber", - "shipping-simulator" + "html#shipping-simulator" // "share#default" ] }, + "html#pixzap": { + "props": { + "testId": "pix-price", + "blockClass": "pix" + }, + "children": ["pix-components"] + }, + + "html#product-name": { + "props": { + "testId": "product-name" + }, + "children": ["vtex.store-components:product-name"] + }, + + "html#shipping-simulator": { + "props": { + "testId": "shipping-simulator" + }, + "children": ["shipping-simulator"] + }, + + "html#codigo": { + "props": { + "blockClass": "codigo", + "testId": "product-code" + }, + "children": ["product-identifier.product"] + }, "flex-layout.row#quantity-and-add-button": { "props": { @@ -288,7 +347,14 @@ "fullWidth": true, "colGap": 0 }, - "children": ["product-quantity", "flex-layout.row#buy-button"] + "children": ["html#product-quantity", "flex-layout.row#buy-button"] + }, + + "html#product-quantity": { + "props": { + "testId": "product-quantity" + }, + "children": ["product-quantity"] }, "product-identifier.product": { @@ -297,6 +363,13 @@ } }, + "html#product-installments": { + "props": { + "testId": "product-installments" + }, + "children": ["product-installments"] + }, + "product-installments": { "props": { "message": "{installmentsNumber} {hasInterest, select, true {x} false {}} de {installmentValue} sem juros", @@ -308,7 +381,7 @@ "props": { "marginBottom": 3 }, - "children": ["vtex.store-components:product-name"] + "children": ["html#product-name"] }, "sku-selector": { @@ -330,6 +403,13 @@ "marginBottom": 7, "blockClass": "add-to-cart-button-background" }, + "children": ["html#add-to-card-button"] + }, + + "html#add-to-card-button": { + "props": { + "testId": "add-to-cart-button" + }, "children": ["add-to-cart-button"] }, @@ -353,7 +433,7 @@ }, "children": [ "flex-layout.row#product-name", - "product-identifier.product", + "html#codigo", "sku-selector", "flex-layout.row#availability" ] diff --git a/store/blocks/product-price.jsonc b/store/blocks/product-price.jsonc index bb528e8..2a098aa 100644 --- a/store/blocks/product-price.jsonc +++ b/store/blocks/product-price.jsonc @@ -5,7 +5,7 @@ "preserveLayoutOnMobile": true, "preventHorizontalStretch": true }, - "children": ["product-selling-price"] + "children": ["html#selling-price"] }, "flex-layout.row#list-price-savings": { @@ -17,5 +17,12 @@ "marginTop": 5 }, "children": ["product-list-price", "product-price-savings"] + }, + + "html#selling-price": { + "props": { + "testId": "product-price" + }, + "children": ["product-selling-price"] } }