After you implement the Checkout and Order submit for your Order with Google fulfillment API, test the handler to make sure both flows work.
To prepare to test your fulfillment API, follow these steps:
Ensure you have edit access to the GCP project associated with your Order with Google account in the Partner Portal. You can check and modify access to the project using the Google Cloud Identity Access Management (IAM) console.
Upload a data feed JSON file to be used for testing. The data feed must contain at least one
Restaurantentity and the corresponding
Menuentities. You can use one of the valid data feeds you previously created in the Order with Google data feeds section.
Update your Fulfillment API with the Checkout and Order submit actions code you implemented.
Make sure your order fulfillment URL endpoint is publicly accessible.
You can complete checkout testing in the Partner Portal using either the automated integration tests or quick testing, with your valid data feed. If possible, use the automated testing method for faster results and testing coverage.
Test with the automated testing tool
The Partner Portal provides a set of automated tests you can run against your fulfillment endpoint to test checkout and submit. This testing method can save you time by automating the testing process and providing a repeatable test set.
To test the checkout and submit order handlers of your fulfillment API, follow these steps:
- Make sure you have selected the right environment from the environment selector.
- Go to Inventory > Integration Testing in the Partner Portal.
- Click New test.
- In the Fulfillment endpoint field, enter the fulfillment endpoint URL you want to test against.
- In the Test Cases section under Checkout drop down, select the test cases you want to run. We recommend starting with Eligible cart - items without options.
- In the Test Cases section under Submit Order drop down, select the test cases you want to run with your submit order handler. We recommend that you initiate with the Eligible cart test case.
- You may also adjust the Samples and QPS parameters:
- Samples: The number of restaurant entities randomly selected for testing.
- QPS: The max QPS your fulfillment API can support.
- To start the test, click Run.
Wait for the test to complete. This can take up to 20 minutes depending on the number of entities and test cases selected.
Review the results of your integration test to make sure your feed and fulfillment API work as expected. You should have a success rate of at least 95% for each of the tests. For test cases with a low success rate, you can get more information about associated error messages by clicking on the test case.
Test manually with the quick testing tool
You can test your checkout and submit actions using a valid data feed for your Order with Google service. This testing process uses the Quick Testing tool to walk through the user ordering flow and simulate a cart checkout and order submit.
To manually test with your data feed, follow these steps:
- Go to Dashboards > Quick Testing in the Partner Portal.
- Use Upload File to upload the data feed you want to use for testing. The file must be in NDJSON format.
- After the upload finishes, click Submit.
- Wait until the system processes the data feed file. This can take up to a few minutes. The table refreshes automatically.
- After the status shows Success, click Quick Test.
- Insert in the Test API field the fulfillment API endpoint you want to test.
- Click Quick Test to initiate the ordering flow.
Go through the Order with Google flow by selecting your desired restaurant and building a cart.
Test your checkout endpoint by clicking the Checkout button.
If the checkout was successful, test your submit order endpoint by clicking the Place order button.
If the order is successfully submitted, the interface displays a confirmation page containing your order details.
In addition to the steps outlined above, you can use console tools to further test and troubleshoot your order fulfillment.
Refer to the following tools for additional guidance:
- The Chrome DevTools Console outputs request and response JSON between the console and your fulfillment endpoint. Refer to this output while performing a manual test to troubleshoot specific issues.
- Your fulfillment endpoint outputs its Stackdriver logs to the Google Cloud console. If you're troubleshooting issues with your fulfillment code, refer to these logs for detailed error messages.