Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
18 kB
3
Indexable
Never
 #ps1.ducvm
  @PS1-85862
  Scenario Outline: [BE][API][Update Customer Profile] Update email, address user 200
    * def username = <userAcc>
    # get access token
    * def signIn = call read('classpath:src/test/java/tcb/features/common/GetTokenLoginMobile.feature') {username: #(username), password: <Pass>}
    * def access_token = signIn.access_token
    * print 'Access Token ', access_token
    # config request and response
    * url baseUrl
    * def headerSet = 'Bearer ' + access_token
    # config header
    * configure headers = {Authorization : '#(headerSet)',Content-Type : 'application/json'}
    * table inPutApi
      | field      |
      | 'gCountry' |
    # call api get before transaction
    * def callGetCustomerApiCheckVerify = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    # call api get provinces
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces'
    * method get
    * print response
    # get array number response provices
    * def detailProvide = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
    # get list random provide
    # call api get districts
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces/' + detailProvide[1] + '/districts'
    * method get
    * def detailDistrict = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
        # get list random District
    * def randomString = Java.type('tcb.utils.external.Helper').randomEmail()
    * def randomAddress = Java.type('tcb.utils.external.Helper').stressAddress()
    * def country = 'VN'
    # CALL API PUT
    * def bodyJson = Java.type('tcb.utils.external.JSONSchemaUtil').updateEmailAddressJson(randomString,randomAddress,country,detailProvide[1],detailProvide[0],detailDistrict[1],detailDistrict[0])
    * request bodyJson
    * path '/api/user-manager-dis/client-api/v2/customers/me'
    * method put
    # save value response apo put
    * string scope = 'openid ' + response.challenges[0].scope
    * def xsrf_token = responseCookies['XSRF-TOKEN'].value
    * def confirmationId = response.data.confirmationId
    * print 'confirmationId ==> ', response.data.confirmationId

    #  START TRANSACTION SINGNING
    * def trxnSigning = call read('classpath:src/test/java/tcb/features/common/TransactionSigning.feature') { access_token : #(access_token) , username: #(username), confirmationId: #(confirmationId), trxnObject: "updateUser", scope : #(scope)}
    # get status transaction
    * path '/api/user-manager-dis/client-api/v1/customers/update-status/' + confirmationId
    * method get
    # call api get after transaction
    * def callGetCustomerApiCheckVerifyAfter = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    * match callGetCustomerApiCheckVerify.response.email != callGetCustomerApiCheckVerifyAfter.response.email
    # action call db
    * def call_DB = Java.type('tcb.utils.external.DbUtils')
    * def db = new call_DB('bbase_180')
    * def query = "select * from USER_ADDITIONAL_DATA.CUSTOMER where  USER_NAME = <userAcc>"
    * def result = db.readRow(query)
    * print 'result on db verify' + result.ADDITIONS
    * def jsonNode = Java.type('tcb.utils.external.Helper')
    * def readJsonStreet = new jsonNode().readJSonNode(callGetCustomerApiCheckVerifyAfter.response.additions,'gStreet')
    # verify email api and email on db
    * match callGetCustomerApiCheckVerifyAfter.response.email == result.EMAIL
    * def jsonOnDbGstreet = new jsonNode().readJSonNode(result.ADDITIONS,'gStreet')
    # veruft street
    * match readJsonStreet == jsonOnDbGstreet
    # call db check verify t24
#    * def dbt24 = new call_DB('t24')
#    * def queryT24 = "select * from t24live.v_FBNK_CUSTOMER where CUSTOMER_CODE = <userAcc>"
#    * def resultT24 = dbt24.readRow(queryT24)
#    * print 'result on db verify T24 Db' + resultT24

     # call api get after transaction after db update
    * def callGetCustomerApiCheckVerifyAfterDb = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    * match callGetCustomerApiCheckVerifyAfterDb.response.email == result.EMAIL
    * def readJsonStreetAfterDbStreet = new jsonNode().readJSonNode(callGetCustomerApiCheckVerifyAfterDb.response.additions,'gStreet')
    * match readJsonStreetAfterDbStreet == jsonOnDbGstreet
    Examples:
      | userAcc      | Pass     |
      | '37037914'   | '1'      |


  @PS1-85729
  Scenario Outline: [BE][API][Update Customer Profile] Update email, address username 203
    * def username = <userAcc>
    # get access token
    * def signIn = call read('classpath:src/test/java/tcb/features/common/GetTokenLoginMobile.feature') {username: #(username), password: <Pass>}
    * def access_token = signIn.access_token
    * print 'Access Token ', access_token
    # config request and response
    * url baseUrl
    * def headerSet = 'Bearer ' + access_token
    # config header
    * configure headers = {Authorization : '#(headerSet)',Content-Type : 'application/json'}
    * table inPutApi
      | field      |
      | 'gCountry' |
    # call api get before transaction
    * def callGetCustomerApiCheckVerify = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    # call api get provinces
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces'
    * method get
    * print response
    # get array number response provices
    * def detailProvide = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
    # get list random provide
    # call api get districts
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces/' + detailProvide[1] + '/districts'
    * method get
    * def detailDistrict = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
        # get list random District
    * def randomString = Java.type('tcb.utils.external.Helper').randomEmail()
    * def randomAddress = Java.type('tcb.utils.external.Helper').stressAddress()
    * def country = 'VN'
    # CALL API PUT
    * def bodyJson = Java.type('tcb.utils.external.JSONSchemaUtil').updateEmailAddressJson(randomString,randomAddress,country,detailProvide[1],detailProvide[0],detailDistrict[1],detailDistrict[0])
    * request bodyJson
    * path '/api/user-manager-dis/client-api/v2/customers/me'
    * method put
    # save value response apo put
    * string scope = 'openid ' + response.challenges[0].scope
    * def xsrf_token = responseCookies['XSRF-TOKEN'].value
    * def confirmationId = response.data.confirmationId
    * print 'confirmationId ==> ', response.data.confirmationId

    #  START TRANSACTION SINGNING
    * def trxnSigning = call read('classpath:src/test/java/tcb/features/common/TransactionSigning.feature') { access_token : #(access_token) , username: #(username), confirmationId: #(confirmationId), trxnObject: "updateUser", scope : #(scope)}
    # get status transaction
    * path '/api/user-manager-dis/client-api/v1/customers/update-status/' + confirmationId
    * method get
    # call api get after transaction
    * def callGetCustomerApiCheckVerifyAfter = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    * match callGetCustomerApiCheckVerify.response.email != callGetCustomerApiCheckVerifyAfter.response.email
    * def call_DB = Java.type('tcb.utils.external.DbUtils')
    * def db = new call_DB('bbase_180')
    * def query = "select * from USER_ADDITIONAL_DATA.CUSTOMER where  USER_NAME = <userAcc>"
    * def result = db.readRow(query)
    * def jsonNode = Java.type('tcb.utils.external.Helper')
    * def readJsonStreet = new jsonNode().readJSonNode(callGetCustomerApiCheckVerifyAfter.response.additions,'gStreet')
    # verify email api and email on db
    * match callGetCustomerApiCheckVerifyAfter.response.email == result.EMAIL
    * def jsonOnDbGstreet = new jsonNode().readJSonNode(result.ADDITIONS,'gStreet')
    # veruft street
    * match readJsonStreet == jsonOnDbGstreet
#    * def dbt24 = new call_DB('t24')
#    * def queryT24 = "select * from t24live.v_FBNK_CUSTOMER where CUSTOMER_CODE = <userAcc>"
#    * def resultT24 = dbt24.readRow(queryT24)
#    * print 'result on db verify T24 Db' + resultT24

     # call api get after transaction after db update
    * def callGetCustomerApiCheckVerifyAfter = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    * print callGetCustomerApiCheckVerifyAfter + 'get customer after db'
    Examples:
      | userAcc      | Pass     |
      | 'bb38058284' | 'Tcb123' |

  @PS1-85730
  Scenario Outline: [BE][API][Update Customer Profile] Update email, address user 202
    * def username = <userAcc>
    # get access token
    * def signIn = call read('classpath:src/test/java/tcb/features/common/GetTokenLoginMobile.feature') {username: #(username), password: <Pass>}
    * def access_token = signIn.access_token
    * print 'Access Token ', access_token
    # config request and response
    * url baseUrl
    * def headerSet = 'Bearer ' + access_token
    # config header
    * configure headers = {Authorization : '#(headerSet)',Content-Type : 'application/json'}
    * table inPutApi
      | field      |
      | 'gCountry' |
    # call api get before transaction
    * def callGetCustomerApiCheckVerify = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    # call api get provinces
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces'
    * method get
    * print response
    # get array number response provices
    * def detailProvide = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
    # get list random provide
    # call api get districts
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces/' + detailProvide[1] + '/districts'
    * method get
    * def detailDistrict = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
        # get list random District
    * def randomString = Java.type('tcb.utils.external.Helper').randomEmail()
    * def randomAddress = Java.type('tcb.utils.external.Helper').stressAddress()
    * def country = 'VN'
    # CALL API PUT
    * def bodyJson = Java.type('tcb.utils.external.JSONSchemaUtil').updateEmailAddressJson(randomString,randomAddress,country,detailProvide[1],detailProvide[0],detailDistrict[1],detailDistrict[0])
    * request bodyJson
    * path '/api/user-manager-dis/client-api/v2/customers/me'
    * method put
    # save value response apo put
    * string scope = 'openid ' + response.challenges[0].scope
    * def xsrf_token = responseCookies['XSRF-TOKEN'].value
    * def confirmationId = response.data.confirmationId
    * print 'confirmationId ==> ', response.data.confirmationId

    #  START TRANSACTION SINGNING
    * def trxnSigning = call read('classpath:src/test/java/tcb/features/common/TransactionSigning.feature') { access_token : #(access_token) , username: #(username), confirmationId: #(confirmationId), trxnObject: "updateUser", scope : #(scope)}
    # get status transaction
    * path '/api/user-manager-dis/client-api/v1/customers/update-status/' + confirmationId
    * method get
    # call api get after transaction
    * def callGetCustomerApiCheckVerifyAfter = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    * match callGetCustomerApiCheckVerify.response.email != callGetCustomerApiCheckVerifyAfter.response.email
    * def call_DB = Java.type('tcb.utils.external.DbUtils')
    * def db = new call_DB('bbase_180')
    * def query = "select * from USER_ADDITIONAL_DATA.CUSTOMER where  USER_NAME = <userAcc>"
    * def result = db.readRow(query)
    * def jsonNode = Java.type('tcb.utils.external.Helper')
    * def readJsonStreet = new jsonNode().readJSonNode(callGetCustomerApiCheckVerifyAfter.response.additions,'gStreet')
    # verify email api and email on db
    * match callGetCustomerApiCheckVerifyAfter.response.email == result.EMAIL
    * def jsonOnDbGstreet = new jsonNode().readJSonNode(result.ADDITIONS,'gStreet')
    # veruft street
    * match readJsonStreet == jsonOnDbGstreet
#    * def dbT24 = new call_DB('bbase_180')
#    * def queryT24 = "select * from t24live.v_FBNK_CUSTOMER where CUSTOMER_CODE = <userAcc>"
#    * def resultT24 = dbT24.readRow(queryT24)
#    * print 'result on db verify T24 Db' + resultT24

     # call api get after transaction after db update
    * def callGetCustomerApiCheckVerifyAfter = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    * print callGetCustomerApiCheckVerifyAfter + 'get customer after db'
    Examples:
      | userAcc      | Pass     |
      | 'bb38058286' | 'Tcb123' |

  @PS1-85731
  Scenario Outline: [BE][API][Update Customer Profile] Update email, address user 205
    * def username = <userAcc>
    # get access token
    * def signIn = call read('classpath:src/test/java/tcb/features/common/GetTokenLoginMobile.feature') {username: #(username), password: <Pass>}
    * def access_token = signIn.access_token
    * print 'Access Token ', access_token
    # config request and response
    * url baseUrl
    * def headerSet = 'Bearer ' + access_token
    # config header
    * configure headers = {Authorization : '#(headerSet)',Content-Type : 'application/json'}
    * table inPutApi
      | field      |
      | 'gCountry' |
    # call api get before transaction
    * def callGetCustomerApiCheckVerify = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    # call api get provinces
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces'
    * method get
    * print response
    # get array number response provices
    * def detailProvide = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
    # get list random provide
    # call api get districts
    * path '/api/tcb-bo-account-bundle/client-api/v1/locations/provinces/' + detailProvide[1] + '/districts'
    * method get
    * def detailDistrict = call read('classpath:src/test/java/tcb/utils/internal/CallListProvideDistrict.js'){RandomNum:'#(response.length)',response_get:'#(response)'}
        # get list random District
    * def randomString = Java.type('tcb.utils.external.Helper').randomEmail()
    * def randomAddress = Java.type('tcb.utils.external.Helper').stressAddress()
    * def country = 'VN'
    # CALL API PUT
    * def bodyJson = Java.type('tcb.utils.external.JSONSchemaUtil').updateEmailAddressJson(randomString,randomAddress,country,detailProvide[1],detailProvide[0],detailDistrict[1],detailDistrict[0])
    * request bodyJson
    * path '/api/user-manager-dis/client-api/v2/customers/me'
    * method put
    # save value response apo put
    * string scope = 'openid ' + response.challenges[0].scope
    * def xsrf_token = responseCookies['XSRF-TOKEN'].value
    * def confirmationId = response.data.confirmationId
    * print 'confirmationId ==> ', response.data.confirmationId

    #  START TRANSACTION SINGNING
    * def trxnSigning = call read('classpath:src/test/java/tcb/features/common/TransactionSigning.feature') { access_token : #(access_token) , username: #(username), confirmationId: #(confirmationId), trxnObject: "updateUser", scope : #(scope)}
    # get status transaction
    * path '/api/user-manager-dis/client-api/v1/customers/update-status/' + confirmationId
    * method get
    # call api get after transaction
    * def callGetCustomerApiCheckVerifyAfter = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0]
    * match callGetCustomerApiCheckVerify.response.email != callGetCustomerApiCheckVerifyAfter.response.email
    * def call_DB = Java.type('tcb.utils.external.DbUtils')
    * def db = new call_DB('bbase_180')
    * def query = "select * from USER_ADDITIONAL_DATA.CUSTOMER where  USER_NAME = '37037914'"
    * def result = db.readRow(query)
    * print 'result on db verify' + result.ADDITIONS
    # call db check verify
    * def objectDb = Java.type('tcb.utils.external.Helper')
    * def valueJson = new objectDb().readJSonNode(result.ADDITIONS,'gCountry')
    * print valueJson + 'check valuejson'

     # call api get after transaction after db update
    * def callGetCustomerApiCheckVerifyAfter = call read('classpath:src/test/java/tcb/features/services/roc-user-manager-dis/get-customer-me.feature@customerDetails') inPutApi[0][0]
    * print callGetCustomerApiCheckVerifyAfter + 'get customer after db'
    Examples:
      | userAcc      | Pass     |
      | 'bb828491'   | 'Tcb123' |