TC-PROD-02
Functional
Pagination test
Verify that pagination works correctly
Specification · xlsx
Steps
- Call page=0
- Call page=1
Expected result
Different sets of products are returned
Endpoints
GET /product/api/v1/merchant-integration/products Run
- API_URL
https://api.qa2.ananastest.com
A dry run builds every request without sending it; responses come from a local stub.
Test code
mirrors tests/ProductsTest.php::tc_prod_02()
21// Verify that pagination works correctly
22public function tc_prod_02(): void
23{
24 $firstPageResponse = $this->ananas->getProducts(0, 1);
25 $this->assertEquals(200, $firstPageResponse['statusCode']);
26 $this->assertIsArray($firstPageResponse['response']);
27
28 $secondPageResponse = $this->ananas->getProducts(1, 1);
29 $this->assertEquals(200, $secondPageResponse['statusCode']);
30 $this->assertIsArray($secondPageResponse['response']);
31
32 $this->assertNotEquals($firstPageResponse['response'], $secondPageResponse['response']);
33}
web/app/Scenarios/ProductsScenarios.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.