|
|
Steps
|
Outcome |
|
|
|
|
Before
|
SUCCESS |
001ms |
|
|
Given I want to verify if the customer below can create a new order: { "cif": "TT10000001", "orderType": "STOPLIMIT", "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": "493", "marketState": "", "exchangeId": "HKG", "transactionType": "", "orderLot": "ODD_LOT", "stopPrice": 10.01, "marketPhase": "", "clordId": "QQ017", "exchangeName": "", "currencyCode": "HKD", "rewardCode": "", "walletCurrency": "SGD", "rtPtsFlag": true, "multiplier": "1.0" }
|
SUCCESS |
001ms |
|
|
|
SUCCESS |
124ms |
|
|
|
SUCCESS |
099ms |
|
|
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:14 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 |
089ms |
|
|
|
gcwBoApi takes note of Old_walletDetail
|
SUCCESS |
001ms |
|
|
|
|
SUCCESS |
025ms |
|
|
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 |
|
|
|
|
|
SUCCESS |
016ms |
|
|
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 |
001ms |
|
|
|
|
SUCCESS |
048ms |
|
|
#ApiActor posts a request to create new order: {"cif":"TT10000001","orderType":"STOPLIMIT","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":"493","marketState":"","exchangeId":"HKG","transactionType":"","orderLot":"ODD_LOT","stopPrice":10.01,"marketPhase":"","clordId":"QQ017","exchangeName":"","currencyCode":"HKD","rewardCode":"","walletCurrency":"SGD","rtPtsFlag":true,"multiplier":"1.0"}
|
SUCCESS |
035ms |
|
|
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: 723 Accept-Encoding: gzip, compress, deflate, br
Content Body
{"cif":"TT10000001","orderType":"STOPLIMIT","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":"493","marketState":"","exchangeId":"HKG","transactionType":"","orderLot":"ODD_LOT","stopPrice":10.01,"marketPhase":"","clordId":"QQ017","exchangeName":"","currencyCode":"HKD","rewardCode":"","walletCurrency":"SGD","rtPtsFlag":true,"multiplier":"1.0"}
Response Headers
date: Wed, 24 Apr 2024 10:32:14 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 |
024ms |
|
|
|
|
|
SUCCESS |
024ms |
|
|
cashBoApi logs: the body of the last response
|
SUCCESS |
001ms |
|
|
cashBoApi ensures that the status of the last response does equal 200
|
SUCCESS |
001ms |
|
|
|
|
SUCCESS |
156ms |
|
|
|
SUCCESS |
121ms |
|
|
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=STOPLIMIT&orderAction=BUY&quantity=10.01&stockCode=493&marketCode=HKG&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:14 GMT content-type: application/json content-length: 90 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": 13.026013, "currency": "SGD", "fees": [], "totalFee": 0, "total": 13.026013 }
|
SUCCESS |
110ms |
|
|
|
cashBoApi logs: the body of the last response
{ "totalStockPrices": 13.026013, "currency": "SGD", "fees": [], "totalFee": 0, "total": 13.026013 }
|
SUCCESS |
|
|
|
cashBoApi takes note of total_Price
|
SUCCESS |
|
|
|
|
|
SUCCESS |
023ms |
|
|
cashBoApi logs: the body of the last response
{ "totalStockPrices": 13.026013, "currency": "SGD", "fees": [], "totalFee": 0, "total": 13.026013 }
|
SUCCESS |
|
|
|
cashBoApi ensures that the status of the last response does equal 200
|
SUCCESS |
001ms |
|
|
|
|
SUCCESS |
099ms |
|
|
|
SUCCESS |
076ms |
|
|
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:14 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 |
066ms |
|
|
|
gcwBoApi takes note of New_walletDetail
|
SUCCESS |
|
|
|
|
|
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 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": "HKD/SGD", "quote": 0.15, "margin": 0.02 }, { "currency": "USD/SGD", "quote": 1.29, "margin": 0.01 } ], "currentInterest": { "currency": "SGD", "interest": 0 }, "interests": [] }
|
SUCCESS |
|
|
|
|
|
FAILURE |
048ms |
|
|
I logs: 'Old Wallet Detail', 10001423613.4342
|
SUCCESS |
|
|
|
I logs: 'New Wallet Detail', 10001423613.4342
|
SUCCESS |
|
|
|
I logs: 'Fee calculation', 13.026013
|
SUCCESS |
|
|
|
I ensures that 0 does have value close to 13.026013 ±0.00001
|
FAILURE |
001ms |
|   |
AssertionError: Expected 0 to have value close to 13.026013 ±0.00001
Expectation: isCloseTo(13.026013, 0.00001)
Expected number: 13.026013 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.62s |