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

Multiple updates during the day

Verify that quantity can be updated multiple times per day while respecting the 15-minute rule

! Documented discrepancy · errors.txt

The 15 minute rule is impossible to test in the automated testing environment.

Specification · xlsx

Steps

  1. Send a quantity
  2. After 15+ minutes, send a new quantity

Expected result

HTTP 200; quantity is updated both times

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_03()
186// Verify that quantity can be updated multiple times per day while respecting the 15-minute rule
187public function tc_stock_03(): void
188{
189 $targetId = (int) $_ENV['TARGET_ID'];
190
191 $productDataOne = [
192 [
193 'id' => $targetId,
194 'stockLevel' => 15,
195 ],
196 ];
197
198 $response = $this->ananas->editInBulk($productDataOne);
199
200 $this->assertEquals(200, $response['statusCode']);
201 $this->assertEquals('SUCCESS', $response['response'][0]['status']);
202
203 sleep(1); // Should be 15 minutes
204
205 $productDataTwo = [
206 [
207 'id' => $targetId,
208 'stockLevel' => 30,
209 ],
210 ];
211
212 $response = $this->ananas->editInBulk($productDataTwo);
213
214 $this->assertEquals(200, $response['statusCode']);
215 $this->assertEquals('SUCCESS', $response['response'][0]['status']);
216}

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.