68 lines
2.5 KiB
Plaintext
68 lines
2.5 KiB
Plaintext
meta {
|
|
name: GET quest progress after operator chain complete
|
|
type: http
|
|
seq: 12
|
|
}
|
|
|
|
docs {
|
|
NEO-140: complete operator chain via HTTP quest flow, GET quest-progress asserts completionRewardSummary.reputationGrants (+15 Grid Operators).
|
|
Pre-request runs operator-chain-quest-flow-helper (gather/combat/refine intros + chain steps).
|
|
}
|
|
|
|
script:pre-request {
|
|
const { completeOperatorChainQuestFlow, CHAIN_QUEST_ID } = require("./scripts/operator-chain-quest-flow-helper");
|
|
await completeOperatorChainQuestFlow(bru);
|
|
|
|
const axios = require("axios");
|
|
const baseUrl = bru.getEnvVar("baseUrl") || bru.getVar("baseUrl");
|
|
const playerId = bru.getEnvVar("playerId") || bru.getVar("playerId");
|
|
const response = await axios.get(
|
|
`${baseUrl}/game/players/${playerId}/quest-progress`,
|
|
{ validateStatus: () => true },
|
|
);
|
|
if (response.status !== 200) {
|
|
throw new Error(`quest-progress GET failed: ${response.status}`);
|
|
}
|
|
const row = response.data.quests.find((x) => x.questId === CHAIN_QUEST_ID);
|
|
if (!row || row.status !== "completed" || !row.completionRewardSummary) {
|
|
throw new Error(`expected operator chain completed with summary, got ${JSON.stringify(row)}`);
|
|
}
|
|
bru.setVar(
|
|
"firstOperatorChainCompletionRewardSummary",
|
|
JSON.stringify(row.completionRewardSummary),
|
|
);
|
|
}
|
|
|
|
get {
|
|
url: {{baseUrl}}/game/players/{{playerId}}/quest-progress
|
|
body: none
|
|
auth: none
|
|
}
|
|
|
|
tests {
|
|
test("operator chain row is completed with reputationGrants in completionRewardSummary", function () {
|
|
expect(res.getStatus()).to.equal(200);
|
|
const body = res.getBody();
|
|
const row = body.quests.find((x) => x.questId === "prototype_quest_operator_chain");
|
|
expect(row).to.be.an("object");
|
|
expect(row.status).to.equal("completed");
|
|
expect(row.completionRewardSummary).to.be.an("object");
|
|
expect(row.completionRewardSummary.itemGrants).to.eql([
|
|
{ itemId: "survey_drone_kit", quantity: 1 },
|
|
]);
|
|
expect(row.completionRewardSummary.skillXpGrants).to.eql([
|
|
{ skillId: "salvage", amount: 50 },
|
|
]);
|
|
expect(row.completionRewardSummary.reputationGrants).to.eql([
|
|
{ factionId: "prototype_faction_grid_operators", amount: 15 },
|
|
]);
|
|
});
|
|
|
|
test("second GET completionRewardSummary matches first GET", function () {
|
|
const body = res.getBody();
|
|
const row = body.quests.find((x) => x.questId === "prototype_quest_operator_chain");
|
|
const firstSummary = JSON.parse(bru.getVar("firstOperatorChainCompletionRewardSummary"));
|
|
expect(row.completionRewardSummary).to.eql(firstSummary);
|
|
});
|
|
}
|