MarketSquare / MarketSquare/robotframework-camunda

Use robot.utils.DotDict instead of dict

Open
#79 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
18
Forks
6
PR merge metrics
No merged PRs in 30d

Description

robot.utils.DotDict supports dot-notation in order to access values in dictionaries: `${process.id}` instead of only `${process}[id]`

```python
from robot.utils import DotDict

@keyword("Get fetch response", tags=['task'])
def get_fetch_response(self):
"""Returns cached response from the last call of `fetch workload`.

The response contains all kind of data that is required for custom REST Calls.

Example:
| *** Settings *** |
| *Library* | RequestsLibrary |
| |
| *** Tasks *** |
| | *Create Session* | _alias=camunda_ | _url=http://localhost:8080/_ |
| | ${variables} | *fetch workload* | _my_first_task_in_demo_ | |
| | ${fetch_response} | *get fetch response* | | |
| | *POST On Session* | _camunda_ | _engine-rest/external-task/${fetch_response}[id]/complete_ | _json=${{ {'workerId': '${fetch_response}[worker_id]'} }}_ |
"""
if self.FETCH_RESPONSE:
return DotDict(self.FETCH_RESPONSE.to_dict())
return self.FETCH_RESPONSE
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the get_fetch_response entry point shown in the issue and inspect how FETCH_RESPONSE is converted before being returned. Verify that the returned value supports dot notation such as `${fetch_response.id}` as well as the existing dictionary access, then check the related issue or pull request history for the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.