Ananas APItest bench
staging api.qa2.ananastest.com
TC-DISC-15 Negative Boundary changes data

Exceeding the limit of 500 products

Verify the technical limit

! Documented discrepancy · errors.txt

All tests in this section: The discount tests are tricky because they involve persistent changes to the real data. To mitigate this problem and automate the tests, every discount is cancelled after the test. The ongoing promotion cannot be cancelled, and therefore have to be reused for these tests.

Specification · xlsx

Steps

  1. Send >500 products

Expected result

The system rejects the request

Endpoints

POST · PUT · GET /payment/api/v1/merchant-integration/discountsPUT /payment/api/v1/merchant-integration/discounts/{id}/cancellations

Run

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

Change parameters

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

Test code

mirrors tests/DiscountsTest.php::tc_disc_15()
475// Verify the technical limit
476public function tc_disc_15(): void
477{
478 $data = [];
479
480 for ($i = 1; $i < 600; $i++) {
481 $data[] = [
482 'merchantInventoryId' => $i,
483 'discountPrice' => $i,
484 'discountPriceCurrency' => 'RSD',
485 'dateFrom' => Carbon::now()->addDays(110)->format('d/m/Y'),
486 'dateTo' => Carbon::now()->addDays(111)->format('d/m/Y'),
487 'discountType' => 'SALE',
488 ];
489 }
490
491 $response = $this->ananas->setDiscounts(['discounts' => $data]);
492
493 $this->assertEquals(500, $response['statusCode']);
494}

web/app/Scenarios/DiscountsScenarios.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.