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

Mixed request (valid and invalid data)

Verify system behavior when the request contains a combination of valid and invalid products

Specification · xlsx

Steps

  1. Send a batch request with one valid ID and price
  2. Include one product with an error in the same request (e.g. non-existent ID or negative price)

Expected result

HTTP 200; the system updates the valid products; invalid products are rejected and error information is returned

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_price_07()
126// Verify system behavior when the request contains
127// a combination of valid and invalid products
128public function tc_price_07(): void
129{
130 $targetId = (int) $_ENV['TARGET_ID'];
131
132 $productData = [
133 [
134 'id' => $targetId,
135 'basePrice' => 123456,
136 ],
137 [
138 'id' => 999999999999999999,
139 'basePrice' => 123456,
140 ],
141 ];
142
143 $response = $this->ananas->editInBulk($productData);
144
145 $this->assertEquals(200, $response['statusCode']);
146 $this->assertEquals('SUCCESS', $response['response'][0]['status']);
147 $this->assertEquals('FAIL', $response['response'][1]['status']);
148}

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.