Skip to content

Commit

Permalink
Merge branch 'next-39286/tax-free-countries-acceptance-test' into 'tr…
Browse files Browse the repository at this point in the history
…unk'

NEXT-39286 - tax free adjustment for currency

See merge request shopware/6/product/platform!15339
  • Loading branch information
frobel committed Nov 25, 2024
2 parents 436459e + 2104b0a commit fe4c489
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/acceptance/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/acceptance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@playwright/test": "1.45.3",
"@currents/playwright": "^1.5.11",
"@shopware-ag/acceptance-test-suite": "5.1.0",
"@shopware-ag/acceptance-test-suite": "5.3.0",
"@shopware/api-client": "^0.0.0-canary-20230823113412",
"playwright-lighthouse": "4.0.0",
"lighthouse": "12.2.0"
Expand Down
49 changes: 49 additions & 0 deletions tests/acceptance/tests/Settings/TaxFreeCartForCurrency.spec.ts
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);
});

0 comments on commit fe4c489

Please sign in to comment.