Skip to content

Commit

Permalink
LPD-26492 Refactor data-qa-id format
Browse files Browse the repository at this point in the history
  • Loading branch information
smottal authored and brianchandotcom committed May 29, 2024
1 parent 3828fd6 commit b6e56cc
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function CartItem({
name
)}
className="d-inline-flex"
data-qa-id="cart-item-actions"
data-qa-id="cartItemActions"
displayType="unstyled"
symbol="ellipsis-v"
title={sub(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export default function CartQuickAdd() {

<ClayInput.GroupItem shrink>
<ClayButtonWithIcon
data-qa-id="quick-add-to-cart-button"
data-qa-id="quickAddToCartButton"
disabled={!selectedSKUs.length || quickAddToCartError}
onClick={handleAddToCartClick}
symbol="shopping-cart"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function Opener() {
'mini-cart-opener': true,
})}
data-badge-count={numberOfItems}
data-qa-id="mini-cart-button"
data-qa-id="miniCartButton"
onClick={openCart}
>
<ClayIcon symbol="shopping-cart" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ String myWorkflowTasksPortletNamespace = PortalUtil.getPortletNamespace(PortletK
</c:if>

<div class="border-right c-ml-sm-2 c-mr-3 c-pr-3 header-details">
<h3 class="c-mb-0 commerce-header-title text-truncate" data-qa-id="header-details-title">
<h3 class="c-mb-0 commerce-header-title text-truncate" data-qa-id="headerDetailsTitle">
<%= HtmlUtil.escape(title) %>
</h3>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ CommerceOrder commerceOrder = commerceOrderEditDisplayContext.getCommerceOrder()
</span>
</c:when>
<c:otherwise>
<p class="mb-0" data-qa-id="commerce-order-account-entry-name"><%= HtmlUtil.escape(accountEntry.getName()) %></p>
<p class="mb-0" data-qa-id="commerceOrderAccountEntryName"><%= HtmlUtil.escape(accountEntry.getName()) %></p>
<p class="mb-0">#<%= accountEntry.getAccountEntryId() %></p>
</c:otherwise>
</c:choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CommerceOrder commerceOrder = commerceReturnEditDisplayContext.getCommerceReturn
</span>
</c:when>
<c:otherwise>
<p class="mb-0" data-qa-id="commerce-return-account-entry-name"><%= HtmlUtil.escape(accountEntry.getName()) %></p>
<p class="mb-0" data-qa-id="commerceReturnAccountEntryName"><%= HtmlUtil.escape(accountEntry.getName()) %></p>
<p class="mb-0">#<%= accountEntry.getAccountEntryId() %></p>
</c:otherwise>
</c:choose>
Expand Down Expand Up @@ -81,14 +81,14 @@ CommerceOrder commerceOrder = commerceReturnEditDisplayContext.getCommerceReturn
elementClasses="py-3"
title='<%= LanguageUtil.get(request, "order-id") %>'
>
<p class="mb-0" data-qa-id="commerce-return-order-id">#<%= commerceOrder.getCommerceOrderId() %></p>
<p class="mb-0" data-qa-id="commerceReturnOrderId">#<%= commerceOrder.getCommerceOrderId() %></p>
</commerce-ui:info-box>

<commerce-ui:info-box
elementClasses="py-3"
title='<%= LanguageUtil.get(request, "order-date") %>'
>
<p class="mb-0" data-qa-id="commerce-return-order-date">
<p class="mb-0" data-qa-id="commerceReturnOrderDate">
<%= commerceReturnEditDisplayContext.getDateTimeFormatted(commerceOrder.getOrderDate()) %>
</p>
</commerce-ui:info-box>
Expand All @@ -97,7 +97,7 @@ CommerceOrder commerceOrder = commerceReturnEditDisplayContext.getCommerceReturn
elementClasses="py-3"
title='<%= LanguageUtil.get(request, "channel") %>'
>
<p class="mb-0" data-qa-id="commerce-return-channel-name"><%= HtmlUtil.escape(commerceReturn.getChannelName()) %></p>
<p class="mb-0" data-qa-id="commerceReturnChannelName"><%= HtmlUtil.escape(commerceReturn.getChannelName()) %></p>
</commerce-ui:info-box>
</div>

Expand All @@ -106,14 +106,14 @@ CommerceOrder commerceOrder = commerceReturnEditDisplayContext.getCommerceReturn
elementClasses="py-3"
title='<%= LanguageUtil.get(request, "payment-method") %>'
>
<p class="mb-0" data-qa-id="commerce-return-payment-method"><%= HtmlUtil.escape(commerceOrder.getCommercePaymentMethodKey()) %></p>
<p class="mb-0" data-qa-id="commerceReturnPaymentMethod"><%= HtmlUtil.escape(commerceOrder.getCommercePaymentMethodKey()) %></p>
</commerce-ui:info-box>

<commerce-ui:info-box
elementClasses="py-3"
title='<%= LanguageUtil.get(request, "return-date") %>'
>
<p class="mb-0" data-qa-id="commerce-return-date">
<p class="mb-0" data-qa-id="commerceReturnDate">
<%= commerceReturnEditDisplayContext.getDateTimeFormatted(commerceReturn.getCreateDate()) %>
</p>
</commerce-ui:info-box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ long cpDefinitionId = cpCatalogEntry.getCPDefinitionId();
String stockQuantity = cpContentHelper.getStockQuantity(request);
%>

<span data-qa-id="in-stock-quantity"><%= Validator.isNull(stockQuantity) ? StringPool.BLANK : LanguageUtil.format(request, "x-in-stock", stockQuantity) %></span>
<span data-qa-id="inStockQuantity"><%= Validator.isNull(stockQuantity) ? StringPool.BLANK : LanguageUtil.format(request, "x-in-stock", stockQuantity) %></span>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
</tr>
<tr>
<td>PRODUCT_DETAILS_IN_STOCK_QUANTITY</td>
<td>//span[(@data-qa-id='in-stock-quantity') and (contains(text(),'${key_inStockQuantity}'))]</td>
<td>//span[(@data-qa-id='inStockQuantity') and (contains(text(),'${key_inStockQuantity}'))]</td>
<td></td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export class CommerceAdminOrderDetailsPage {

constructor(page: Page) {
this.commerceOrderAccountEntryName = page.getByTestId(
'commerce-order-account-entry-name'
'commerceOrderAccountEntryName'
);
this.headerDetailsTitle = page.getByTestId('header-details-title');
this.headerDetailsTitle = page.getByTestId('headerDetailsTitle');
this.page = page;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export class CommerceMiniCartPage {
exact: true,
name: 'Edit',
});
this.cartItemActionsButton = page.getByTestId('cart-item-actions');
this.miniCartButton = page.getByTestId('mini-cart-button');
this.cartItemActionsButton = page.getByTestId('cartItemActions');
this.miniCartButton = page.getByTestId('miniCartButton');
this.miniCartButtonClose = page.locator('.mini-cart-close');
this.miniCartSaveButton = page.getByRole('button', {
exact: true,
Expand All @@ -45,9 +45,7 @@ export class CommerceMiniCartPage {
this.miniCartUnitOfMeasureSelector = page.locator(
'select[name="minicart-uom-selector"]'
);
this.quickAddToCartButton = page.getByTestId(
'quick-add-to-cart-button'
);
this.quickAddToCartButton = page.getByTestId('quickAddToCartButton');
this.quickAddToCartSku = (sku) =>
page.getByRole('menuitem', {name: sku});
this.searchProductsInput = page.getByPlaceholder('Search Products');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class CommercePaymentsPage {
this.ercSubmitButton = page
.frameLocator('iframe[title="Edit External Reference Code"]')
.getByRole('button', {exact: true, name: 'Submit'});
this.headerDetailsTitle = page.getByTestId('header-details-title');
this.headerDetailsTitle = page.getByTestId('headerDetailsTitle');
this.makeRefundButton = page.getByLabel('Make a Refund', {exact: true});
this.reasonInput = page.getByLabel('Reason');
this.saveButton = page.getByRole('link', {exact: true, name: 'Save'});
Expand Down

0 comments on commit b6e56cc

Please sign in to comment.