The Cart Loads test ensures your stores cart page loads without failure.
During this test, Robot Ninja will first adds products to the cart (see Add Products to Cart) and then will navigate to your cart page to test everything is in order. To confirm, Robot Ninja checks
woocommerce-cart element must exist on the page.
This doc will only list the selectors relevant to checking the cart page has loaded. You can find the selectors used for adding products to the cart in the Add Products to Cart doc.
- WooCommerce cart page body - We look for class name:
If the test skipped, be sure to read the message next to the test for instructions. The only reason this test would be marked as skipped is because Robot Ninja could not find any products in your store to test.
You can read about how Robot Ninja selects products to test in our doc on Selecting Products to Test.
Here's a list of errors that can cause the Cart Loads test to fail and reasons why they are failing. If there's a test that is failing and you think it shouldn't be please email us and we'll have a look for you.
If your Cart Loads test is failing when trying to add products in the cart, you can view the errors caused by that in our Add Product to Cart test doc.
"After adding a product to the cart, Robot Ninja navigated to your store's Cart page (CART PAGE URL) and was unable to find any element with class name woocommerce-cart. Robot Ninja waited a maximum of 8 seconds before timing out."
There could be a few reasons as to why you're seeing this error message beside a failed test:
- If you have a screenshot available, check if first to see if that helps your understand why the test failed. If the screenshot is a blank/white page, that usually indicates something went wrong when trying to visit your CART PAGE URL. First check if the URL in the error message is correct. If it's correct, check your PHP error logs to make sure no fatal errors where thrown. The next thing you can do is to try replicate the issue by manually visiting your store as a guest customer and try add products to your cart and then visit the cart.
- If you have a screenshot and the screenshot is showing an empty cart or the shop page, this could mean that something went wrong when Robot Ninja tried to add products to the cart but didn't catch any errors. In order to find out what caused this error and to diagnose if there's an error on your store, you will need to manually go to your store and add the same products to your cart and then try visit the cart page.
- If the screenshot looks good but you're still seeing this error, then it may be because your theme is customizing the default woocommerce-cart body class used on the cart template. To check this yourself, go to your cart page using a modern browser, inspect your cart page and look for the <body> tag. You should see woocommerce-cart within the list of class names.
Customized Add to Cart process or Cart Page
This test is built with the intention of it working on the majority of WooCommerce stores out there, but we understand that every store is different. If you have customized WooCommerce or have a theme that changes WooCommerce in a unique way, then it's possible that this test doesn't work out of the box for you. If this is the case please contact our team (firstname.lastname@example.org) and we can discuss updating the existing test or writing a custom test for you.