> For the complete documentation index, see [llms.txt](https://responsive-media.gitbook.io/advanced-free-shipping/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://responsive-media.gitbook.io/advanced-free-shipping/troubleshooting/testing-guide.md).

# Testing Guide

## Before You Test

1. **Enable Test Mode**

   Turn ON Test Mode before testing to avoid affecting real customers.
2. **Review Configuration**

   Double-check all conditions, targets, and discount values.
3. **Save the Discount**

   Make sure the discount is saved before testing.

***

## Testing Methods

### Method 1: Test Orders (Recommended)

1. **Create Test Order**

   In Shopify admin, go to Orders > Create order.
2. **Add Products**

   Add products that should trigger your conditions.
3. **Add Customer**

   Add a customer or create a test customer.
4. **Add Shipping Address**

   Enter a shipping address that matches your location conditions.
5. **Check Shipping Rates**

   Look at the shipping section - your discount should appear.
6. **Verify Amount**

   Confirm the discount amount is correct.

### Method 2: Development Store

If you have a Shopify development store:

1. Install Advanced Free Shipping
2. Create discount with Test Mode ON
3. Shop normally and go to checkout
4. Verify discount appears correctly

***

## What to Test

### 1. Threshold Values

Test values just above and below your thresholds:

**Example**: Cart total ≥ $50

{% tabs %}
{% tab title="Below Threshold" %}
**Cart: $49.99**

Expected: No discount

✗ If discount appears, threshold is wrong
{% endtab %}

{% tab title="At Threshold" %}
**Cart: $50.00**

Expected: Discount applies

✓ Should work with "is at least"
{% endtab %}

{% tab title="Above Threshold" %}
**Cart: $75.00**

Expected: Discount applies

✓ Should work
{% endtab %}
{% endtabs %}

### 2. Multiple Conditions (AND Logic)

If you have multiple conditions, test:

* ✓ All conditions met → Should apply
* ✗ Only some conditions met → Should NOT apply
* ✗ No conditions met → Should NOT apply

**Example**: Cart ≥ $50 AND Country = US

| Cart | Country | Should Apply? |
| ---- | ------- | ------------- |
| $60  | US      | ✓ Yes         |
| $60  | CA      | ✗ No          |
| $40  | US      | ✗ No          |

### 3. Multiple Scenarios (OR Logic)

If you have multiple rule groups, test each:

* Test each rule group independently
* Test with multiple rule groups met (should still work)
* Test with no rule groups met (should not apply)

**Example**: VIP tag OR Cart ≥ $100

| VIP Tag | Cart | Should Apply?        |
| ------- | ---- | -------------------- |
| Yes     | $30  | ✓ Yes (Rule Group 1) |
| No      | $150 | ✓ Yes (Rule Group 2) |
| Yes     | $150 | ✓ Yes (Either)       |
| No      | $30  | ✗ No                 |

### 4. Location Conditions

For location-based discounts:

* ✓ Test with addresses in included locations
* ✗ Test with addresses in excluded locations
* ✓ Test edge cases (territories, military addresses)

### 5. Product/Collection Conditions

For product-based discounts:

* ✓ Cart with qualifying products only
* ✓ Cart with mix of qualifying and non-qualifying products
* ✗ Cart with no qualifying products

### 6. Discount Amounts

Verify calculations:

**Percentage discounts**:

* $10 shipping with 50% off = $5 ✓
* $15 shipping with 25% off = $11.25 ✓

**Fixed amount discounts**:

* $10 shipping with $5 off = $5 ✓
* $3 shipping with $5 off = $0 (free) ✓

**Fixed price discounts**:

* Any shipping with $3 fixed = $3 ✓

### 7. Multiple Targets

If you have multiple targets:

* Test that each target applies to the correct rates
* Verify different discounts apply to different methods
* Check that customers see all options with correct pricing

***

## Testing Checklist

Use this checklist for every discount:

<details>

<summary>Basic Functionality</summary>

* [ ] Discount appears when conditions are met
* [ ] Discount does NOT appear when conditions aren't met
* [ ] Discount amount is correct
* [ ] Test Mode works correctly

</details>

<details>

<summary>Threshold Testing</summary>

* [ ] Test value below threshold (should not apply)
* [ ] Test value at exact threshold (should apply)
* [ ] Test value above threshold (should apply)

</details>

<details>

<summary>Condition Testing</summary>

* [ ] Test each condition individually
* [ ] Test all conditions together
* [ ] Test with some conditions missing

</details>

<details>

<summary>Scenario Testing (if applicable)</summary>

* [ ] Test each rule group independently
* [ ] Test with multiple rule groups met
* [ ] Test with no rule groups met

</details>

<details>

<summary>Edge Cases</summary>

* [ ] Guest checkout (if applicable)
* [ ] Logged-in customers (if using tags)
* [ ] Different shipping addresses
* [ ] Different product combinations
* [ ] Currency/tax variations

</details>

***

## After Testing

1. **Review Results**

   Verify all tests passed as expected.
2. **Fix Issues**

   If any tests failed, edit the discount and fix the issues.
3. **Retest**

   Test again after making changes.
4. **Disable Test Mode**

   Once everything works, turn Test Mode OFF.
5. **Go Live**

   Save the discount to activate it for real customers.
6. **Monitor**

   Check the discount usage on your dashboard after going live.

***

## Tips for Effective Testing

{% hint style="info" %}
**Test with realistic data**: Use actual product prices, real shipping rates, and typical cart values.
{% endhint %}

{% hint style="info" %}
**Document your tests**: Keep notes on what you tested and the results.
{% endhint %}

{% hint style="info" %}
**Test edge cases**: Don't just test the happy path - try unusual combinations.
{% endhint %}

{% hint style="info" %}
**Test on different devices**: Verify the discount works on mobile and desktop.
{% endhint %}

{% hint style="info" %}
**Test with different customer types**: Guest, logged-in, VIP, etc.
{% endhint %}

***

## Related

* [**Test Mode**](/advanced-free-shipping/core-concepts/test-mode.md) - Learn about Test Mode
* [**Common Issues**](/advanced-free-shipping/troubleshooting/common-issues.md) - Fix common problems


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://responsive-media.gitbook.io/advanced-free-shipping/troubleshooting/testing-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
