After you implement the checkout handler for your Order with Google web service, test the handler to make sure the checkout flow works.
To prepare to test your web service, follow these steps:
Ensure you have edit access to the Actions on Google project associated with your Order with Google service in the Actions console. 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 project's web service with the checkout action code you implemented for the Build checkout order section.
Make sure your order fulfillment URL endpoint is publicly accessible from your web service.
You can complete checkout testing with the Actions console using either an automated testing method or a manual test, using your valid data feed. If possible, use the automated testing method for faster results and testing coverage.
Test with the automated testing tool
The Actions console provides a set of automated tests you can run against your web service to test checkout. This testing method can save you time by automating the testing process and providing a repeatable test set.
To test the checkout handler of your Order with Google web service, follow these steps:
- Go to Test > Integrations.
- For Data feed, select your data feed source.
- For Fulfillment endpoint, enter the fulfillment endpoint URL you want to test against.
- In Advanced settings, select the test cases for your integration test to run. For now, focus on the Checkout > Eligible cart - items without options test case.
- 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 work as expected (success rate of at least 95%). 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 a data feed
You can test your checkout using a valid data feed for your Order with Google service. This testing process uses the data feed preview mode to walk through the checkout process and simulate a checkout.
To manually test with your data feed, follow these steps:
- Go to Develop > Data feeds in the Actions console.
- On the Test your app with feeds card, click Get started.
- Select Preview as the data feed environment from the dropdown.
- Click Launch Test to preview your feed.
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.
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. Refer to this output while performing a manual test to troubleshoot specific issues.
- Your fulfillment 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.