Skip to content

Commit

Permalink
TIDO-347 Upgrade robot framework
Browse files Browse the repository at this point in the history
  • Loading branch information
dshafer committed Apr 4, 2022
1 parent 7851eb7 commit e6fcb9c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 37 deletions.
20 changes: 10 additions & 10 deletions MDQ.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ Library RequestsLibrary
*** Keywords ***
Get All Entities
[Arguments] ${baseUrl}
Create Session alias=md url=${baseUrl}
${resp}= Get Request alias=md uri=entities
Create Session md ${baseUrl}
${resp}= GET On Session md /entities
[Return] ${resp}

Get Entity
[Arguments] ${baseUrl} ${identifier}
Create Session alias=md url=${baseUrl}
${resp}= Get Request alias=md uri=/entities/${identifier}
[Arguments] ${baseUrl} ${identifier} ${expectedStatus}=200
Create Session md ${baseUrl}
${resp}= GET On Session md /entities/${identifier} expected_status=${expectedStatus}
[Return] ${resp}

Get Entity With Gzip
[Arguments] ${baseUrl} ${identifier}
Create Session alias=md url=${baseUrl}
&{headers}= Create Dictionary Accept-Encoding=gzip
${resp}= Get Request alias=md uri=entities/${identifier} headers=${headers}
Create Session md ${baseUrl}
&{headers}= Create Dictionary Accept-Encoding=gzip
${resp}= GET On Session md /entities/${identifier} headers=${headers}
[Return] ${resp}

Conditional Get Entity
[Arguments] ${baseUrl} ${identifier} ${etag}
&{headers}= Create Dictionary If-None-Match=${etag}
Create Session alias=md url=${baseUrl}
${resp}= Get Request alias=md uri=/entities/${identifier} headers=${headers}
Create Session md ${baseUrl}
${resp}= GET On Session md /entities/${identifier} headers=${headers}
[Return] ${resp}
44 changes: 21 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,46 @@ See also:

## Getting Started

1. Install Robot Framework (see https://github.com/robotframework/robotframework/blob/master/INSTALL.rst)
1. Clone this repository:

2. Install Requests library: `pip install robotframework-requests`
```sh
git clone https://github.internet2.edu/internet2/md-query-saml-uat.git
```

3. Clone this repository:
```
git clone https://github.internet2.edu/internet2/md-query-saml-uat.git
```
2. Copy `variables.py.example` to `variables.py`:

4. Copy `variables.py.example` to `variables.py`: `cp variables.py.example variables.py`
```sh
cp variables.py.example variables.py
```

5. Edit `variables.py` for your environment.
3. Edit `variables.py` for your environment.

6. Run the test suite:
```
robot --noncritical optional .
```
4. Run the test suite:

```sh
robot --noncritical optional .
```

## Usage

Run all test cases in the current directory:
```

```sh
robot .
```

Treat any test cases tagged with `optional` as noncritical:
```
robot --noncritical optional .

```sh
robot --skiponfailure optional .
```

Additionally skip long-running test cases (those that download and parse all
entities):
```
robot --noncritical optional --exclude aggregate .
```


## To Do

1. Isolate Python dependencies with `virtualenv` or similar.

```sh
robot --skiponfailure optional --exclude aggregate .
```

## Contributing

Expand Down
3 changes: 1 addition & 2 deletions md-query-saml.robot
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Variables variables.py
Should Be Equal As Strings ${resp.status_code} 200 msg=MUST respond to SHA-1 transformed identifier

3.1.1 No Entity Descriptors Returned
${resp}= Get Entity baseUrl=${BASE_URL} identifier=foo
Should Be Equal As Strings ${resp.status_code} 404 msg=MUST return HTTP status code 404
${resp}= Get Entity baseUrl=${BASE_URL} identifier=foo expectedStatus=404

3.1.2 One Entity Descriptor Returned
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Expand Down
3 changes: 1 addition & 2 deletions md-query.robot
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ Variables variables.py
# "The responder SHOULD also include cache control information with 404 Not
# Found responses. This allows the requester to create and maintain a
# negative-response cache."
${resp}= Get Entity baseUrl=${BASE_URL} identifier=foo
Should Be Equal As Strings ${resp.status_code} 404
${resp}= Get Entity baseUrl=${BASE_URL} identifier=foo expectedStatus=404
Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header with Not Found response
# "When cache controls are used only the 'max-age' directive SHOULD be used."
${directive}= Get From Dictionary ${resp.headers} cache-control
Expand Down

0 comments on commit e6fcb9c

Please sign in to comment.