asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://pypi.org/project/RESTinstance
GNU Lesser General Public License v3.0
205 stars 84 forks source link

Assertion keyword has impact on the next one called in sequence #73

Closed Tset-Noitamotua closed 2 years ago

Tset-Noitamotua commented 5 years ago

image

Then called in sequence the first keyword has an impact on the second.

String   response body 0 templateId  minimal_instruction.en.v1
Array    response body

Question: Is this intended?

asimell commented 3 years ago

This is not intended behaviour. We'll take a look if we can reproduce this and fix it.

Atihinen commented 3 years ago

Couldn't reproduce with this one https://github.com/eficode/RESTinstance/blob/issue_73/atest/validations.robot#L25

asimell commented 3 years ago

I managed to reproduce this and looks like this fixes the issue. We'll create a PR for that to the Eficode fork once we've written proper unit tests and then create a release PR to this repository.

asimell commented 2 years ago

@Tset-Noitamotua As a workaround you can use skip=true as the last argument in your Array keyword to prevent it validating the schema.

I'm still working on an actual solution for this.

asimell commented 2 years ago

The commit I linked earlier did indeed fix this particular issue, but broke something else in the library, so had to revert that change. Moving this from 1.2.0 release to a future release.

Workaround: Use skip=true to avoid evaluating schema when using assertion keywords.

asimell commented 2 years ago

I created https://github.com/eficode/RESTinstance/pull/19 to fix this issue. The problem was self.request["auth"] which prevented the use of deepcopy.

asimell commented 2 years ago

PR is merged. The fix will be available in 1.3.0 release, which we aim to do at the beginning of February. Closing this issue for now.