-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.robot
More file actions
21 lines (20 loc) · 945 Bytes
/
requests.robot
File metadata and controls
21 lines (20 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
*** Settings ***
Library RequestsLibrary
Documentation This is a test suite for the RequestsLibrary which connects
... to the github.com API and retrieves user information.
*** Test Cases ***
Example with RequestsLibrary
# Connect to the GitHub API and create a session
Create Session github https://api.github.com
# Read user information
${resp} GET On Session github /users/octocat
# Validate the response
Should Be Equal As Strings ${resp.status_code} 200
# Convert the response to a JSON object
VAR ${json} ${resp.json()}
# Do more assertions
Should Be Equal As Strings ${json["login"]} octocat
Should Be Equal As Strings ${json["type"]} User
Should Be Equal As Strings ${json["name"]} The Octocat
Should Be Equal As Strings ${json["blog"]} https://github.blog
Should Be Equal As Strings ${json["location"]} San Francisco