aiden / autobot

A Multi-Platform Bot Testing Framework Designed for Humans
MIT License
47 stars 15 forks source link

Add support for multiple attachments #8

Open ecridge opened 6 years ago

ecridge commented 6 years ago

This changeset allows responses to be checked for multiple attachments, sensitive to their number, order, and type. It also allows for the text body sent along with the attachments to be (optionally) checked just like it is for a plain response, and makes it trivial to add support for more attachment types in the future.

The YAML syntax is unchanged (save for the addition of an <OTHER> attachment type as a catch-all), and these changes should be fully backwards compatible. To achieve this, I made two compromises, which I think are fairly natural for users: (1) attachments must come at the end of the message spec; and (2) the text body of a response is not checked if the message spec consists only of attachments.

ecridge commented 6 years ago

@lingz one area I could use your input on is how to make sure that the output is still friendly when a response fails to match

lingz commented 6 years ago

Hey Joe,

Thanks a lot for this, I will do a full review tomorrow but cursory inspection looks good. A quick idea I have would be,

Attachment mismatch:
Expected: 2 Images, 1 Button
Got: No Attachments

Something like this might work?