forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'liferay:master' into master
- Loading branch information
Showing
165 changed files
with
3,537 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -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."); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.