|
|
Steps
|
Outcome |
|
|
|
|
Before
|
SUCCESS |
|
|
|
Given I want to verify if the customer below can create a new order: { "cif": "TT10000001", "orderType": "MARKET", "fees": 5.01, "tradingBoard": "", "executedPrice": 10.01, "avgPrice": 10.01, "orderStatus": "NEW", "ltpPrice": 10.01, "orderChannel": "", "referenceId": "", "account": "CA-00005116", "estimatedNetAmt": 10.01, "earmarkflag": true, "expiryDate": "", "tradeTerm": "NORMAL", "orderDatetime": 1709022351142, "stockName": "", "timeInForce": "DAY", "orderQty": 10.01, "id": 1, "origclordId": "", "limitPrice": 10.01, "accountType": "Cashupfront", "orderSide": "BUY", "stockCode": "1F3", "marketState": "", "exchangeId": "SES", "transactionType": "", "orderLot": "ODD_LOT", "stopPrice": 10.01, "marketPhase": "", "clordId": "QQ009", "exchangeName": "", "currencyCode": "SGD", "rewardCode": "", "walletCurrency": "SGD", "rtPtsFlag": true, "multiplier": "1.0" }
|
SUCCESS |
|
|
|
|
SUCCESS |
094ms |
|
|
|
SUCCESS |
070ms |
|
|
gcwBoApi sends a GET request to GET /api/v1/bo/wallet/getWalletDetail
Response
URL: https://gcw-bo-api-sg.dev.rakutentrade.com/api/v1/bo/wallet/getWalletDetail?&cif=TT10000001
Status code: 200
Request Headers
Accept: application/json, text/plain, */* User-Agent: axios/1.6.8 Accept-Encoding: gzip, compress, deflate, br
Response Headers
date: Wed, 24 Apr 2024 10:32:08 GMT content-type: application/json content-length: 639 connection: close vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers cache-control: no-cache, no-store, max-age=0, must-revalidate pragma: no-cache expires: 0 x-content-type-options: nosniff x-frame-options: DENY x-xss-protection: 0 referrer-policy: no-referrer
Response Body
{ "availableCashBalances": [ { "currency": "HKD", "amount": 10000000 }, { "currency": "SGD", "amount": 10000000000 }, { "currency": "USD", "amount": 100000 } ], "withdrawable": { "currency": "SGD", "amount": 10001423613.4342 }, "withdrawableBalances": [ { "currency": "SGD", "amount": 9999996669.392998 }, { "currency": "HKD", "amount": 9996772.121082 }, { "currency": "USD", "amount": 99427.863642 } ], "rates": [ { "currency": "HKD/SGD", "quote": 0.15, "margin": 0.02 }, { "currency": "USD/SGD", "quote": 1.29, "margin": 0.01 } ], "currentInterest": { "currency": "SGD", "interest": 0 }, "interests": [] }
|
SUCCESS |
060ms |
|
|
|
gcwBoApi takes note of Old_walletDetail
|
SUCCESS |
001ms |
|
|
|
|
SUCCESS |
024ms |
|
|
gcwBoApi logs: the body of the last response
{ "availableCashBalances": [ { "currency": "HKD", "amount": 10000000 }, { "currency": "SGD", "amount": 10000000000 }, { "currency": "USD", "amount": 100000 } ], "withdrawable": { "currency": "SGD", "amount": 10001423613.4342 }, "withdrawableBalances": [ { "currency": "SGD", "amount": 9999996669.392998 }, { "currency": "HKD", "amount": 9996772.121082 }, { "currency": "USD", "amount": 99427.863642 } ], "rates": [ { "currency": "HKD/SGD", "quote": 0.15, "margin": 0.02 }, { "currency": "USD/SGD", "quote": 1.29, "margin": 0.01 } ], "currentInterest": { "currency": "SGD", "interest": 0 }, "interests": [] }
|
SUCCESS |
|
|
|
gcwBoApi ensures that the status of the last response does equal 200
|
SUCCESS |
001ms |
|
|
|
|
SUCCESS |
013ms |
|
|
gcwBoApi logs: a note of Old_walletDetail
{ "availableCashBalances": [ { "currency": "HKD", "amount": 10000000 }, { "currency": "SGD", "amount": 10000000000 }, { "currency": "USD", "amount": 100000 } ], "withdrawable": { "currency": "SGD", "amount": 10001423613.4342 }, "withdrawableBalances": [ { "currency": "SGD", "amount": 9999996669.392998 }, { "currency": "HKD", "amount": 9996772.121082 }, { "currency": "USD", "amount": 99427.863642 } ], "rates": [ { "currency": "HKD/SGD", "quote": 0.15, "margin": 0.02 }, { "currency": "USD/SGD", "quote": 1.29, "margin": 0.01 } ], "currentInterest": { "currency": "SGD", "interest": 0 }, "interests": [] }
|
SUCCESS |
|
|
|
|
|
SUCCESS |
043ms |
|
|
#ApiActor posts a request to create new order: {"cif":"TT10000001","orderType":"MARKET","fees":5.01,"tradingBoard":"","executedPrice":10.01,"avgPrice":10.01,"orderStatus":"NEW","ltpPrice":10.01,"orderChannel":"","referenceId":"","account":"CA-00005116","estimatedNetAmt":10.01,"earmarkflag":true,"expiryDate":"","tradeTerm":"NORMAL","orderDatetime":1709022351142,"stockName":"","timeInForce":"DAY","orderQty":10.01,"id":1,"origclordId":"","limitPrice":10.01,"accountType":"Cashupfront","orderSide":"BUY","stockCode":"1F3","marketState":"","exchangeId":"SES","transactionType":"","orderLot":"ODD_LOT","stopPrice":10.01,"marketPhase":"","clordId":"QQ009","exchangeName":"","currencyCode":"SGD","rewardCode":"","walletCurrency":"SGD","rtPtsFlag":true,"multiplier":"1.0"}
|
SUCCESS |
031ms |
|
|
cashBoApi sends a POST request to '/internal/produce-avro-message?avro=OrderCreationRequest'
Response
URL: https://cash-bo-api-sg.dev.rakutentrade.com/internal/produce-avro-message?avro=OrderCreationRequest
Status code: 200
Content Type: application/json
Request Headers
Accept: application/json, text/plain, */* Content-Type: application/json User-Agent: axios/1.6.8 Content-Length: 720 Accept-Encoding: gzip, compress, deflate, br
Content Body
{"cif":"TT10000001","orderType":"MARKET","fees":5.01,"tradingBoard":"","executedPrice":10.01,"avgPrice":10.01,"orderStatus":"NEW","ltpPrice":10.01,"orderChannel":"","referenceId":"","account":"CA-00005116","estimatedNetAmt":10.01,"earmarkflag":true,"expiryDate":"","tradeTerm":"NORMAL","orderDatetime":1709022351142,"stockName":"","timeInForce":"DAY","orderQty":10.01,"id":1,"origclordId":"","limitPrice":10.01,"accountType":"Cashupfront","orderSide":"BUY","stockCode":"1F3","marketState":"","exchangeId":"SES","transactionType":"","orderLot":"ODD_LOT","stopPrice":10.01,"marketPhase":"","clordId":"QQ009","exchangeName":"","currencyCode":"SGD","rewardCode":"","walletCurrency":"SGD","rtPtsFlag":true,"multiplier":"1.0"}
Response Headers
date: Wed, 24 Apr 2024 10:32:08 GMT content-type: application/json;charset=UTF-8 content-length: 17 connection: close vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers cache-control: no-cache, no-store, max-age=0, must-revalidate pragma: no-cache expires: 0 x-content-type-options: nosniff x-frame-options: DENY x-xss-protection: 0 referrer-policy: no-referrer
Response Body
Producing message
|
SUCCESS |
019ms |
|
|
|
|
|
SUCCESS |
025ms |
|
|
cashBoApi logs: the body of the last response
|
SUCCESS |
|
|
|
cashBoApi ensures that the status of the last response does equal 200
|
SUCCESS |
001ms |
|
|
|
|
SUCCESS |
200ms |
|
|
|
SUCCESS |
164ms |
|
|
cashBoApi sends a GET request to GET /api/v1/bo/order-calculation/calculateEarmarkCash
Response
URL: https://cash-bo-api-sg.dev.rakutentrade.com/api/v1/bo/order-calculation/calculateEarmarkCash?&tan=CA-00005116&orderType=MARKET&orderAction=BUY&quantity=10.01&stockCode=1F3&marketCode=SES&price=10.01¤cy=SGD
Status code: 200
Request Headers
Accept: application/json, text/plain, */* User-Agent: axios/1.6.8 Accept-Encoding: gzip, compress, deflate, br
Response Headers
date: Wed, 24 Apr 2024 10:32:09 GMT content-type: application/json content-length: 1012 connection: close vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers cache-control: no-cache, no-store, max-age=0, must-revalidate pragma: no-cache expires: 0 x-content-type-options: nosniff x-frame-options: DENY x-xss-protection: 0 referrer-policy: no-referrer
Response Body
{ "totalStockPrices": 130.26013, "currency": "SGD", "fees": [ { "feeCode": "TRADING_FEES_SES", "name": "Trading fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 1, "processCode": "BUY_MATCHED", "actionCode": "TRADING_FEES_SES", "currency": "SGD" }, { "feeCode": "CLEARING_FEE_SES", "name": "Clearing fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 0.99, "processCode": "BUY_MATCHED", "actionCode": "CLEARING_FEE_SES", "currency": "SGD" }, { "feeCode": "GOOD_N_TAX_SES", "name": "Goods and Services Tax", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 10.42, "processCode": "BUY_MATCHED", "actionCode": "GOOD_N_TAX_SES", "currency": "SGD" }, { "feeCode": "BROKERAGE_SES", "name": "Brokerage fees", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 0.99, "processCode": "BUY_MATCHED", "actionCode": "BROKERAGE_SES", "currency": "SGD" }, { "feeCode": "PLATFORM_SES", "name": "Platform fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 1, "processCode": "BUY_MATCHED", "actionCode": "PLATFORM_SES", "currency": "SGD" } ], "totalFee": 14.4, "total": 144.66013 }
|
SUCCESS |
153ms |
|
|
|
cashBoApi logs: the body of the last response
{ "totalStockPrices": 130.26013, "currency": "SGD", "fees": [ { "feeCode": "TRADING_FEES_SES", "name": "Trading fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 1, "processCode": "BUY_MATCHED", "actionCode": "TRADING_FEES_SES", "currency": "SGD" }, { "feeCode": "CLEARING_FEE_SES", "name": "Clearing fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 0.99, "processCode": "BUY_MATCHED", "actionCode": "CLEARING_FEE_SES", "currency": "SGD" }, { "feeCode": "GOOD_N_TAX_SES", "name": "Goods and Services Tax", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 10.42, "processCode": "BUY_MATCHED", "actionCode": "GOOD_N_TAX_SES", "currency": "SGD" }, { "feeCode": "BROKERAGE_SES", "name": "Brokerage fees", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 0.99, "processCode": "BUY_MATCHED", "actionCode": "BROKERAGE_SES", "currency": "SGD" }, { "feeCode": "PLATFORM_SES", "name": "Platform fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 1, "processCode": "BUY_MATCHED", "actionCode": "PLATFORM_SES", "currency": "SGD" } ], "totalFee": 14.4, "total": 144.66013 }
|
SUCCESS |
|
|
|
cashBoApi takes note of total_Price
|
SUCCESS |
|
|
|
|
|
SUCCESS |
023ms |
|
|
cashBoApi logs: the body of the last response
{ "totalStockPrices": 130.26013, "currency": "SGD", "fees": [ { "feeCode": "TRADING_FEES_SES", "name": "Trading fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 1, "processCode": "BUY_MATCHED", "actionCode": "TRADING_FEES_SES", "currency": "SGD" }, { "feeCode": "CLEARING_FEE_SES", "name": "Clearing fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 0.99, "processCode": "BUY_MATCHED", "actionCode": "CLEARING_FEE_SES", "currency": "SGD" }, { "feeCode": "GOOD_N_TAX_SES", "name": "Goods and Services Tax", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 10.42, "processCode": "BUY_MATCHED", "actionCode": "GOOD_N_TAX_SES", "currency": "SGD" }, { "feeCode": "BROKERAGE_SES", "name": "Brokerage fees", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 0.99, "processCode": "BUY_MATCHED", "actionCode": "BROKERAGE_SES", "currency": "SGD" }, { "feeCode": "PLATFORM_SES", "name": "Platform fee", "feeType": "PERCENTAGE", "marketCode": "SES", "amount": 1, "processCode": "BUY_MATCHED", "actionCode": "PLATFORM_SES", "currency": "SGD" } ], "totalFee": 14.4, "total": 144.66013 }
|
SUCCESS |
|
|
|
cashBoApi ensures that the status of the last response does equal 200
|
SUCCESS |
001ms |
|
|
|
|
SUCCESS |
115ms |
|
|
|
SUCCESS |
092ms |
|
|
gcwBoApi sends a GET request to GET /api/v1/bo/wallet/getWalletDetail
Response
URL: https://gcw-bo-api-sg.dev.rakutentrade.com/api/v1/bo/wallet/getWalletDetail?&cif=TT10000001
Status code: 200
Request Headers
Accept: application/json, text/plain, */* User-Agent: axios/1.6.8 Accept-Encoding: gzip, compress, deflate, br
Response Headers
date: Wed, 24 Apr 2024 10:32:09 GMT content-type: application/json content-length: 639 connection: close vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers cache-control: no-cache, no-store, max-age=0, must-revalidate pragma: no-cache expires: 0 x-content-type-options: nosniff x-frame-options: DENY x-xss-protection: 0 referrer-policy: no-referrer
Response Body
{ "availableCashBalances": [ { "currency": "HKD", "amount": 10000000 }, { "currency": "SGD", "amount": 10000000000 }, { "currency": "USD", "amount": 100000 } ], "withdrawable": { "currency": "SGD", "amount": 10001423613.4342 }, "withdrawableBalances": [ { "currency": "SGD", "amount": 9999996669.392998 }, { "currency": "HKD", "amount": 9996772.121082 }, { "currency": "USD", "amount": 99427.863642 } ], "rates": [ { "currency": "USD/SGD", "quote": 1.29, "margin": 0.01 }, { "currency": "HKD/SGD", "quote": 0.15, "margin": 0.02 } ], "currentInterest": { "currency": "SGD", "interest": 0 }, "interests": [] }
|
SUCCESS |
081ms |
|
|
|
gcwBoApi takes note of New_walletDetail
|
SUCCESS |
|
|
|
|
|
SUCCESS |
026ms |
|
|
gcwBoApi logs: the body of the last response
{ "availableCashBalances": [ { "currency": "HKD", "amount": 10000000 }, { "currency": "SGD", "amount": 10000000000 }, { "currency": "USD", "amount": 100000 } ], "withdrawable": { "currency": "SGD", "amount": 10001423613.4342 }, "withdrawableBalances": [ { "currency": "SGD", "amount": 9999996669.392998 }, { "currency": "HKD", "amount": 9996772.121082 }, { "currency": "USD", "amount": 99427.863642 } ], "rates": [ { "currency": "USD/SGD", "quote": 1.29, "margin": 0.01 }, { "currency": "HKD/SGD", "quote": 0.15, "margin": 0.02 } ], "currentInterest": { "currency": "SGD", "interest": 0 }, "interests": [] }
|
SUCCESS |
001ms |
|
|
gcwBoApi ensures that the status of the last response does equal 200
|
SUCCESS |
002ms |
|
|
|
|
SUCCESS |
014ms |
|
|
gcwBoApi logs: a note of New_walletDetail
{ "availableCashBalances": [ { "currency": "HKD", "amount": 10000000 }, { "currency": "SGD", "amount": 10000000000 }, { "currency": "USD", "amount": 100000 } ], "withdrawable": { "currency": "SGD", "amount": 10001423613.4342 }, "withdrawableBalances": [ { "currency": "SGD", "amount": 9999996669.392998 }, { "currency": "HKD", "amount": 9996772.121082 }, { "currency": "USD", "amount": 99427.863642 } ], "rates": [ { "currency": "USD/SGD", "quote": 1.29, "margin": 0.01 }, { "currency": "HKD/SGD", "quote": 0.15, "margin": 0.02 } ], "currentInterest": { "currency": "SGD", "interest": 0 }, "interests": [] }
|
SUCCESS |
001ms |
|
|
|
|
FAILURE |
048ms |
|
|
I logs: 'Old Wallet Detail', 10001423613.4342
|
SUCCESS |
|
|
|
I logs: 'New Wallet Detail', 10001423613.4342
|
SUCCESS |
001ms |
|
|
I logs: 'Fee calculation', 144.66013
|
SUCCESS |
001ms |
|
|
I ensures that 0 does have value close to 144.66013 ±0.00001
|
FAILURE |
001ms |
|   |
AssertionError: Expected 0 to have value close to 144.66013 ±0.00001
Expectation: isCloseTo(144.66013, 0.00001)
Expected number: 144.66013 Received number: 0
at /builds/test-automation/senerity-js-sample/rtsg-api/features/step_definitions/cash-bo-api/order-creation.step.ts:98:12
.(/builds/test-automation/senerity-js-sample/rtsg-api/features/step_definitions/cash-bo-api/order-creation.step.ts:98) .ErrorFactory.create()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@serenity-js/core/src/errors/ErrorFactory.ts:35) .Stage.createError()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@serenity-js/core/src/stage/Stage.ts:289) .RaiseErrors.create()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@serenity-js/core/src/errors/RaiseErrors.ts:59) .Ensure.performAs()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@serenity-js/assertions/src/Ensure.ts:134) .async PerformActivities.perform()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@serenity-js/core/src/screenplay/abilities/PerformActivities.ts:53) .async wrapPromiseWithTimeout()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@cucumber/cucumber/src/time.ts:55) .async Object.run()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@cucumber/cucumber/src/user_code_runner.ts:86) .async Object.run()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@cucumber/cucumber/src/runtime/step_runner.ts:50) .async TestCaseRunner.invokeStep()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:138) .async TestCaseRunner.runStep()(/builds/test-automation/senerity-js-sample/rtsg-api/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:335)
|
|
|
FAILURE |
0.65s |