neon-sprawl/bruno/neon-sprawl-server/ability-cast/Post target select alpha be...

42 lines
937 B
Plaintext

meta {
name: POST target select alpha (cast preset)
type: http
seq: 21
}
script:pre-request {
const axios = require("axios");
const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl");
const playerId = bru.getEnvVar("playerId") || bru.getVar("playerId");
await axios.post(
`${baseUrl}/game/players/${playerId}/move`,
{
schemaVersion: 1,
target: { x: -5, y: 0.9, z: -5 },
},
{ headers: { "Content-Type": "application/json" } },
);
}
post {
url: {{baseUrl}}/game/players/dev-local-1/target/select
body: json
auth: none
}
body:json {
{
"schemaVersion": 1,
"targetId": "prototype_target_alpha"
}
}
tests {
test("status 200 lock applied", function () {
expect(res.getStatus()).to.equal(200);
const body = res.getBody();
expect(body.selectionApplied).to.equal(true);
expect(body.targetState.lockedTargetId).to.equal("prototype_target_alpha");
});
}