Live Shipping Rates and Address Validation in WooCommerce

Testing live shipping rates is critical for ensuring your WooCommerce store’s checkout process functions correctly. CheckView offers a way to automate this process, ensuring that live shipping rates and address validation plugins work as expected.

Default Address Configuration

To ensure that all tests pass regardless of the shipping carrier or address validation plugin used, CheckView defaults to using a real North Carolina, USA-based physical address. This ensures that live shipping rates and address validations will function correctly as long as North Carolina is enabled in your shipping settings.

Default Shipping Address

4 Long Shoals Rd Ste B #
638
Arden, NC 28704

You can change these variables to use any valid physical address if preferred. To modify the default address, navigate to the organizational variables settings in your account or you can change per test flow in the test flow settings.

Testing Live Shipping Rates

To verify that live shipping rates are working correctly, follow these steps:

Step 1: Set Up Your Test

  1. Create a New Test Flow: Log in to your CheckView account, connect the WordPress site if not completed yet and create a new WooCommerce Full Checkout test flow and schedule the test flow as desired.
  2. Save Test Flow: Once the test flow has been created successfully, click on the ‘Edit Steps’ from the test flow page before running a test.
  3. Configure Shipping Address: Ensure the shipping address values in the steps are set to our North Carolina address, or update it to your preferred address.
  4. Add Custom Step: Create a custom step at the checkout process using the “Assert element text contains” action to verify the live shipping rates.
    • Example Step
      • Action: Assert element text contains
      • Element: [Specify the CSS selector for the shipping rate element]
      • Value: [Expected shipping rate value or partial text]
    • If the expected shipping rate is $10.00, your custom step might look like this:
      • Action: Assert element text contains
      • Element: label[for=’shipping_method_0_wf_fedex_woocommerce_shippingpriority_overnight’] bdi:nth-child(1)
      • Value: $10.00
  5. Run a Manual Test to Validate: Click ‘Run Test’ and once the test has been completed, confirm the test flow works as expected with your shipping field values and the assertion on the live shipping rates.

Address Validation

If you are using an address validation plugin, you can also add a custom validation step is in your test flow:

Example Validation Step

  • Add Validation Check: Add a step to verify that the address validation plugin confirms the entered address.
  • Assert Validation Message: Use the “Assert element text contains” action to check for your address validation messages.

Example: If the address validation plugin displays “Address is valid”, your custom step might look like this:

  • Action: Assert element text contains
  • Element: .validation-message
  • Value: Address is valid

Tips for Successful Shipping Tests

  • Use Realistic Data: Always use realistic shipping addresses and product weights to get accurate shipping rates.
  • Update Regularly: Shipping rates and address validation rules can change. Regularly update your test flow steps to reflect any changes in your WooCommerce settings or shipping carrier APIs.
  • Monitor Results: Review the test results after each test run to identify and fix any issues promptly.