mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 00:56:16 +00:00
Cleanup .http client tests
This commit is contained in:
@@ -0,0 +1 @@
|
||||
data/
|
||||
@@ -22,7 +22,6 @@ Content-Type: application/vnd.bose.customer-v1.0+xml
|
||||
if (client.variables.environment.get("accountId")) {
|
||||
client.assert(accountId === client.variables.environment.get("accountId"), "Account ID "+accountId+" should match environment variable if provided");
|
||||
}
|
||||
client.global.set("newAccountId", accountId);
|
||||
});
|
||||
%}
|
||||
|
||||
@@ -40,6 +39,5 @@ Content-Type: application/vnd.bose.streaming-v1.2+xml
|
||||
client.test("Login successful", function() {
|
||||
client.assert(response.status === 200, "Response status is not 200");
|
||||
client.assert(response.headers.valueOf("Credentials") !== null, "Credentials header missing");
|
||||
client.global.set("authToken", response.headers.valueOf("Credentials"));
|
||||
});
|
||||
%}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
### GET /streaming/account/{{newAccountId}}/full
|
||||
GET {{host}}/streaming/account/{{newAccountId}}/full
|
||||
### GET /streaming/account/{{accountId}}/full
|
||||
GET {{host}}/streaming/account/{{accountId}}/full
|
||||
Host: streaming.bose.com
|
||||
Authorization: Bearer {{authToken}}
|
||||
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
|
||||
@@ -13,7 +13,7 @@ Accept: application/vnd.bose.streaming-v1.2+xml
|
||||
});
|
||||
|
||||
client.test("Response body contains <account>", function() {
|
||||
const expectedAccountId = client.global.get("newAccountId") || client.variables.environment.get("accountId");
|
||||
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>");
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
### GET /streaming/account/{{newAccountId}}/device/{{deviceId}}/group/
|
||||
GET {{host}}/streaming/account/{{newAccountId}}/device/{{deviceId}}/group/
|
||||
### 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
|
||||
Authorization: Bearer {{authToken}}
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
> {%
|
||||
client.test("Request executed successfully", function() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
### GET /streaming/account/{{newAccountId}}/provider_settings
|
||||
GET {{host}}/streaming/account/{{newAccountId}}/provider_settings
|
||||
### 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 {{authToken}}
|
||||
Authorization: Bearer {{token}}
|
||||
Content-Type: application/vnd.bose.streaming-v1.2+xml
|
||||
User-Agent: Bose_Lisa/27.0.6
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ 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 {{authToken}}
|
||||
Authorization: Bearer {{token}}
|
||||
Content-Type: application/vnd.bose.streaming-v1.2+xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" ?><device-data><device id="{{deviceId}}"><serialnumber>{{serialNumber}}</serialnumber><firmware-version>27.0.6.46330.5043500 epdbuild.trunk.hepdswbld04.2022-08-04T11:20:29</firmware-version><product product_code="{{productCode}}" type="5"><serialnumber>{{productSerialNumber}}</serialnumber></product></device><diagnostic-data><device-landscape><rssi>Excellent</rssi><gateway-ip-address>{{gatewayIp}}</gateway-ip-address><macaddresses><macaddress>{{macAddress1}}</macaddress><macaddress>{{macAddress2}}</macaddress></macaddresses><ip-address>{{deviceIp}}</ip-address><network-connection-type>Wireless</network-connection-type></device-landscape><network-landscape><network-data xmlns="http://www.Bose.com/Schemas/2012-12/NetworkMonitor/" /></network-landscape></diagnostic-data></device-data>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
### POST /{{newAccountId}}/devices (Register Device)
|
||||
POST {{host}}/accounts/{{newAccountId}}/devices
|
||||
### POST /{{accountId}}/devices (Register Device)
|
||||
POST {{host}}/accounts/{{accountId}}/devices
|
||||
Content-Type: application/vnd.bose.streaming-v1.2+xml
|
||||
Authorization: Bearer {{authToken}}
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<device deviceid="{{deviceId}}">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
### DELETE /{{newAccountId}}/devices/{{deviceId}} (Unregister Device)
|
||||
DELETE {{host}}/accounts/{{newAccountId}}/devices/{{deviceId}}
|
||||
Authorization: Bearer {{authToken}}
|
||||
### DELETE /{{accountId}}/devices/{{deviceId}} (Unregister Device)
|
||||
DELETE {{host}}/accounts/{{accountId}}/devices/{{deviceId}}
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
> {%
|
||||
client.test("Device unregistered successfully", function() {
|
||||
|
||||
Reference in New Issue
Block a user