Ananas APItest bench
staging api.qa2.ananastest.com
TC-STOCK-07 Functional changes data

Mixed request (valid and invalid IDs)

Verify partial processing of the batch request

Specification · xlsx

Steps

  1. Send one valid ID and one invalid ID in the same request

Expected result

The valid product is updated; the invalid one is rejected

Endpoints

PUT /product/api/v1/merchant-integration/product/bulk

Run

API_URL
https://api.qa2.ananastest.com
TARGET_ID
2555660

Change parameters

A dry run builds every request without sending it; responses come from a local stub.

Test code

mirrors tests/BulkTest.php::tc_stock_07()
260// Verify partial processing of the batch request
261public function tc_stock_07(): void
262{
263 $targetId = (int) $_ENV['TARGET_ID'];
264
265 $productData = [
266 [
267 'id' => $targetId,
268 'stockLevel' => 123,
269 ],
270 [
271 'id' => 999999999999999999,
272 'stockLevel' => 123,
273 ],
274 ];
275
276 $response = $this->ananas->editInBulk($productData);
277
278 $this->assertEquals(200, $response['statusCode']);
279 $this->assertEquals('SUCCESS', $response['response'][0]['status']);
280 $this->assertEquals('FAIL', $response['response'][1]['status']);
281}

web/app/Scenarios/BulkScenarios.php · line numbers refer to this file

Not run yet. Run it against the API, or do a dry run to see the requests it would send.