Use Self Test to Validate Your Service

Self Test is an automated validation tool available in the Sonos developer portal. You can use it to test your SMAPI implementation against the full range of expected behaviors—including browse, search, ratings, authentication, radio stations, and SOAP compliance.

You can run the full test suite all at once, or target a single category to focus on a specific area of your integration.

Before You Begin

You need the following before running tests:

  • A Sonos Sandbox integration set up at developer.sonos.com (see Use Sandbox to test your service)
  • A valid OAuth token (and key) for your service if your service requires authentication Note: This information will only be used to make valid SMAPI requests during testing and will not be stored anywhere in our systems.

Configure Your Service

Before running tests, you need to provide your service credentials and connection details through the Self Test configuration parameters form in the developer portal.

  1. Log into you developer portal and navigate to your integration.
    1. Reminder: This must be an Sandbox application with a configuration that has been saved and submitted for a valid configuration ID.
  2. Select the Self Test tab.
  3. Fill in the Configuration Parameters form:
FieldDescription
Service Name (required)Name of your content service as displayed in the Sonos App
Account Tier(Optional) If supported by your service, the tier of the account being using for testing
KeyYour account key (OAuth only)
SecretYour account token (OAuth only)
  1. Optionally, you can fill in the Test Content section to provide known content IDs for your service. You can supply IDs for tracks, albums, artists, streams, playlists, stations, podcasts, and episodes.
    If you leave Test Content fields empty, the framework automatically populates them by running a search against your service before the tests begin. If your service does not support search, you need to provide at least a valid track, stream, station or episode ID manually.

Running Tests

Once your configuration parameters are filled, you can run the full suite or a single test category.

Run the Full Test Suite

Select "Run All Tests" to execute every applicable test suite against your service. Tests for features your service does not support are automatically skipped—for example, if ratings are not enabled for your service, the ratings suite is skipped rather than failed.

Run an Individual Test

To focus on a specific area:

  1. Select the Test Type drop down on the Self Test tab.
  2. Choose a test category from the list.
  3. Select "Run Single Test".

The available test categories are:

CategoryWhat it validates
AuthenticationToken validation, session handling, and auth error responses
BrowseContainer structure, pagination, and metadata correctness
SearchSearch facets (tracks, albums, artists, playlists, and more) and result formatting
RatingsrateItem calls, supported rating types, and response correctness
Rest BrowseREST browse actions for the root of your service
Mime TypeItem mime type validation to validate our players will not have issues attempting to initiate playback
Item TypeItem type validation to validate our players will not have issues attempting to initiate playback
SOAP ComplianceHTTP status codes, envelope structure, and fault handling

Reviewing Test Results

Results appear in the portal on the Test Results tab once the test run completes. Each test shows one of the following outcomes:

  • Passed — the behavior is correct and meets the expected contract
  • Failed — the response did not meet requirements; the result includes a message describing what went wrong and a link to the relevant Sonos documentation
  • Not Applicable — the capability is not enabled for your service or the content it provides so it has been skipped. A skipped result is not a failure. It means the test was not applicable to your service configuration. If you see an unexpected skip, verify that the capability in question is correctly enabled for your integration or provided specific IDs for the relevant content.