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.
- Log into you developer portal and navigate to your integration.
- Reminder: This must be an Sandbox application with a configuration that has been saved and submitted for a valid configuration ID.
- Select the Self Test tab.
- Fill in the Configuration Parameters form:
| Field | Description |
|---|---|
| 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 |
| Key | Your account key (OAuth only) |
| Secret | Your account token (OAuth only) |
- 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:
- Select the Test Type drop down on the Self Test tab.
- Choose a test category from the list.
- Select "Run Single Test".
The available test categories are:
| Category | What it validates |
|---|---|
| Authentication | Token validation, session handling, and auth error responses |
| Browse | Container structure, pagination, and metadata correctness |
| Search | Search facets (tracks, albums, artists, playlists, and more) and result formatting |
| Ratings | rateItem calls, supported rating types, and response correctness |
| Rest Browse | REST browse actions for the root of your service |
| Mime Type | Item mime type validation to validate our players will not have issues attempting to initiate playback |
| Item Type | Item type validation to validate our players will not have issues attempting to initiate playback |
| SOAP Compliance | HTTP 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.
Updated about 22 hours ago
