Smart Home Test Suite

The smart home test suite is a web application that allows you to self-test your smart home Action. The test suite automatically generates and runs test cases based on the devices and traits associated with your account.

Go to the smart home test suite

Prerequisites

Before you can self-test your smart home Action, complete these prerequisites:

  • A quiet environment for text to speech to be clear for the Google Assistant. The smart home test suite uses the speech synthesis API to simulate user queries.
  • A computer with speakers and a web browser.
  • A Google Home device with language set to English. Tests are only supported in English. Place this Google Home device next to your computer.
  • A Google Account. This is only required if you want to export test results to Google Sheets.
  • Give your devices names that are clear and easy to understand. Avoid using numbers for a device name, such as Lamp1.
  • Make sure that Report State and Request Sync are implemented for your devices and traits.
  • A service account key. If you do not have one, see service account key.
  • Your agentUserId. If you do not have it, see retrieve your agentUserId.

If you already have completed all of the prerequisites, see self-test your action.

Service account key

GCP Console

Note: Ensure that you are using the correct GCP project when performing these steps. This is the project that matches your smart home project ID.
  1. In the GCP Console, go to the Create service account key page.

    Go to the Create Service Account Key page
  2. From the Service account list, select New service account.
  3. In the Service account name field, enter a name.
  4. In the Service account ID field, enter a ID.
  5. From the Role list, select Service Accounts > Service Account Token Creator.

  6. For the Key type, select the JSON option.

  7. Click Create. A JSON file that contains your key downloads to your computer.

Retrieve your agentUserId

agentUserId

  1. Replace the email@gmail.com and your_project_id with valid values for your project and open the page:

    https://gala-demo.appspot.com/app?login_hint=email@gmail.com&service_id=your_project_id_dev
    

    The page displays an Access Token. You can use this Access Token to retrieve your agentUserId.

  2. Replace the your_access_token and your_fulfillment_URL with valid values for your project and run the curl command:

    curl -X POST -H"content-type: application/json" -d '{"requestId":"ff36a3cc-ec34-11e6-b1a0-64510650abcf","inputs":[{"intent":"action.devices.SYNC"}]}' -H "Authorization: Bearer your_access_token" 'your_fulfillment_URL' | grep agentUserId
    

Self-test your Action

  1. In your web browser, open the smart home test suite.

  2. In the Agent User Id field, enter your agentUserId.

  3. Click the paper clip button that is next to the Service Account Key field. Then, from the file dialog, select your service account key. The Project ID is filled in automatically from the service account key.

  4. If you want to certify your smart home action, do not change the default Report State/Request Sync Timeout value. However, for testing, you may change the timeout value if your agent takes more time to report state to Home Graph.

  5. Select Test Request Sync. This is the default option.

  6. If you are using a Scene trait, select Test Scene trait.

  1. Click the Start Test button. While the test suite is performing the tests, you can see the devices and traits that are being tested.

Once the tests are complete, do one or both of the following tasks:

  • View the results in Google Sheets (sign-in is required).
  • To certify your smart home action, download the test results with the DOWNLOAD TEST RESULTS button. Then, click the GO TO SUBMISSION FORM to submit the test results to Google. Fill out all of the required fields and then click Submit.

Error messages

Possible error messages:

  • If you see this error: HomeGraph API has not been used in project <id> before or it is disabled. Make sure that you have enabled the HomeGraph API.