Documentation ¶
Overview ¶
Package test represents set of test writing helpers and global application tests. It provides a set of functions you can use for starting Ottemo application in a test mode, prepare randomized data, fill DB with sample data, which is use-full during GO tests writing.
Package also contains a set of benchmarks and tests which related to whole application rather when particular package. In order to run them use:
go test [-tags ...] github.com/ottemo/commerce/tests go test -bench . [-tags ...] github.com/ottemo/commerce/tests
(refer to http://golang.org/pkg/testing/ for details)
Index ¶
- func AddRandomProductsToCart(currentCheckout checkout.InterfaceCheckout, n int) error
- func CheckTestIniDefaults() error
- func FullCheckout() error
- func GetNewCheckout(checkoutVisitor visitor.InterfaceVisitor) (checkout.InterfaceCheckout, error)
- func GetRandomVisitor() (visitor.InterfaceVisitor, error)
- func MakeSureProductsCount(countShouldBe int) error
- func RandomizeShippingAndBillingAddresses(currentCheckout checkout.InterfaceCheckout) error
- func StartAppInTestingMode() error
- func SwitchToTestIniSection() error
- func UpdateShippingAndPaymentMethods(currentCheckout checkout.InterfaceCheckout) error
- func UpdateWorkingDirectory() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRandomProductsToCart ¶
func AddRandomProductsToCart(currentCheckout checkout.InterfaceCheckout, n int) error
AddRandomProductsToCart adds n count products to checkout cart
func CheckTestIniDefaults ¶
func CheckTestIniDefaults() error
CheckTestIniDefaults prepares database to be used for tests
func FullCheckout ¶
func FullCheckout() error
FullCheckout is a routine to emulate full checkout process at once
func GetNewCheckout ¶
func GetNewCheckout(checkoutVisitor visitor.InterfaceVisitor) (checkout.InterfaceCheckout, error)
GetNewCheckout returns new checkout object with assigned new session, and cart to it
func GetRandomVisitor ¶
func GetRandomVisitor() (visitor.InterfaceVisitor, error)
GetRandomVisitor returns visitor object with randomly filled data
func MakeSureProductsCount ¶
MakeSureProductsCount checks products count in DB and adds missing if needed
func RandomizeShippingAndBillingAddresses ¶
func RandomizeShippingAndBillingAddresses(currentCheckout checkout.InterfaceCheckout) error
RandomizeShippingAndBillingAddresses sets shipping and billing addresses for checkout object
func StartAppInTestingMode ¶
func StartAppInTestingMode() error
StartAppInTestingMode starts application in "test mode" (you should use that function for your package test)
func SwitchToTestIniSection ¶
func SwitchToTestIniSection() error
SwitchToTestIniSection switches ini config to use value from test section instead of general
func UpdateShippingAndPaymentMethods ¶
func UpdateShippingAndPaymentMethods(currentCheckout checkout.InterfaceCheckout) error
UpdateShippingAndPaymentMethods sets check money order payment method and flat rate shipping method to checkout
func UpdateWorkingDirectory ¶
func UpdateWorkingDirectory() error
UpdateWorkingDirectory modifies current working directory to be same for all packages
Types ¶
This section is empty.