frostfs-testcases/robot/testsuites/integration/payment/withdraw.robot

57 lines
2.3 KiB
Text
Raw Normal View History

2020-11-29 04:28:01 +00:00
*** Settings ***
Variables common.py
2020-11-29 04:28:01 +00:00
Library payment_neogo.py
Library utility_keywords.py
2020-11-29 04:28:01 +00:00
Resource setup_teardown.robot
*** Variables ***
${DEPOSIT_AMOUNT} = ${10}
${WITHDRAW_AMOUNT} = ${10}
${TRANSFER_AMOUNT} = ${15}
2020-11-29 04:28:01 +00:00
*** Test cases ***
2020-11-29 04:30:45 +00:00
NeoFS Deposit and Withdraw
2020-11-29 04:28:01 +00:00
[Documentation] Testcase to validate NeoFS Withdraw operation.
[Timeout] 10 min
${WALLET} ${ADDR} ${_} = Generate Wallet
2020-11-29 04:28:01 +00:00
##########################################################
# Transferring GAS from initial wallet to our test wallet
##########################################################
Transfer Mainnet Gas ${WALLET} ${TRANSFER_AMOUNT}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
############################
# Making deposit into NeoFS
############################
NeoFS Deposit ${WALLET} ${DEPOSIT_AMOUNT}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
${EXPECTED_BALANCE} = Evaluate ${TRANSFER_AMOUNT}-${DEPOSIT_AMOUNT}
Should Be True ${MAINNET_BALANCE} < ${EXPECTED_BALANCE}
${NEOFS_BALANCE} = Get NeoFS Balance ${WALLET}
Should Be Equal As Numbers ${NEOFS_BALANCE} ${DEPOSIT_AMOUNT}
2020-11-29 04:28:01 +00:00
# TODO: try to withdraw more than was deposited
2020-11-29 04:28:01 +00:00
###########################
# Withdrawing deposit back
###########################
Withdraw Mainnet Gas ${WALLET} ${WITHDRAW_AMOUNT}
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
${NEOFS_BALANCE} = Get NeoFS Balance ${WALLET}
${EXPECTED_BALANCE} = Evaluate ${DEPOSIT_AMOUNT} - ${WITHDRAW_AMOUNT}
Should Be Equal As numbers ${NEOFS_BALANCE} ${EXPECTED_BALANCE}
${MAINNET_BALANCE_AFTER} = Get Mainnet Balance ${ADDR}
${MAINNET_BALANCE_DIFF} = Evaluate ${MAINNET_BALANCE_AFTER} - ${MAINNET_BALANCE}
Should Be True ${MAINNET_BALANCE_DIFF} < ${WITHDRAW_AMOUNT}