Skip to content

Commit

Permalink
add robot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thykof committed Jan 5, 2024
1 parent 4395f67 commit 2915db8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/test/robot_tests/cmd/keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ${WALLET_PLUGIN_VERSION} v0.3.0
*** Keywords ***
Suite Setup
Basic Suite Setup
Switch To Buildnet
Init SC build environment
${GITHUB_ACTIONS} Get Environment Variable GITHUB_ACTIONS false
IF "${GITHUB_ACTIONS}" == "true"
Expand Down
6 changes: 6 additions & 0 deletions api/test/robot_tests/keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ Get SC address
${words}= Split String ${string} :
${sc_address}= Get From List ${words} 1
RETURN ${sc_address}

Switch To Buildnet
${response}= POST
... ${API_URL}/network/buildnet
... expected_status=${STATUS_OK}
Should Be Equal ${response.json()['currentNetwork']} buildnet
26 changes: 26 additions & 0 deletions api/test/robot_tests/network/network.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*** Settings ***
Library RequestsLibrary
Resource ../keywords.resource
Resource ../variables.resource

*** Test Cases ***
GET /network
${response}= GET
... ${API_URL}/network
... expected_status=${STATUS_OK}
Should Be Equal ${response.json()['currentNetwork']} buildnet

GET /massa/node
${response}= GET
... ${API_URL}/massa/node
... expected_status=${STATUS_OK}
Should Be Equal ${response.json()['network']} buildnet

POST /network/mainnet
${response}= POST
... ${API_URL}/network/mainnet
... expected_status=${STATUS_OK}
Should Be Equal ${response.json()['currentNetwork']} mainnet

# Switch back to buildnet for other tests
Switch to buildnet

0 comments on commit 2915db8

Please sign in to comment.