From 8cb6165093d84662936f99536d02cb776187e1ff Mon Sep 17 00:00:00 2001 From: Sridevi Miriyala Date: Tue, 17 Aug 2021 22:45:41 -0400 Subject: [PATCH 01/10] Added more test scenarios --- .../src/tests/SettlementWindowsPage.test.ts | 129 +++++------------- 1 file changed, 36 insertions(+), 93 deletions(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index a4e2fbc1..891810b5 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -152,101 +152,44 @@ test.meta({ }); test - .skip - .meta({ - ID: '', - STORY: 'MMD-440', -})( - `Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down. Select the Date to Past 48 hours.Check that From and To Date should be update - to reflect 48 hours. Select state to open. All the corresponding windows should display based - on the criteria selected`, - async (t) => { - - //Call Mojaloop Settlement API to get the current window details - - // Check that the latest window ID that displays on the page is the same + .meta({ + ID: '', + STORY: 'MMD-440', + Scenario: 'Default Windows landing page' + }) + (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with + Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format + State should be empty and Clear Filters button`, async t => { + + }); -test - .skip - .meta({ - ID: '', - STORY: 'MMD-440' - }) - (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down. Select the Date to Past 1 week.Check that From and To Date should be update - to reflect 48 hours. Select state to Closed. All the corresponding windows should display based - on the criteria selected`, - async (t) => { - - //Call Mojaloop Settlement API to get the current window details - - // Check that the latest window ID that displays on the page is the same - }); - -test - .skip - .meta({ - ID: '', - STORY: 'MMD-440' - }) - (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down. Select the Date to Past 1 month.Check that From and To Date should be update - to reflect 48 hours. Select state to Pending. All the corresponding windows should display based - on the criteria selected`, - async (t) => { - - //Call Mojaloop Settlement API to get the window details - - // Check that the latest window ID that displays on the page is the same - }); - -test - .skip - .meta({ - ID: '', - STORY: 'MMD-440' - }) - (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down. Select the Dates to custom range. Check that From and To Date should be update - to reflect 48 hours. Select state to Settled. All the corresponding windows should display based - on the criteria selected`, async (t) => { - - //Call Mojaloop Settlement API to get the window details - - // Check that the latest window ID that displays on the page is the same - }); - -test - .skip - .meta({ - ID: '', - STORY: 'MMD-440' - }) - (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down. Select the Date to custom range. Check that From and To Date should be update - to reflect 48 hours. Select state to Aborted. All the corresponding windows should display based - on the criteria selected`, - async (t) => { + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: 'Test Windows landing page with Today Date option selected' + })( + `On the default Settlement Windows page, if Today option for Date is selected then all + the windows that are available for current day should be displayed. This can be a combination of + open, closed windows. If there are no windows that were transacted the current day, the current open + window should be displayed. + For each window that is displayed, Window ID, State, Open Date, Closed Date should be available. `, + async (t) => { + //Get the list of wondows for current date. + // Check that the latest window ID that displays on the page is the same + }, + ); - //Call Mojaloop Settlement API to get the window details + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: 'Close Open Window' + })( + `Once an open window is selected, there should be a button to close the window. Once the window + is closed, the status of that window should change from Open to Closed and a new window should appear. + `, async t => { - // Check that the latest window ID that displays on the page is the same - }); + //Call Mojaloop Settlement API to get the current window details -test - .skip - .meta({ - ID: '', - STORY: 'MMD-440' - }) - (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down. Select the Date to custom range. Check that From and To Date should be update - to reflect 48 hours. Select state to Aborted. All the corresponding windows should display based - on the criteria selected`, - async (t) => { - //Call Mojaloop Settlement API to get the window details - // Check that the latest window ID that displays on the page is the same - }, -); + // Check that the latest window ID that displays on the page is the same + }); From c9ebd9a634c55c26f32f11e45226b49885000764 Mon Sep 17 00:00:00 2001 From: sri-miriyala <38143240+sri-miriyala@users.noreply.github.com> Date: Wed, 18 Aug 2021 08:19:50 -0400 Subject: [PATCH 02/10] Update integration_test/tests/src/tests/SettlementWindowsPage.test.ts Co-authored-by: Matt Kingston --- integration_test/tests/src/tests/SettlementWindowsPage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index 891810b5..a2c6aa2c 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -159,7 +159,7 @@ test }) (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format - State should be empty and Clear Filters button`, async t => { + State field should be empty and Clear Filters button should be present`, async t => { }); From 995df57e9eabd05d8d88e3ca51fae33f67aa25ca Mon Sep 17 00:00:00 2001 From: sri-miriyala <38143240+sri-miriyala@users.noreply.github.com> Date: Wed, 18 Aug 2021 08:23:32 -0400 Subject: [PATCH 03/10] Update integration_test/tests/src/tests/SettlementWindowsPage.test.ts Co-authored-by: Matt Kingston --- integration_test/tests/src/tests/SettlementWindowsPage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index a2c6aa2c..1f51800f 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -158,7 +158,7 @@ test Scenario: 'Default Windows landing page' }) (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format + Date drop-down defaulted to Today, From and To drop-down defaulted to current date in ISO8601 format State field should be empty and Clear Filters button should be present`, async t => { From 7c35ce83c85ceb79341684c4968896b7b5ddd506 Mon Sep 17 00:00:00 2001 From: sri-miriyala <38143240+sri-miriyala@users.noreply.github.com> Date: Wed, 18 Aug 2021 08:23:55 -0400 Subject: [PATCH 04/10] Update integration_test/tests/src/tests/SettlementWindowsPage.test.ts Co-authored-by: Matt Kingston --- integration_test/tests/src/tests/SettlementWindowsPage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index 1f51800f..488d809b 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -169,7 +169,7 @@ test STORY: 'MMD-440', Scenario: 'Test Windows landing page with Today Date option selected' })( - `On the default Settlement Windows page, if Today option for Date is selected then all + `On the default Settlement Windows page, if Today option for Date is selected and no other filters are active then all the windows that are available for current day should be displayed. This can be a combination of open, closed windows. If there are no windows that were transacted the current day, the current open window should be displayed. From ff484f06f3aeb5a19e1b2043bcdc150b0d891adc Mon Sep 17 00:00:00 2001 From: sri-miriyala <38143240+sri-miriyala@users.noreply.github.com> Date: Wed, 18 Aug 2021 08:28:15 -0400 Subject: [PATCH 05/10] Update integration_test/tests/src/tests/SettlementWindowsPage.test.ts Co-authored-by: Matt Kingston --- integration_test/tests/src/tests/SettlementWindowsPage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index 488d809b..b2a40759 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -173,7 +173,7 @@ test the windows that are available for current day should be displayed. This can be a combination of open, closed windows. If there are no windows that were transacted the current day, the current open window should be displayed. - For each window that is displayed, Window ID, State, Open Date, Closed Date should be available. `, + For each window that is displayed, Window ID, State, Open Date, Closed Date should be visible. `, async (t) => { //Get the list of wondows for current date. // Check that the latest window ID that displays on the page is the same From ff8ac23855614056e8d68026f6cb0cb493b70593 Mon Sep 17 00:00:00 2001 From: Sridevi Miriyala Date: Wed, 18 Aug 2021 08:30:59 -0400 Subject: [PATCH 06/10] Swapped scenario and test case name --- .../src/tests/SettlementWindowsPage.test.ts | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index b2a40759..5110ecd8 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -90,7 +90,7 @@ test .meta({ ID: '', STORY: 'MMD-440', - description: `Selecting Settlement Windows tab in Side Menu, the main settlement page should be + Scenario: `Selecting Settlement Windows tab in Side Menu, the main settlement page should be displayed with Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format, State should be empty and Clear Filters button` @@ -127,7 +127,7 @@ test.meta({ test.meta({ ID: '', STORY: 'MMD-440', - description: + Scenario: `Close the single open settlement window, and expect the same window now shows up in a list of closed windows`, })('Close settlement window', async (t) => { @@ -155,11 +155,11 @@ test .meta({ ID: '', STORY: 'MMD-440', - Scenario: 'Default Windows landing page' + Scenario: `Once I click Settlement Windows tab in Side Menu, the page on the right should come up with + Date drop-down defaulted to Today, From and To drop-down defaulted to current date in ISO8601 format + State field should be empty and Clear Filters button should be present` }) - (`Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down defaulted to Today, From and To drop-down defaulted to current date in ISO8601 format - State field should be empty and Clear Filters button should be present`, async t => { + (`Default Windows landing page`, async t => { }); @@ -167,13 +167,13 @@ test test.meta({ ID: '', STORY: 'MMD-440', - Scenario: 'Test Windows landing page with Today Date option selected' - })( - `On the default Settlement Windows page, if Today option for Date is selected and no other filters are active then all + Scenario: `On the default Settlement Windows page, if Today option for Date is selected and no other filters are active then all the windows that are available for current day should be displayed. This can be a combination of open, closed windows. If there are no windows that were transacted the current day, the current open window should be displayed. - For each window that is displayed, Window ID, State, Open Date, Closed Date should be visible. `, + For each window that is displayed, Window ID, State, Open Date, Closed Date should be visible. ` + })( + `Test Windows landing page with Today Date option selected`, async (t) => { //Get the list of wondows for current date. // Check that the latest window ID that displays on the page is the same @@ -183,11 +183,10 @@ test test.meta({ ID: '', STORY: 'MMD-440', - Scenario: 'Close Open Window' + Scenario: `Once an open window is selected, there should be a button to close the window. Once the window + is closed, the status of that window should change from Open to Closed and a new window should appear.` })( - `Once an open window is selected, there should be a button to close the window. Once the window - is closed, the status of that window should change from Open to Closed and a new window should appear. - `, async t => { + `Close Open Window`, async t => { //Call Mojaloop Settlement API to get the current window details From a0d348808c6f5e1049df126486df670168443daa Mon Sep 17 00:00:00 2001 From: Sridevi Miriyala Date: Mon, 23 Aug 2021 06:46:59 -0400 Subject: [PATCH 07/10] Added test scenario for closing indivudual window --- .../src/tests/SettlementWindowsPage.test.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index 5110ecd8..e25149e8 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -175,8 +175,7 @@ test })( `Test Windows landing page with Today Date option selected`, async (t) => { - //Get the list of wondows for current date. - // Check that the latest window ID that displays on the page is the same + }, ); @@ -188,7 +187,18 @@ test })( `Close Open Window`, async t => { - //Call Mojaloop Settlement API to get the current window details + + }); + + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `On the Settlement Windows page, the settle windows button should be grayed out. + If there is a list of closed windows, there should be a checkbox to the left of the window id. + I should be able to click it, which will enable settle windows button at the top. I should be + to click it and close the window.` + })( + `Settle closed windows individually`, async t => { - // Check that the latest window ID that displays on the page is the same + }); From 3370431b18401c77fdfed97fb268b4f9a9ea5186 Mon Sep 17 00:00:00 2001 From: Sridevi Miriyala Date: Mon, 23 Aug 2021 08:07:38 -0400 Subject: [PATCH 08/10] Added more tests for defaults. --- .../src/tests/SettlementWindowsPage.test.ts | 82 ++++++++++++++++--- 1 file changed, 71 insertions(+), 11 deletions(-) diff --git a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts index e25149e8..08e3ed89 100644 --- a/integration_test/tests/src/tests/SettlementWindowsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementWindowsPage.test.ts @@ -152,17 +152,41 @@ test.meta({ }); test - .meta({ - ID: '', - STORY: 'MMD-440', - Scenario: `Once I click Settlement Windows tab in Side Menu, the page on the right should come up with - Date drop-down defaulted to Today, From and To drop-down defaulted to current date in ISO8601 format - State field should be empty and Clear Filters button should be present` - }) - (`Default Windows landing page`, async t => { + .meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `Once I click Settlement Windows tab in Side Menu, the page on the right should come up with + Date drop-down defaulted to Today, From and To drop-down defaulted to current date in ISO8601 format + State field should be empty and Clear Filters button should be present` + }) + (`Default Windows landing page`, async t => { - - }); + + }); + +test + .meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `Once I click Settlement Windows tab in Side Menu, the page on the right should come up with + Date drop-down. The drop down should list values, Today, Past 48 Hours, 1 Week, 1 Month, Custom Range` + }) + (`Drop down menu options for Date filter`, async t => { + + + }); + +test + .meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `Once I click Settlement Windows tab in Side Menu, the page on the right should come up with + State drop-down. The drop down should list values, Open, Closed, Pending, Settled, Aborted` + }) + (`Drop down menu options for State filter`, async t => { + + + }); test.meta({ ID: '', @@ -188,17 +212,53 @@ test `Close Open Window`, async t => { + }); + + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `If I try to close a window that does not have any transfers, it should give an + error message: Unable to Close Window due to error 3100: "Generic validation error - Window 60 is empty"` + })( + `Unable to close window without any transfers`, async t => { + + + }); + + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `Regardless of the filters that are chosen, clicking "Clear Filters" button should reset + to default values Date - Today, From date with currrent date in YY/MM/DDDD 00:00:00 format and + To date with currrent date in YY/MM/DDDD 23:59:59 format` + })( + `Clicking Clear Filters button to reset with default options`, async t => { + + }); test.meta({ ID: '', STORY: 'MMD-440', Scenario: `On the Settlement Windows page, the settle windows button should be grayed out. - If there is a list of closed windows, there should be a checkbox to the left of the window id. + If there is only one closed window, there should be a checkbox to the left of the window id. I should be able to click it, which will enable settle windows button at the top. I should be to click it and close the window.` })( `Settle closed windows individually`, async t => { + }); + + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `On the Settlement Windows page, the settle windows button should be grayed out. + If there is a list of closed windows, there should be a checkbox to the left of the window ids. + I should be able to select multiple closed windows, which will enable settle windows button at the top. + I should be to click it and close the windows.` + })( + `Settle multiple closed windows simultaneously`, async t => { + + }); From 6ef5f533c248f3a0ebcfb975f8f8074e3e1b62e0 Mon Sep 17 00:00:00 2001 From: Sridevi Miriyala Date: Thu, 26 Aug 2021 21:58:17 -0400 Subject: [PATCH 09/10] Added tests for Settlements --- .../tests/src/tests/SettlementsPage.test.ts | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/integration_test/tests/src/tests/SettlementsPage.test.ts b/integration_test/tests/src/tests/SettlementsPage.test.ts index 9660cac7..17248e6b 100644 --- a/integration_test/tests/src/tests/SettlementsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementsPage.test.ts @@ -5,12 +5,33 @@ fixture.skip `Settlements Feature`.page`${config.financePortalEndpoint}`; // spe test.meta({ ID: '', STORY: 'MMD-440', -})( - `Once I click Settlement tab in Side Menu, the page on the right should come up with - Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format - State should be empty and Clear Filters button`, - async (t) => { - //Call Mojaloop Settlement API to get the current window details - // Check that the latest window ID that displays on the page is the same - }, -); + Scenario: `Once I click Settlement tab in Side Menu, the page on the right should come up with + Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format + State should be empty and Clear Filters button` + })( + 'Default landing page', async (t) => { + + }); + +test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `The following options should be available for State column drop-down, Pending Settlement + Ps Transfers Recorded, Ps Transfers Reserved, Ps Transfers Committed, Settling, Settled, Aborted` + })( + 'State Column drop-down options', async (t) => { + + }); + +test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `Close the existing open window, Run a transfer, Close the open window, Settle the open window + and the settlement details with the correct Settlement ID, State as Settled, Exact total value + Correct Open Date and Last Action Date. All these details should be compared against the information + from calling Settlement API. + ` + })( + 'Able to see Pending Settlements', async (t) => { + + }); From a2577e03feef0e84d03c9dd1e8503f21debc80d0 Mon Sep 17 00:00:00 2001 From: Sridevi Miriyala Date: Fri, 3 Sep 2021 07:43:00 -0400 Subject: [PATCH 10/10] Resolved errors with npm run compile --- .../tests/src/tests/SettlementsPage.test.ts | 180 ++++++++---------- 1 file changed, 80 insertions(+), 100 deletions(-) diff --git a/integration_test/tests/src/tests/SettlementsPage.test.ts b/integration_test/tests/src/tests/SettlementsPage.test.ts index 05d3923e..6e0888c7 100644 --- a/integration_test/tests/src/tests/SettlementsPage.test.ts +++ b/integration_test/tests/src/tests/SettlementsPage.test.ts @@ -47,112 +47,92 @@ fixture `Settlements Feature` .click(SideMenu.settlementWindowsButton); // yes, not the settlements button }); -test.meta({ - ID: '', - STORY: 'MMD-440', - Scenario: `Once I click Settlement tab in Side Menu, the page on the right should come up with - Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format - State should be empty and Clear Filters button` - })( - 'Default landing page', async (t) => { - - }); -test.meta({ - ID: '', - STORY: 'MMD-440', - Scenario: `The following options should be available for State column drop-down, Pending Settlement - Ps Transfers Recorded, Ps Transfers Reserved, Ps Transfers Committed, Settling, Settled, Aborted` - })( - 'State Column drop-down options', async (t) => { - - }); -test.meta({ + test.meta({ ID: '', STORY: 'MMD-440', - Scenario: `Close the existing open window, Run a transfer, Close the open window, Settle the open window - and the settlement details with the correct Settlement ID, State as Settled, Exact total value - Correct Open Date and Last Action Date. All these details should be compared against the information - from calling Settlement API. - ` - })( - 'Able to see Pending Settlements', async (t) => { - + description: + `Close two settlement windows. Add them to a settlement. Settle the settlement.`, + })('Settle settlement containing two closed windows', async (t) => { + const { cli, participants } = t.fixtureCtx; + // Run a transfer to ensure the settlement window can be closed + const transfers1: protocol.TransferMessage[] = [{ + msg_sender: participants[1].name, + msg_recipient: participants[0].name, + currency: 'MMK', + amount: '10', + transfer_id: uuidv4(), + }]; + await cli.completeTransfers(transfers1); + const openWindows1 = await cli.getSettlementWindows({ state: "OPEN" }); + await t.expect(openWindows1.length).eql(1, 'Expected only a single open window'); + const closedSettlementWindowId1 = await cli.closeSettlementWindow({ + id: openWindows1[0].settlementWindowId, + reason: 'Integration test', }); - description: - `Close two settlement windows. Add them to a settlement. Settle the settlement.`, -})('Settle settlement containing two closed windows', async (t) => { - const { cli, participants } = t.fixtureCtx; - // Run a transfer to ensure the settlement window can be closed - const transfers1: protocol.TransferMessage[] = [{ - msg_sender: participants[1].name, - msg_recipient: participants[0].name, - currency: 'MMK', - amount: '10', - transfer_id: uuidv4(), - }]; - await cli.completeTransfers(transfers1); - const openWindows1 = await cli.getSettlementWindows({ state: "OPEN" }); - await t.expect(openWindows1.length).eql(1, 'Expected only a single open window'); - const closedSettlementWindowId1 = await cli.closeSettlementWindow({ - id: openWindows1[0].settlementWindowId, - reason: 'Integration test', - }); - - // Run a transfer so the settlement window can be closed - const transfers2: protocol.TransferMessage[] = [{ - msg_sender: participants[0].name, - msg_recipient: participants[1].name, - currency: 'MMK', - amount: '10', - transfer_id: uuidv4(), - }]; - await cli.completeTransfers(transfers2); - const openWindows2 = await cli.getSettlementWindows({ state: "OPEN" }); - await t.expect(openWindows2.length).eql(1, 'Expected only a single open window'); - const closedSettlementWindowId2 = await cli.closeSettlementWindow({ - id: openWindows2[0].settlementWindowId, - reason: 'Integration test', - }); - - const settlementWindowIds = [ - closedSettlementWindowId1, - closedSettlementWindowId2, - ]; - - const settlement = await cli.createSettlement({ - reason: 'Integration test', - settlementModel: 'DEFERREDNET', - settlementWindows: settlementWindowIds.map((id) => ({ id })), + + // Run a transfer so the settlement window can be closed + const transfers2: protocol.TransferMessage[] = [{ + msg_sender: participants[0].name, + msg_recipient: participants[1].name, + currency: 'MMK', + amount: '10', + transfer_id: uuidv4(), + }]; + await cli.completeTransfers(transfers2); + const openWindows2 = await cli.getSettlementWindows({ state: "OPEN" }); + await t.expect(openWindows2.length).eql(1, 'Expected only a single open window'); + const closedSettlementWindowId2 = await cli.closeSettlementWindow({ + id: openWindows2[0].settlementWindowId, + reason: 'Integration test', + }); + + const settlementWindowIds = [ + closedSettlementWindowId1, + closedSettlementWindowId2, + ]; + + const settlement = await cli.createSettlement({ + reason: 'Integration test', + settlementModel: 'DEFERREDNET', + settlementWindows: settlementWindowIds.map((id) => ({ id })), + }); + + await t.click(SideMenu.settlementsButton); + + const rowsBefore = await SettlementsPage.getResultRows(); + const settlementRowBefore = await Promise.any(rowsBefore.map( + (r) => r.id.innerText.then(id => Number(id) === settlement.id ? Promise.resolve(r) : Promise.reject()), + )); + await t.expect(settlementRowBefore.state.innerText).eql('Pending Settlement'); + await t.click(settlementRowBefore.finalizeButton); + await t.click(SettlementFinalizeModal.closeButton); + const rowsAfter = await SettlementsPage.getResultRows(); + const settlementRowAfter = await Promise.any(rowsAfter.map( + (r) => r.id.innerText.then(id => Number(id) === settlement.id ? Promise.resolve(r) : Promise.reject()), + )); + await t.expect(settlementRowAfter.state.innerText).eql('Settled'); }); - await t.click(SideMenu.settlementsButton); - const rowsBefore = await SettlementsPage.getResultRows(); - const settlementRowBefore = await Promise.any(rowsBefore.map( - (r) => r.id.innerText.then(id => Number(id) === settlement.id ? Promise.resolve(r) : Promise.reject()), - )); - await t.expect(settlementRowBefore.state.innerText).eql('Pending Settlement'); - await t.click(settlementRowBefore.finalizeButton); - await t.click(SettlementFinalizeModal.closeButton); - const rowsAfter = await SettlementsPage.getResultRows(); - const settlementRowAfter = await Promise.any(rowsAfter.map( - (r) => r.id.innerText.then(id => Number(id) === settlement.id ? Promise.resolve(r) : Promise.reject()), - )); - await t.expect(settlementRowAfter.state.innerText).eql('Settled'); -}); - - -test.skip.meta({ - ID: '', - STORY: 'MMD-440', -})( - `Once I click Settlement tab in Side Menu, the page on the right should come up with + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `Once I click Settlement tab in Side Menu, the page on the right should come up with Date drop-down defaulted to Today, From and To drop-down defaulted to current date in MM/DD/YYYY HH:MM:SS format - State should be empty and Clear Filters button`, - async (t) => { - //Call Mojaloop Settlement API to get the current window details - // Check that the latest window ID that displays on the page is the same - }, -); + State should be empty and Clear Filters button` + })( + 'Default landing page', async (t) => { + + }); + + test.meta({ + ID: '', + STORY: 'MMD-440', + Scenario: `The following options should be available for State column drop-down, Pending Settlement + Ps Transfers Recorded, Ps Transfers Reserved, Ps Transfers Committed, Settling, Settled, Aborted` + })( + 'State Column drop-down options', async (t) => { + + });