Skip to content

Latest commit

 

History

History
133 lines (109 loc) · 4.97 KB

File metadata and controls

133 lines (109 loc) · 4.97 KB

Steps to Test Ordering on Nxtbn

1. Create Test Products

  • Create multiple products with varying configurations:
    • Product 1: Tracks inventory only.
    • Product 2: Taxable only.
    • Product 3: Both taxable and tracks inventory.
    • Product 4: Non-tracking and non-taxable.

2. Set Up Tax Classes

  • Define tax classes based on location:
    • Example: Create a tax class "VAT 15%", specifying applicable states, cities, or countries.
    • Rules:
      • If a state and city are specified, the tax applies only to that city.
      • If only a country is specified, the tax applies to the entire country.
      • If multiple tax classes match, the most specific one (e.g., state-level) takes precedence.
  • Ensure taxes and delivery rates depend on the shipping address provided during checkout.

Testing Steps

Step 1: Test Orders with Non-Tracking Products

  • Place an order with a non-tracking product that is taxable.
  • Test with multiple orders across different locations.
  • Verify:
    • Tax rates are applied as per the shipping address.
    • Total calculations (subtotal, tax, and shipping) are accurate.

Step 2: Test Orders with Tracking Products

  • Create an order using a tracking and taxable product.
  • Apply a discount code during checkout.
  • Verify:
    • Discount is applied correctly.
    • Tax and total calculations are accurate.
    • Inventory is updated properly.

Step 3: Test Flat Discount Application

  • Place an order and apply a flat discount (e.g., $200 or 10%).
  • Do not use a discount code for this test.
  • Verify:
    • Discount amount is subtracted correctly.
    • Tax and shipping calculations remain accurate.
    • The final total reflects the discount properly.

Step 4: Test Discount Code Scenarios

  • Test different discount code configurations:
    • Customer-specific: Restricted to specific customers.
    • Product-specific: Applies only to specific products.
    • Time-limited: Valid for specific periods.
    • New Customers: Applicable only to first-time buyers.
    • Redemption Limits: Limited number of uses.
    • Inactive Codes: Ensure inactive codes cannot be applied.
  • Test both flat-rate and percentage-based discounts.
  • Place at least 6 orders with varied scenarios:
    • Verify all validations and calculations (excluding tax and shipping) work as expected.
    • Confirm the discount logic aligns with your configurations.

Step 5: Test Shipping Rate Calculations

  • Set up various shipping rates:
    • Flat rates (e.g., $10 per order).
    • Percentage-based rates (e.g., 5% of the order total).
    • Location-specific rates (e.g., different rates for Dhaka vs. Chattogram).
  • Test by placing at least 6 orders with different scenarios:
    • Example 1: Location Dhaka, taxable product, no discount.
    • Example 2: Location Chattogram, non-taxable product.
    • Example 3: Location X with a discount and a taxable product.
  • Verify:
    • Shipping rates are calculated as per location.
    • Combined tax, discount, and shipping calculations are accurate.

Step 6: Test Stock Updates After Delivery

  • Place an order with a stock-tracking product.
  • Simulate delivering a part of the order (e.g., deliver 3 items out of 6 in stock).
  • Verify:
    • The current stock quantity is reduced only after the product status is marked as delivered.
    • Example:
      • Initial stock: 6.
      • Delivered: 3.
      • Remaining stock: 3.
  • Test with multiple products and ensure:
    • Products that do not track inventory remain unaffected.
    • All stock changes are reflected accurately.

Step 7: Test Shipping and Billing Address Population

  • Place orders and verify that both shipping address and billing address are populated correctly in the database.
  • Ensure:
    • The addresses match what was entered during checkout.
    • Address fields such as state, city, and postal code are stored properly.

Step 8: Test Customer and Base Currency Storage

  • Use a customer currency different from the base currency:
    • Send the currency via the header named Accept-Currency.
    • Ensure:
      • Customer currency is stored in the order table under the correct field.
      • Base currency remains the default for the platform.
      • Currency conversion works accurately.
      • Amounts in customer currency are stored correctly and validated.

Step 9: Validate Cost Storage

  • Verify all costs are stored with accurate amounts and currencies:
    • Shipping cost.
    • Discount.
    • Total tax.
    • Total price.
  • Ensure:
    • Data integrity is maintained.
    • Proper currency fields are used for validation and storage.

Additional Notes

  • Refer to the Nxtbn discount and tax models for detailed logic behind calculations.
  • Cover edge cases and unexpected inputs to ensure robust testing.
  • Ensure validation logic for tax, discount, shipping, and inventory updates is working seamlessly across all scenarios.