TC-PRICE-03
Functional
changes data Updating price between 00:00 and 02:00
Verify the exception to the time rule
! Documented discrepancy · errors.txt
The test requires certain time conditions that cannot be met, and there is no way to set the test current time. The test fails outside of the predefined hours.
Specification · xlsx
Steps
- Send the price during the 00:00–02:00 window
Expected result
HTTP 200; the price is updated immediately
Endpoints
PUT /product/api/v1/merchant-integration/product/bulk Run
- API_URL
https://api.qa2.ananastest.com- TARGET_ID
2555660
A dry run builds every request without sending it; responses come from a local stub.
Test code
mirrors tests/BulkTest.php::tc_price_03()
59// Verify the exception to the time rule
60public function tc_price_03(): void
61{
62 $timezone = new DateTimeZone('Europe/Belgrade');
63 $currentTime = new DateTimeImmutable('now', $timezone);
64
65 if ((int) $currentTime->format('G') >= 2) {
66 $this->fail('The request should be sent between 00:00 and 02:00');
67 }
68
69 $targetId = (int) $_ENV['TARGET_ID'];
70
71 $productData = [
72 [
73 'id' => $targetId,
74 'basePrice' => 123456,
75 ],
76 ];
77
78 $response = $this->ananas->editInBulk($productData);
79
80 $this->assertEquals(200, $response['statusCode']);
81 $this->assertEquals('SUCCESS', $response['response'][0]['status']);
82}
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.