diff --git a/.circleci/config.yml b/.circleci/config.yml index aa89477fd..44677ea61 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -227,7 +227,7 @@ jobs: export CALLBACK_URL="https://$NGROK_PUBLIC_URL" echo -n "Public url ." echo $CALLBACK_URL - ./gradlew test -Dcucumber.filter.tags="@gov" + ./gradlew test -Dcucumber.filter.tags="@Bulk" echo -n "Test execution is completed, kill ngrok" pkill ngrok - store_test_results: diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java index 5b6296d53..2e02ac41b 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/BatchApiStepDef.java @@ -128,7 +128,7 @@ public void setProgramId(String programId) { @When("I call the batch summary API with expected status of {int} with total {int} txns") public void callBatchSummaryAPI(int expectedStatus, int totalTxns) { - await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> { + await().atMost(100, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> { RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); if (authEnabled) { requestSpec.header("Authorization", "Bearer " + scenarioScopeState.accessToken); @@ -212,7 +212,7 @@ public void checkIfCreatedAtIsNotNull(String status) { @When("I call the batch details API with expected status of {int} with total {int} txns") public void callBatchDetailsAPI(int expectedStatus, int totalTxns) { - await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> { + await().atMost(100, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> { RequestSpecification requestSpec = Utils.getDefaultSpec(scenarioScopeState.tenant); if (authEnabled) { requestSpec.header("Authorization", "Bearer " + scenarioScopeState.accessToken); @@ -364,7 +364,10 @@ public void iFetchBatchIDFromBatchTransactionAPISResponse() { @Then("I check for result file URL validity") public void iCheckForResultFileURLValidity() { - assertThat(isValidURL(scenarioScopeState.batchAndSubBatchSummaryResponse.getFile())).isTrue(); + await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> { + logger.info("batch summary file response is : {}", scenarioScopeState.batchAndSubBatchSummaryResponse.getFile()); + assertThat(isValidURL(scenarioScopeState.batchAndSubBatchSummaryResponse.getFile())).isTrue(); + }); } boolean isValidURL(String url) { @@ -603,16 +606,19 @@ public void iCallTheBatchSummaryAPIForSubBatchSummaryWithExpectedStatusOf(int ex @Then("I am able to parse sub batch summary response") public void iAmAbleToParseSubBatchSummaryResponse() { - scenarioScopeState.batchAndSubBatchSummaryResponse = null; - assertThat(scenarioScopeState.response).isNotNull(); - assertThat(scenarioScopeState.response).isNotEmpty(); - try { - scenarioScopeState.batchAndSubBatchSummaryResponse = objectMapper.readValue(scenarioScopeState.response, - BatchAndSubBatchSummaryResponse.class); - } catch (Exception e) { - logger.error("Error parsing the batch summary response", e); - } - assertThat(scenarioScopeState.batchAndSubBatchSummaryResponse).isNotNull(); + await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> { + scenarioScopeState.batchAndSubBatchSummaryResponse = null; + assertThat(scenarioScopeState.response).isNotNull(); + assertThat(scenarioScopeState.response).isNotEmpty(); + try { + scenarioScopeState.batchAndSubBatchSummaryResponse = objectMapper.readValue(scenarioScopeState.response, + BatchAndSubBatchSummaryResponse.class); + } catch (Exception e) { + logger.error("Error parsing the batch summary response", e); + } + assertThat(scenarioScopeState.batchAndSubBatchSummaryResponse).isNotNull(); + assertThat(scenarioScopeState.batchAndSubBatchSummaryResponse.getFile()).isNotNull(); + }); } @And("I call the sub batch summary API for sub batch summary with expected status of {int} and total count {int}") diff --git a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/VoucherManagementStepDef.java b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/VoucherManagementStepDef.java index 539d5cbb1..491f148de 100644 --- a/src/test/java/org/mifos/integrationtest/cucumber/stepdef/VoucherManagementStepDef.java +++ b/src/test/java/org/mifos/integrationtest/cucumber/stepdef/VoucherManagementStepDef.java @@ -396,9 +396,11 @@ public void redeemVoucherFailureUsingAnnotation() { @Then("I check for redeem voucher failure") public void redeemVoucherFailure() { - iCanCreateAnRedeemVoucherRequestDTOForVoucherRedemption(); - iCallTheRedeemVoucherAPIWithExpectedStatusOf(200); - assertUnsuccessfulRedemption(); + await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> { + iCanCreateAnRedeemVoucherRequestDTOForVoucherRedemption(); + iCallTheRedeemVoucherAPIWithExpectedStatusOf(200); + assertUnsuccessfulRedemption(); + }); } @After("@redeemVoucherSuccess") diff --git a/src/test/java/resources/authentication.feature b/src/test/java/resources/authentication.feature index 31144749e..632a56f67 100644 --- a/src/test/java/resources/authentication.feature +++ b/src/test/java/resources/authentication.feature @@ -2,7 +2,7 @@ Feature: Authentication test for services routed through kong & keycloak @keycloak-user-setup @keycloak-user-teardown @kong-teardown - Scenario: Unauthorized channel-connector test + Scenario: CCT-001 Unauthorized channel-connector test Given I have tenant as "paymentBB2" And I can mock TransactionChannelRequestDTO And I register channel service using config @@ -12,7 +12,7 @@ Feature: Authentication test for services routed through kong & keycloak Then I should get non empty response @keycloak-user-setup @keycloak-user-teardown @kong-teardown - Scenario: Authorized channel-connector test + Scenario: CCT-002 Authorized channel-connector test Given I have tenant as "paymentBB2" And I can mock TransactionChannelRequestDTO And I register channel service using config diff --git a/src/test/java/resources/batch.feature b/src/test/java/resources/batch.feature index 7405897c2..a72979345 100644 --- a/src/test/java/resources/batch.feature +++ b/src/test/java/resources/batch.feature @@ -1,3 +1,4 @@ +@Bulk Feature: Batch Details API test @gov @batch-teardown @@ -295,7 +296,7 @@ Feature: Batch Details API test When I make the "POST" request to "/callback" endpoint with expected status of 200 Then I should be able to extract response body from callback for batch And I can stop mock server - @gov @batch-teardown + @gov @batch-teardown @Bulk Scenario: BD-019 Batch summary response result file URL Test Given I have the demo csv file "ph-ee-bulk-demo-6.csv" And I have tenant as "paymentBB2" diff --git a/src/test/java/resources/billPay.feature b/src/test/java/resources/billPay.feature index a28c4898b..ef78f8fb7 100644 --- a/src/test/java/resources/billPay.feature +++ b/src/test/java/resources/billPay.feature @@ -362,7 +362,7 @@ Feature: Bill Payment P2G Test And I can call the biller RTP status API with expected status of 200 until I get the rtpStatus as "ACCEPTED" @gov - Scenario: Unsupported header validation for Bill Payments API + Scenario: BP-006 Unsupported header validation for Bill Payments API Given I have tenant as "paymentBB2" And I generate clientCorrelationId And I have bill id as "001" diff --git a/src/test/java/resources/bulkPayment.feature b/src/test/java/resources/bulkPayment.feature index e137bb633..4bc47a63b 100644 --- a/src/test/java/resources/bulkPayment.feature +++ b/src/test/java/resources/bulkPayment.feature @@ -1,7 +1,7 @@ @gov @ext Feature: Test ability to make payment to individual with bank account - Scenario: Input CSV file using the batch transaction API and poll batch summary API till we get completed status + Scenario: BT-002 Input CSV file using the batch transaction API and poll batch summary API till we get completed status Given I have tenant as "paymentbb1" And I have the demo csv file "bulk_payment.csv" And I create a list of payee identifiers from csv file @@ -25,7 +25,7 @@ Feature: Test ability to make payment to individual with bank account And Status of transaction is "COMPLETED" And I should have matching total txn count and successful txn count in response - Scenario: Bulk Transfer with ClosedLoop and Mojaloop + Scenario: BT-002 Bulk Transfer with ClosedLoop and Mojaloop Given I have tenant as "paymentbb2" And I have the demo csv file "bulk_payment_closedl_mock_mojaloop.csv" And I create a list of payee identifiers from csv file @@ -49,7 +49,7 @@ Feature: Test ability to make payment to individual with bank account And Status of transaction is "COMPLETED" And My total txns 8 and successful txn count in response should Match - Scenario: Bulk Transfer with ClosedLoop and GSMA + Scenario: BT-001 Bulk Transfer with ClosedLoop and GSMA #payer 1 creation Given I have Fineract-Platform-TenantId as "payerfsp2" And I initialize the payee list diff --git a/src/test/java/resources/identityMapperTest.feature b/src/test/java/resources/identityMapperTest.feature index 553102ad4..88166d65b 100644 --- a/src/test/java/resources/identityMapperTest.feature +++ b/src/test/java/resources/identityMapperTest.feature @@ -101,7 +101,7 @@ Feature: Identity Account Mapper Api Test # Then I will sleep for 3000 millisecond Then I should be able to verify that the "PUT" method to "/updateBeneficiaryApiTest" endpoint received a request with required parameter in body @gov - Scenario: Update a single beneficiary with Banking Institution Code + Scenario: UB-001 Update a single beneficiary with Banking Institution Code When I create an IdentityMapperDTO for 1 Register Beneficiary with payment modality as "ACCOUNT_ID" When I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiaryApiTest" When I create an IdentityMapperDTO for 1 update Beneficiary with banking institution code as "lion" @@ -228,14 +228,14 @@ Feature: Identity Account Mapper Api Test And I should be able to verify that the "PUT" method to "/accountLookupTest" endpoint received a request with validation @gov - Scenario: Fetch Beneficiaries API Test + Scenario: FB-001 Fetch Beneficiaries API Test Given I create an IdentityMapperDTO for Register Beneficiary When I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiaryApiTest" # And I will sleep for 3000 millisecond Then I will call the fetch beneficiary API with expected status of 200 And I will assert the fields from fetch beneficiary response @gov @ext - Scenario: Batch Account Lookup Integration Test + Scenario: BAL-001 Batch Account Lookup Integration Test Given I create an IdentityMapperDTO for Register Beneficiary from csv file When I call the register beneficiary API with expected status of 202 and stub "/registerBeneficiaryApiTest" # And I will sleep for 3000 millisecond diff --git a/src/test/java/resources/mockFlowTest.feature b/src/test/java/resources/mockFlowTest.feature index 9998abd75..1412b17ac 100644 --- a/src/test/java/resources/mockFlowTest.feature +++ b/src/test/java/resources/mockFlowTest.feature @@ -2,7 +2,7 @@ Feature: Mock Flow Test @ext - Scenario: Test for minimal mock fund transfer account lookup flow + Scenario: MFT-003 Test for minimal mock fund transfer account lookup flow Given I have Fineract-Platform-TenantId as "payeefsp1" When I call the create payer client endpoint Then I call the create savings product endpoint diff --git a/src/test/java/resources/mojaloop.feature b/src/test/java/resources/mojaloop.feature index 3cae45cf8..09ba02b53 100644 --- a/src/test/java/resources/mojaloop.feature +++ b/src/test/java/resources/mojaloop.feature @@ -1,7 +1,7 @@ @gov @ext Feature: Mojaloop test - Scenario: ML connector partial payee party lookup test + Scenario: MLT-001 ML connector partial payee party lookup test Given I am setting up Mojaloop Given I have Fineract-Platform-TenantId for "payee" When I call the create client endpoint for "payee" @@ -18,7 +18,7 @@ Feature: Mojaloop test Then I should be able to verify the callback for lookup Then I can stop mock server - Scenario: ML connector partial payee quotation test + Scenario: MLT-002 ML connector partial payee quotation test Given I am setting up Mojaloop Given I have Fineract-Platform-TenantId for "payee" When I call the create client endpoint for "payee" @@ -35,7 +35,7 @@ Feature: Mojaloop test Then I should be able to verify the callback for quotation Then I can stop mock server - Scenario: ML connector partial payee transfer test + Scenario: MLT-003 ML connector partial payee transfer test Given I am setting up Mojaloop Given I have Fineract-Platform-TenantId for "payee" When I call the create client endpoint for "payee" @@ -56,7 +56,7 @@ Feature: Mojaloop test Then I should be able to verify the callback for transfer Then I can stop mock server - Scenario: Payer Fund Transfer Flow test + Scenario: PFT-001 Payer Fund Transfer Flow test Given I am setting up Mojaloop Given I have Fineract-Platform-TenantId for "payer" When I call the create client endpoint for "payer" @@ -101,7 +101,7 @@ Feature: Mojaloop test Then I assert "payer" balance to be 11 Then I assert "payee" balance to be 11 - Scenario: Bulk Transfer with Mojaloop + Scenario: BTM-001 Bulk Transfer with Mojaloop Given I am setting up Mojaloop When I create and setup a "payer" with account balance of 12 When I create and setup a "payee" with account balance of 10 diff --git a/src/test/java/resources/operationsBatch.feature b/src/test/java/resources/operationsBatch.feature index a9d5b9b8b..97b284cbe 100644 --- a/src/test/java/resources/operationsBatch.feature +++ b/src/test/java/resources/operationsBatch.feature @@ -2,7 +2,7 @@ Feature: Operations APP related feature @gov @ops-batch-setup @ops-batch-teardown - Scenario: Batches API no filter test + Scenario: OBA-001 Batches API no filter test Given I have tenant as "paymentBB2" When I call the operations-app auth endpoint with username: "mifos" and password: "password" Then I should get a valid token @@ -11,7 +11,7 @@ Feature: Operations APP related feature And I am able to parse batch paginated response into DTO @gov @ext @ops-batch-setup @ops-batch-teardown - Scenario: Batches API batchId filter test + Scenario: OBA-002 Batches API batchId filter test Given I have tenant as "paymentBB2" And I have the demo csv file "payerIdentifier-resolution-using-budgetAccount.csv" And I have the registeringInstituteId "123" @@ -37,7 +37,7 @@ Feature: Operations APP related feature # assert single batch is returned # set offset to 1 and limit to 1 @gov @ops-batch-setup @ops-batch-teardown - Scenario: Batches API pagination test + Scenario: OBA-003 Batches API pagination test # Batch 1 call Given I have tenant as "paymentBB2" And I have the demo csv file "payerIdentifier-resolution-using-budgetAccount.csv" @@ -76,7 +76,7 @@ Feature: Operations APP related feature # calculate endTime # query using startTime and endTime ->> then I should get 5 txn @gov @ext @ops-batch-setup @ops-batch-teardown - Scenario: Batches API date filter test + Scenario: OBA-004 Batches API date filter test # Given I will sleep for 5000 millisecond And I have tenant as "paymentBB2" And I store this time as start time diff --git a/src/test/java/resources/voucherManagementTest.feature b/src/test/java/resources/voucherManagementTest.feature index 2921cd332..6303c91ee 100644 --- a/src/test/java/resources/voucherManagementTest.feature +++ b/src/test/java/resources/voucherManagementTest.feature @@ -2,7 +2,7 @@ Feature: Voucher Management Api Test @gov - Scenario: Create Voucher Api Test + Scenario: VCR-001 Create Voucher Api Test When I can inject MockServer Then I can start mock server And I can register the stub with "/createVoucher" endpoint for "PUT" request with status of 200 @@ -11,7 +11,7 @@ Feature: Voucher Management Api Test Then I should be able to extract response body from callback @gov @createVoucher - Scenario: Activate Voucher Api Test + Scenario: VA-001 Activate Voucher Api Test Given I can create a voucher Given I can create an VoucherRequestDTO for voucher activation And I can register the stub with "/activateVoucher" endpoint for "PUT" request with status of 200 @@ -19,11 +19,11 @@ Feature: Voucher Management Api Test Then I should be able to assert response body from callback on "/activateVoucher" @gov @createAndActivateVoucher - Scenario: Redeem Voucher API Test + Scenario: VR-001 Redeem Voucher API Test Then I check for redeem voucher success @gov @createAndActivateVoucher - Scenario: Reactivate Voucher Api Test + Scenario: VRE-001 Reactivate Voucher Api Test Given I can create an VoucherRequestDTO for voucher suspension And I can register the stub with "/suspendVoucher" endpoint for "PUT" request with status of 200 When I call the suspend voucher API with expected status of 202 and stub "/suspendVoucher" @@ -33,7 +33,7 @@ Feature: Voucher Management Api Test Then I check for redeem voucher success @gov @createAndActivateVoucher - Scenario: Validity Check Voucher Api Test + Scenario: VVA-001 Validity Check Voucher Api Test When I can register the stub with "/validity" endpoint for "PUT" request with status of 200 And I call the validity check API with expected status of 202 and stub "/validity" Then I can extract result from validation callback and assert if validation is successful on "/validity" @@ -53,7 +53,7 @@ Feature: Voucher Management Api Test Then I check for redeem voucher failure @gov @createAndActivateVoucher - Scenario: Fetch Voucher Api Test + Scenario: VF-001 Fetch Voucher Api Test Then I will call the fetch voucher API with expected status of 200 And I will assert the fields from fetch voucher response And I can stop mock server @@ -78,18 +78,18 @@ Feature: Voucher Management Api Test Then I check for redeem voucher failure @gov - Scenario: Unsupported Parameter Validation for Create Voucher API test + Scenario: VCR-002 Unsupported Parameter Validation for Create Voucher API test Given I can create an VoucherRequestDTO for voucher creation with unsupported parameter parameter When I call the create voucher API with expected status of 400 and stub "/createVoucher" Then I should be able to assert the create voucher validation for negative response @gov @createAndActivateVoucher - Scenario: Conflicting/unique data validations check for Create Voucher API + Scenario: VCR-003 Conflicting/unique data validations check for Create Voucher API Then I will call the fetch voucher API with expected status of 200 When I call the create voucher API with expected status of 409 and stub "/createVoucher" @gov - Scenario: Unsupported header validation for Create Voucher Api Test + Scenario: VCR-004 Unsupported header validation for Create Voucher Api Test Given I can create an VoucherRequestDTO for voucher creation When I call the create voucher API having invalid header with expected status of 400 and stub "/createVoucher" Then I should get non empty response @@ -104,7 +104,7 @@ Feature: Voucher Management Api Test When I call the create, Activate voucher API and store it in "vouchertest/loadTest_demo.csv" @gov - Scenario: Voucher Status Check for inactive voucher, active voucher and redeemed voucher + Scenario: VS-001 Voucher Status Check for inactive voucher, active voucher and redeemed voucher When I can inject MockServer Then I can start mock server And I can register the stub with "/createVoucher" endpoint for "PUT" request with status of 200 @@ -127,7 +127,7 @@ Feature: Voucher Management Api Test @createAndActivateVoucher @gov - Scenario: Voucher Status Check for inactive voucher, active voucher, suspended and cancelled voucher + Scenario: VS-002 Voucher Status Check for inactive voucher, active voucher, suspended and cancelled voucher Given I can create an VoucherRequestDTO for voucher suspension And I can register the stub with "/suspendVoucher" endpoint for "PUT" request with status of 200 When I call the suspend voucher API with expected status of 202 and stub "/suspendVoucher"