public class CommerceServicesKeywordLibrary extends AbstractKeywordLibrary
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SESSION_CART_PARAMETER_NAME |
static java.lang.String |
SITE |
| Constructor and Description |
|---|
CommerceServicesKeywordLibrary() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProductToCart(java.lang.String productCode,
long quantity)
Java implementation of the robot keyword
|
void |
addProductToCartOnce(java.lang.String productCode)
Java implementation of the robot keyword
|
CartData |
cloneSavedCart(java.lang.String cartCode,
java.lang.String name,
java.lang.String description)
Java implementation of the robot keyword
|
void |
createCustomerWithHybrisApi(java.lang.String login,
java.lang.String password,
java.lang.String titleCode,
java.lang.String firstName,
java.lang.String lastName)
Java implementation of the robot keyword
|
void |
decreaseSavedCartsExpirationDate()
Implementation of the robot keyword
|
void |
deleteCartEntry(long entryNumber)
Java implementation of the robot keyword
|
CartData |
flagCartForDeletion(java.lang.String cartCode)
Keyword implementation for flagging a saved cart for deletion
|
CartData |
flagForDeletion(CartData cartToBeFlagged)
Keyword implementation for flagging a saved cart for deletion
|
CartData |
getCartDTO()
Get session cart.
|
protected ConfigurationInfoData |
getConfigurationByLabel(OrderEntryData entry,
java.lang.String label) |
ConfigurationInfoData |
getConfigurationForOrderEntry(OrderEntryData entry,
java.lang.String label)
Java implementation of
get configuration for entry .... |
java.util.List<ConfigurationInfoData> |
getConfigurationsForOrderEntry(java.lang.Integer entryNumber,
OrderData order)
Java implementation of the robot keyword
|
CartModel |
getCurrentSessionCart()
Java implementation of the robot keyword
|
OrderEntryData |
getEntryByNumber(AbstractOrderData order,
java.lang.Integer entryNumber)
Find entry by entry number.
|
java.util.List<CartData> |
getListOfSavedCarts(java.lang.String statusList) |
CartData |
getSavedCartFromList(java.util.ArrayList<CartData> savedCartList,
java.lang.String code)
Java implementation of the robot keyword
|
java.util.List<CartData> |
getSavedCartsForCurrentUser()
Implementation of the robot keyword
|
java.util.List<CartModel> |
getSavedCartsToRemove()
Implementation of the robot keyword
|
void |
login(java.lang.String userUID)
Java implementation of the robot keyword
|
void |
pickupProductToCart(java.lang.String productCode,
long quantity,
java.lang.String storeId)
Java implementation of the robot keyword
|
void |
prepareSession(java.lang.String baseSiteUid)
Java implementation of the robot keyword
|
CartModel |
removeAndCreateNewSessionCart()
Java implementation of the robot keyword
|
void |
removeProductFromCart(java.lang.String productCode)
Java implementation of the robot keyword
|
void |
resetSystemAttributes()
Java implementation of the robot keyword
|
CartRestorationData |
RestoreSavedCartWithCode(java.lang.String code)
Keyword implementation for retrieve saved cart with cart code
|
CartData |
retrieveSavedCartWithCode(java.lang.String code)
Keyword implementation for retrieve saved cart with cart code
|
CartData |
saveCartWithNameAndDescription(java.lang.String name,
java.lang.String description)
Java implementation of the robot keyword
|
CartData |
saveGivenCartWithNameAndDescription(java.lang.String cartId,
java.lang.String name,
java.lang.String description)
Java implementation of the robot keyword
|
protected void |
setCartUser(java.lang.String userUID)
Sets the cart user and the session currency
|
protected CurrencyModel |
setCurrencyAndBaseSite(UserModel user) |
void |
setCurrentBaseSite(java.lang.String baseSiteUid)
Java implementation of the robot keyword
|
void |
setEntryQuantity(int entryNumber,
long quantity)
Java implementation of the robot keyword
|
void |
updateConfigurationInfo(OrderEntryData entry,
java.lang.String label,
java.lang.String value)
Change value of single
ConfigurationInfoData. |
void |
updateEntryWithPointOfService(OrderEntryData entry,
java.lang.String storeId)
Java implementation of the robot keyword
|
void |
verifyCartClone(java.lang.String originalCartCode,
java.lang.String clonedCartCode)
Java implementation of the robot keyword
|
void |
verifyCartTotal(double expectedTotal)
Java implementation of the robot keyword
|
void |
verifyClonedCartEntries(java.lang.String originalCartCode,
java.lang.String clonedCartCode)
Java implementation of the robot keyword
|
void |
verifyListSizeEquals(java.util.List<java.lang.Object> list,
int expectedSize)
Implementation of the robot keyword
|
void |
verifyThatDate1IsNDaysLaterThanDate2(java.util.Date date1,
int days,
java.util.Date date2)
Java implementation of the robot keyword
|
public static final java.lang.String SESSION_CART_PARAMETER_NAME
public static final java.lang.String SITE
public void addProductToCartOnce(java.lang.String productCode)
add product to cart once
productCode - the code of the product to addpublic void addProductToCart(java.lang.String productCode,
long quantity)
add product to cart
productCode - the code of the product to addquantity - the number of units to addpublic void deleteCartEntry(long entryNumber)
delete cart entry
entryNumber - the entry number to deletepublic void removeProductFromCart(java.lang.String productCode)
remove product from cart
productCode - the code of the product to removepublic void verifyCartTotal(double expectedTotal)
verify cart total
expectedTotal - the expected order total for the billing eventpublic void setCurrentBaseSite(java.lang.String baseSiteUid)
set current base site
baseSiteUid - the unique base site IDpublic void prepareSession(java.lang.String baseSiteUid)
prepare session
baseSiteUid - the unique base site IDpublic void resetSystemAttributes()
reset system attributes
public void login(java.lang.String userUID)
login
userUID - the unique user IDprotected void setCartUser(java.lang.String userUID)
userUID - the unique user IDprotected CurrencyModel setCurrencyAndBaseSite(UserModel user)
public void createCustomerWithHybrisApi(java.lang.String login,
java.lang.String password,
java.lang.String titleCode,
java.lang.String firstName,
java.lang.String lastName)
createCustomerWithHybrisApi
login - the unique user IDpassword - passwordtitleCode - title codefirstName - first namelastName - lastNamepublic CartData saveCartWithNameAndDescription(java.lang.String name, java.lang.String description) throws CommerceSaveCartException
save cart with name and description
name - name of the cart to be saveddescription - description of the cart to be savedCommerceSaveCartExceptionpublic CartData saveGivenCartWithNameAndDescription(java.lang.String cartId, java.lang.String name, java.lang.String description) throws CommerceSaveCartException
save given cart with name and description
cartId - id/code of the cart to be savedname - name of the cart to be saveddescription - description of the cart to be savedCommerceSaveCartExceptionpublic CartData flagForDeletion(CartData cartToBeFlagged) throws CommerceSaveCartException
cartToBeFlagged - the saved cart to be flagged for deletionCommerceSaveCartExceptionpublic CartData flagCartForDeletion(java.lang.String cartCode) throws CommerceSaveCartException
cartCode - the code of the saved cart to be flagged for deletionCommerceSaveCartExceptionpublic CartData retrieveSavedCartWithCode(java.lang.String code) throws CommerceSaveCartException
code - the cart code to be retrievedCommerceSaveCartExceptionpublic CartRestorationData RestoreSavedCartWithCode(java.lang.String code) throws CommerceSaveCartException
code - the cart code to be retrievedCommerceSaveCartExceptionpublic CartModel getCurrentSessionCart()
get session cart
public CartModel removeAndCreateNewSessionCart()
create new session cart
public void verifyThatDate1IsNDaysLaterThanDate2(java.util.Date date1,
int days,
java.util.Date date2)
verify that date1 is n days later than date2
date1 - date that is expected to be n days later than date2days - number of daysdate2 - base datepublic CartData getSavedCartFromList(java.util.ArrayList<CartData> savedCartList, java.lang.String code)
get saved cart from list
savedCartList - public void verifyListSizeEquals(java.util.List<java.lang.Object> list,
int expectedSize)
verify equal list size
Compares the size of the given list to an expected value
list - the list whose size should be comparedexpectedSize - expected valuepublic java.util.List<CartModel> getSavedCartsToRemove()
get saved carts to remove
Determines the saved carts whose expiration date exceeds the given value.public void decreaseSavedCartsExpirationDate()
decrease saved carts expiration date
For a saved cart the expiration date is set to a value which causes a finding in the unsaveDao.public java.util.List<CartData> getSavedCartsForCurrentUser()
get saved carts for current user
Lists all saved carts for the current user.public java.util.List<CartData> getListOfSavedCarts(java.lang.String statusList)
public CartData cloneSavedCart(java.lang.String cartCode, java.lang.String name, java.lang.String description) throws CommerceSaveCartException
clone saved cart with code
CommerceSaveCartExceptionpublic void verifyCartClone(java.lang.String originalCartCode,
java.lang.String clonedCartCode)
verify cart clone
public void verifyClonedCartEntries(java.lang.String originalCartCode,
java.lang.String clonedCartCode)
verify cloned cart entries
public java.util.List<ConfigurationInfoData> getConfigurationsForOrderEntry(java.lang.Integer entryNumber, OrderData order)
get configurations for order entry
public ConfigurationInfoData getConfigurationForOrderEntry(OrderEntryData entry, java.lang.String label)
get configuration for entry ....entry - order entrylabel - configuration info label, e.g. fontsizepublic OrderEntryData getEntryByNumber(AbstractOrderData order, java.lang.Integer entryNumber)
order - order dataentryNumber - entry numberpublic CartData getCartDTO()
getCurrentSessionCart()
, but we need CartData rather that CartModel.public void updateConfigurationInfo(OrderEntryData entry, java.lang.String label, java.lang.String value) throws CommerceCartModificationException
ConfigurationInfoData.entry - entry that hold configurations (must be a part of session cart)label - configuration labelvalue - new value to set to configurationCommerceCartModificationExceptionjava.lang.IllegalArgumentException - if there is no configuration with given labelprotected ConfigurationInfoData getConfigurationByLabel(OrderEntryData entry, java.lang.String label)
public void pickupProductToCart(java.lang.String productCode,
long quantity,
java.lang.String storeId)
pickup product to cart
productCode - the code of the product to addquantity - the number of units to add *storeId - id of store to pick uppublic void updateEntryWithPointOfService(OrderEntryData entry, java.lang.String storeId)
update point of service
entry - order entry to updatestoreId - id of store to select for order entrypublic void setEntryQuantity(int entryNumber,
long quantity)
set entry quantity
entryNumber - entry numberquantity - quantity to update entry withCopyright © 2018 SAP SE. All Rights Reserved.