forked from shopware/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next-39286/tax-free-countries-acceptance-test' into 'tr…
…unk' NEXT-39286 - tax free adjustment for currency See merge request shopware/6/product/platform!15339
- Loading branch information
Showing
3 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
49 changes: 49 additions & 0 deletions
49
tests/acceptance/tests/Settings/TaxFreeCartForCurrency.spec.ts
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { test } from '@fixtures/AcceptanceTest'; | ||
|
||
test('As a merchant, I would be able to adjust free tax for defined currency', { tag: '@Settings' }, async ({ | ||
ShopCustomer, | ||
TestDataService, | ||
DefaultSalesChannel, | ||
StorefrontProductDetail, | ||
StorefrontCheckoutConfirm, | ||
StorefrontCheckoutFinish, | ||
ChangeStorefrontCurrency, | ||
Login, | ||
AddProductToCart, | ||
ProceedFromProductToCheckout, | ||
ConfirmTermsAndConditions, | ||
SelectInvoicePaymentOption, | ||
SelectStandardShippingOption, | ||
SubmitOrder, | ||
}) => { | ||
const product = await TestDataService.createBasicProduct(); | ||
const currency = await TestDataService.createCurrency({ taxFreeFrom: 5 }); | ||
const customer = await TestDataService.createCustomer(); | ||
await TestDataService.assignSalesChannelCurrency(DefaultSalesChannel.salesChannel.id, currency.id); | ||
|
||
await ShopCustomer.attemptsTo(Login(customer)); | ||
|
||
await ShopCustomer.goesTo(StorefrontProductDetail.url(product)); | ||
await ShopCustomer.attemptsTo(ChangeStorefrontCurrency(currency.isoCode)); | ||
await ShopCustomer.expects(StorefrontProductDetail.productSinglePrice).toHaveText(currency.isoCode+' 24.00*'); | ||
|
||
await ShopCustomer.attemptsTo(AddProductToCart(product)); | ||
await ShopCustomer.expects(StorefrontProductDetail.offCanvasSummaryTotalPrice).toHaveText(currency.isoCode+' 20.16*'); | ||
|
||
await ShopCustomer.attemptsTo(ProceedFromProductToCheckout()); | ||
|
||
await ShopCustomer.attemptsTo(ConfirmTermsAndConditions()); | ||
await ShopCustomer.attemptsTo(SelectInvoicePaymentOption()); | ||
await ShopCustomer.attemptsTo(SelectStandardShippingOption()); | ||
|
||
await ShopCustomer.expects(StorefrontCheckoutConfirm.taxPrice).not.toBeVisible(); | ||
await ShopCustomer.expects(StorefrontCheckoutConfirm.grandTotalPrice).toHaveText(currency.isoCode+' 20.16'); | ||
|
||
await ShopCustomer.attemptsTo(SubmitOrder()); | ||
await ShopCustomer.expects(StorefrontCheckoutFinish.taxPrice).not.toBeVisible(); | ||
await ShopCustomer.expects(StorefrontCheckoutFinish.grandTotalPrice).toHaveText(currency.isoCode+' 20.16'); | ||
|
||
const orderId = StorefrontCheckoutFinish.getOrderId(); | ||
|
||
TestDataService.addCreatedRecord('order', orderId); | ||
}); |