Make the get_full_account test more comprehensive (#171)

https://github.com/gesellix/Bose-SoundTouch/issues/135
This commit is contained in:
Tobias Gesellchen
2026-04-17 23:15:52 +02:00
committed by GitHub
parent aa5a25b382
commit 9704e2d8ac
10 changed files with 37 additions and 21 deletions
@@ -1,6 +1,5 @@
### POST /streaming/support/customersupport
POST {{host}}/streaming/support/customersupport
Host: streaming.bose.com
Content-Type: application/vnd.bose.streaming-v1.2+xml
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
@@ -1,6 +1,5 @@
### DELETE /streaming/account/{{accountId}}/device/{{deviceId}}/preset/6
DELETE {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/preset/6
Host: streaming.bose.com
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}
Content-Type: application/vnd.bose.streaming-v1.2+xml
@@ -1,22 +1,50 @@
### GET /streaming/account/{{accountId}}/full
GET {{host}}/streaming/account/{{accountId}}/full
Host: streaming.bose.com
Authorization: Bearer {{token}}
Content-Type: application/vnd.bose.streaming-v1.2+xml
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
client.assert(response.contentType.mimeType === "application/vnd.bose.streaming-v1.2+xml", "Expected 'application/vnd.bose.streaming-v1.2+xml' but received '" + response.contentType.mimeType + "'");
});
client.test("Response body contains <account>", function() {
const expectedAccountId = client.variables.environment.get("accountId");
const doc = response.body;
const account = doc.getElementsByTagName("account")[0];
client.assert(account !== undefined, "Response body does not contain <account>");
client.test("Response content-type is correct", function() {
var type = response.contentType.mimeType;
client.assert(type === "application/vnd.bose.streaming-v1.2+xml", "Expected 'application/vnd.bose.streaming-v1.2+xml' but received '" + type + "'");
});
client.test("Response body structure", function() {
var account = response.body.getElementsByTagName("account")[0];
client.assert(account !== null, "Missing 'account' root element");
// We use accountId from environment variables
var expectedAccountId = client.variables.environment.get("accountId");
client.assert(account.getAttribute("id") === expectedAccountId, "Expected account id '" + expectedAccountId + "' but received '" + account.getAttribute("id") + "'");
var accountStatus = account.getElementsByTagName("accountStatus")[0];
client.assert(accountStatus.textContent === "OK", "Account status is not OK");
var devices = account.getElementsByTagName("devices")[0];
client.assert(devices !== null, "Missing 'devices' element");
var deviceList = devices.getElementsByTagName("device");
client.assert(deviceList.length > 0, "No 'device' elements found");
var firstDevice = deviceList[0];
client.assert(firstDevice.getAttribute("deviceid").length > 0, "Missing deviceid attribute");
var attachedProduct = firstDevice.getElementsByTagName("attachedProduct")[0];
client.assert(attachedProduct !== null, "Missing 'attachedProduct'");
client.assert(attachedProduct.getAttribute("product_code").length > 0, "Missing product_code");
var presets = firstDevice.getElementsByTagName("presets")[0];
client.assert(presets !== undefined, "Missing 'presets' element");
var recents = firstDevice.getElementsByTagName("recents")[0];
client.assert(recents !== undefined, "Missing 'recents' element");
var sources = account.getElementsByTagName("sources")[0];
client.assert(sources !== null, "Missing 'sources' element");
client.assert(sources.getElementsByTagName("source").length > 0, "No 'source' elements found in account sources");
});
%}
@@ -1,6 +1,5 @@
### GET /streaming/account/{{accountId}}/device/{{deviceId}}/group/
GET {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/group/
Host: streaming.bose.com
Content-Type: application/vnd.bose.streaming-v1.2+xml
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
@@ -1,6 +1,5 @@
### GET /streaming/account/{{accountId}}/device/{{deviceId}}/presets
GET {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/presets
Host: streaming.bose.com
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}
Content-Type: application/vnd.bose.streaming-v1.2+xml
@@ -1,6 +1,5 @@
### GET /streaming/account/{{accountId}}/provider_settings
GET {{host}}/streaming/account/{{accountId}}/provider_settings
Host: streaming.bose.com
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}
Content-Type: application/vnd.bose.streaming-v1.2+xml
@@ -1,6 +1,5 @@
### POST /streaming/support/power_on
POST {{host}}/streaming/support/power_on
Host: streaming.bose.com
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}
@@ -1,6 +1,5 @@
### POST /streaming/account/{{accountId}}/source (Cloud Source Registration)
POST {{host}}/streaming/account/{{accountId}}/source
Host: streaming.bose.com
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.1+xml
Authorization: Bearer {{token}}
@@ -25,7 +24,6 @@ Content-Type: application/vnd.bose.streaming-v1.1+xml
### PUT /streaming/account/{{accountId}}/device/{{deviceId}}/preset/5
PUT {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/preset/5
Host: streaming.bose.com
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}
@@ -1,6 +1,5 @@
### PUT /streaming/account/{{accountId}}/device/{{deviceId}}/preset/6
PUT {{host}}/streaming/account/{{accountId}}/device/{{deviceId}}/preset/6
Host: streaming.bose.com
User-Agent: Bose_Lisa/27.0.6
Accept: application/vnd.bose.streaming-v1.2+xml
Authorization: Bearer {{token}}
@@ -1,6 +1,5 @@
### GET /bmx/tunein/v1/playback/station/_station_
GET {{host}}/bmx/tunein/v1/playback/station/_station_
Host: content.api.bose.io
Accept: */*
Accept-Language: en
X-Bmx-Api-Key: bmx-api-key-dummy
@@ -20,7 +19,6 @@ User-Agent: Bose_Lisa/27.0.6
### POST /bmx/tunein/v1/token
POST {{host}}/bmx/tunein/v1/token
Host: content.api.bose.io
User-Agent: Bose_Lisa/27.0.6
Accept: */*
Accept-Language: en
@@ -45,7 +43,6 @@ Content-Type: application/json
### GET /bmx/tunein/v1/playback/station/_station_ (Authorized)
GET {{host}}/bmx/tunein/v1/playback/station/_station_
Host: content.api.bose.io
User-Agent: Bose_Lisa/27.0.6
Accept: */*
Accept-Language: en