Skip to content

Commit

Permalink
Merge branch 'liferay:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
liferay-frontend authored Sep 29, 2023
2 parents 8b77171 + 534c155 commit 04f8aa7
Show file tree
Hide file tree
Showing 165 changed files with 3,537 additions and 350 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ definition {
var total = ${total} + ${taxValue};
}

if (isSet(totalPrice)) {
var total = ${totalPrice};
}

if (isSet(setBillingAddress)) {
CommerceCheckout.setAddress(
guestEmail = ${guestEmail},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,207 @@ definition {
}
}

@description = "This is a test for COMMERCE-12402. Select a product with multiple bulk prices, no promotion, no discount and user does the checkout"
@priority = 3
test CanCheckoutProductWithMultipleBulkPrice {
property portal.acceptance = "false";

task ("Given a Commerce Account and Buyer User are created") {
CommerceEntry.addAccountEntryUser(
accountName = "Commerce Account",
accountType = "Business",
agreeToTermsAndAnswerReminderQuery = "true",
createNewAccount = "true",
requireReset = "false",
userEmailAddress = "[email protected]",
userFirstName = "Buyer",
userLastName = "User",
userRole = "Buyer",
userScreenName = "buyeruser",
userSiteMembership = "Minium");
}

task ("And the tier lists are changed") {
CommercePriceLists.openPriceListsAdmin();

CommerceNavigator.gotoEntry(entryName = "Minium Base Price List");

CommerceEntry.gotoMenuTab(menuTab = "Entries");

CommerceNavigator.searchEntry(entryName = "U-Joint");

CommerceNavigator.gotoEntry(entryName = "MIN55861");

var valueList = "5:50,10:5";

for (var value : list ${valueList}) {
var quantity = StringUtil.extractFirst(${value}, ":");
var price = StringUtil.extractLast(${value}, ":");

CommercePriceLists.createPriceListPriceTiers(
key_pricingType = "Bulk Pricing",
key_quantity = ${quantity},
key_value = ${price});
}
}

task ("And Buyer User logged in") {
User.logoutPG();

CommerceLogin.miniumLogin(
password = "test",
urlAppend = "web/minium",
userEmailAddress = "[email protected]");
}

task ("And buyer user adds a product to the cart and the price is shown accordingly") {
FrontStore.addInitializerProductToCart(
productName = "U-Joint",
productQuantity = 5);

CommerceNavigator.gotoMiniCart();

FrontStore.viewMiniCart(
cartItemName = "U-Joint",
cartItemPriceValue = 50,
cartItemQuantity = 5,
cartItemSku = "MIN55861",
cartSummarySubtotal = 250);

Type(
key_cartItemSku = "MIN55861",
locator1 = "CommerceAccelerators#MINI_CART_ITEM_QUANTITY",
value1 = 10);

FrontStore.viewMiniCart(
cartItemName = "U-Joint",
cartItemPriceValue = 5,
cartItemQuantity = 10,
cartItemSku = "MIN55861",
cartSummarySubtotal = 50);
}

task ("Then by clicking Submit button from minicart, the checkout process is completed") {
CommerceCheckout.gotoCheckoutViaMiniCart();

CommerceCheckout.initializersCheckout(
newAddressAddress = "Test Address",
newAddressCity = "Test City",
newAddressCountry = "United States",
newAddressName = "Address Name",
newAddressZipCode = "Test Zip Code",
productName = "U-Joint",
productQuantity = 10,
productUnitPrice = 5,
shippingMethod = "Standard");

AssertTextEquals(
locator1 = "CommerceAccelerators#CHECKOUT_SUCCESS_MESSAGE",
value1 = "Success! Your order has been processed.");
}
}

@description = "This is a test for COMMERCE-12402. Select a product with multiple tiered price, no promotion ,no discount, and user does the checkout"
@priority = 3
test CanCheckoutProductWithMultipleTieredPrice {
property portal.acceptance = "false";

task ("Given a Commerce Account and Buyer User are created") {
CommerceEntry.addAccountEntryUser(
accountName = "Commerce Account",
accountType = "Business",
agreeToTermsAndAnswerReminderQuery = "true",
createNewAccount = "true",
requireReset = "false",
userEmailAddress = "[email protected]",
userFirstName = "Buyer",
userLastName = "User",
userRole = "Buyer",
userScreenName = "buyeruser",
userSiteMembership = "Minium");
}

task ("And the tier lists are changed") {
CommercePriceLists.openPriceListsAdmin();

CommerceNavigator.gotoEntry(entryName = "Minium Base Price List");

CommerceEntry.gotoMenuTab(menuTab = "Entries");

CommerceNavigator.searchEntry(entryName = "U-Joint");

CommerceNavigator.gotoEntry(entryName = "MIN55861");

var valueList = "5:50,10:5";

for (var value : list ${valueList}) {
var quantity = StringUtil.extractFirst(${value}, ":");
var price = StringUtil.extractLast(${value}, ":");

CommercePriceLists.createPriceListPriceTiers(
key_pricingType = "Tiered Pricing",
key_quantity = ${quantity},
key_value = ${price});
}
}

task ("And Buyer User logged in") {
User.logoutPG();

CommerceLogin.miniumLogin(
password = "test",
urlAppend = "web/minium",
userEmailAddress = "[email protected]");
}

task ("And buyer user adds a product to the cart and the price is shown accordingly") {
FrontStore.addInitializerProductToCart(
productName = "U-Joint",
productQuantity = 5);

CommerceNavigator.gotoMiniCart();

FrontStore.viewMiniCart(
cartItemName = "U-Joint",
cartItemPriceValue = "29.20",
cartItemQuantity = 5,
cartItemSku = "MIN55861",
cartSummarySubtotal = 146);

Type(
key_cartItemSku = "MIN55861",
locator1 = "CommerceAccelerators#MINI_CART_ITEM_QUANTITY",
value1 = 10);

FrontStore.viewMiniCart(
cartItemName = "U-Joint",
cartItemPriceValue = "35.10",
cartItemQuantity = 10,
cartItemSku = "MIN55861",
cartSummarySubtotal = 351);
}

task ("Then by clicking Submit button from minicart, the checkout process is completed") {
CommerceCheckout.gotoCheckoutViaMiniCart();

CommerceCheckout.initializersCheckout(
newAddressAddress = "Test Address",
newAddressCity = "Test City",
newAddressCountry = "United States",
newAddressName = "Address Name",
newAddressZipCode = "Test Zip Code",
productName = "U-Joint",
productQuantity = 10,
productUnitPrice = "35.10",
shippingMethod = "Standard",
totalPrice = 366);

AssertTextEquals(
locator1 = "CommerceAccelerators#CHECKOUT_SUCCESS_MESSAGE",
value1 = "Success! Your order has been processed.");
}
}

@description = "This is a test for COMMERCE-10280. Set a promotion price lower then the price list and do the checkout"
@priority = 5
test CanCheckoutProductWithPromotionPriceLowerThenPricelist {
Expand Down Expand Up @@ -361,4 +562,78 @@ definition {
}
}

@description = "This is a test for COMMERCE-12443. Select a product with tiered price, no promotion ,no discount, and user does the checkout"
@priority = 5
test CanCheckoutProductWithTieredPrice {
property portal.acceptance = "true";

task ("Given a Commerce Account and Buyer User are created") {
CommerceEntry.addAccountEntryUser(
accountName = "Commerce Account",
accountType = "Business",
agreeToTermsAndAnswerReminderQuery = "true",
createNewAccount = "true",
requireReset = "false",
userEmailAddress = "[email protected]",
userFirstName = "Buyer",
userLastName = "User",
userRole = "Buyer",
userScreenName = "buyeruser",
userSiteMembership = "Minium");
}

task ("And the tier list is changed") {
CommercePriceLists.openPriceListsAdmin();

CommerceNavigator.gotoEntry(entryName = "Minium Base Price List");

CommerceEntry.gotoMenuTab(menuTab = "Entries");

CommerceNavigator.searchEntry(entryName = "ABS Sensor");

CommerceNavigator.gotoEntry(entryName = "MIN93015");

CommercePriceLists.createPriceListPriceTiers(
key_pricingType = "Tiered Pricing",
key_quantity = 5,
key_value = 20);
}

task ("And Buyer User logged in") {
User.logoutPG();

CommerceLogin.miniumLogin(
password = "test",
urlAppend = "web/minium",
userEmailAddress = "[email protected]");
}

task ("And buyer user add a product to the cart") {
CommerceAcceleratorsInitializer.changeProductsSorting(sortingType = "Name Ascending");

FrontStore.addInitializerProductToCart(
productName = "ABS Sensor",
productQuantity = 5);
}

task ("Then by clicking Submit button from minicart, the checkout process is completed") {
CommerceCheckout.gotoCheckoutViaMiniCart();

CommerceCheckout.initializersCheckout(
newAddressAddress = "Test Address",
newAddressCity = "Test City",
newAddressCountry = "United States",
newAddressName = "Address Name",
newAddressZipCode = "Test Zip Code",
productName = "ABS Sensor",
productQuantity = 5,
productUnitPrice = 44,
shippingMethod = "Standard");

AssertTextEquals(
locator1 = "CommerceAccelerators#CHECKOUT_SUCCESS_MESSAGE",
value1 = "Success! Your order has been processed.");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ String previewFileURL = previewFileURLs[0];
<link href="<%= PortalUtil.getStaticResourceURL(request, PortalUtil.getPathProxy() + application.getContextPath() + "/preview/css/main.css") %>" rel="stylesheet" type="text/css" />
</liferay-util:html-top>

<clay:alert
<clay:stripe
dismissible="<%= true %>"
displayType="info"
message="the-document-preview-may-not-show-all-pages"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ public FileVersion getFileVersion() throws PortalException {
return _fileVersion;
}

public String getLockInfoCssClass() {
public String getLockInfoDisplayType() {
FileEntry fileEntry = getFileEntry();

if (!fileEntry.hasLock()) {
return "alert-danger";
return "danger";
}

return "alert-info";
return "info";
}

public String getLockInfoMessage(Locale locale) {
Expand Down
Loading

0 comments on commit 04f8aa7

Please sign in to comment.