mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[API][Behat] Implement other scenarios for applying taxes included in price on order
This commit is contained in:
parent
da55b3aaca
commit
95a9788d0d
4 changed files with 12 additions and 11 deletions
|
|
@ -13,7 +13,7 @@ Feature: Apply correct taxes for an order with a discount for a shipping when ta
|
|||
And the promotion gives "10%" discount on shipping to every order
|
||||
And I am a logged in customer
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly rounded up tax
|
||||
Given the store has "DHL" shipping method with "$56.95" fee
|
||||
And shipping method "DHL" belongs to "Shipping" tax category
|
||||
|
|
@ -22,7 +22,7 @@ Feature: Apply correct taxes for an order with a discount for a shipping when ta
|
|||
Then my cart total should be "$61.25"
|
||||
And my included in price taxes should be "$4.66"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly rounded down tax
|
||||
Given the store has "DHL" shipping method with "$56.85" fee
|
||||
And shipping method "DHL" belongs to "Shipping" tax category
|
||||
|
|
@ -31,7 +31,7 @@ Feature: Apply correct taxes for an order with a discount for a shipping when ta
|
|||
Then my cart total should be "$61.16"
|
||||
And my included in price taxes should be "$4.65"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly calculated taxes when item belongs to different tax category and has tax included in price
|
||||
Given the store has included in price "Standard VAT" tax rate of 23% for "Mugs" within the "US" zone
|
||||
And the store has a product "Sonata Mug" priced at "$10.00"
|
||||
|
|
@ -43,7 +43,7 @@ Feature: Apply correct taxes for an order with a discount for a shipping when ta
|
|||
Then my cart total should be "$55.00"
|
||||
And my included in price taxes should be "$5.96"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly calculated taxes when item belongs to different tax category and not has tax included in price
|
||||
Given the store has "Standard VAT" tax rate of 23% for "Mugs" within the "US" zone
|
||||
And the store has a product "Sonata Mug" priced at "$10.00"
|
||||
|
|
|
|||
|
|
@ -20,33 +20,33 @@ Feature: Apply correct taxes for an order with a discount applied for all items
|
|||
And there is a promotion "PHP promotion"
|
||||
And the promotion gives "$10.00" off if order contains a "PHP Mug" product
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly rounded up tax for single product
|
||||
When I add product "Symfony Mug" to the cart
|
||||
Then my cart total should be "$46.95"
|
||||
And my included in price taxes should be "$4.27"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly rounded down tax for single product
|
||||
When I add product "PHP Mug" to the cart
|
||||
Then my cart total should be "$46.90"
|
||||
And my included in price taxes should be "$4.26"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly rounded taxes for multiple products with different tax rate
|
||||
When I add 2 products "PHP T-Shirt" to the cart
|
||||
And I add product "PHP Mug" to the cart
|
||||
Then my cart total should be "$66.90"
|
||||
And my included in price taxes should be "$7.75"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly rounded taxes for multiple products with the same tax rate
|
||||
When I add 2 products "PHP Mug" to the cart
|
||||
And I add product "Symfony Mug" to the cart
|
||||
Then my cart total should be "$150.75"
|
||||
And my included in price taxes should be "$13.70"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Properly rounded taxes for order with multiple promotions and multiple products with different tax rate
|
||||
And there is a promotion "Clothing promotion"
|
||||
And the promotion gives "$5.00" off if order contains a "PHP T-Shirt" product
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Feature: Apply correct taxes for items with tax rate included in price
|
|||
And the store has a product "PHP T-Shirt" priced at "$100.00"
|
||||
And it belongs to "Clothes" tax category
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Proper taxes for taxed product
|
||||
When I add product "PHP T-Shirt" to the cart
|
||||
Then my cart total should be "$100.00"
|
||||
|
|
|
|||
|
|
@ -420,6 +420,7 @@ final class CartContext implements Context
|
|||
|
||||
/**
|
||||
* @Then /^the product "([^"]+)" should have total price ("[^"]+") in the cart$/
|
||||
* @Then /^total price of "([^"]+)" item should be ("[^"]+")$/
|
||||
*/
|
||||
public function theProductShouldHaveTotalPriceInTheCart(string $productName, int $totalPrice): void
|
||||
{
|
||||
|
|
@ -592,7 +593,7 @@ final class CartContext implements Context
|
|||
public function myCartTaxesShouldBe(int $taxTotal): void
|
||||
{
|
||||
Assert::same(
|
||||
$this->responseChecker->getValue($this->shopClient->getLastResponse(), 'taxTotal'),
|
||||
$this->responseChecker->getValue($this->shopClient->getLastResponse(), 'taxExcludedTotal'),
|
||||
$taxTotal
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue