0

I've got a chat application I'm doing Gherkin for and one of the features I'll be adding is the ability to send images of various types, I just don't know how to write this up. Could it be?

Given the following users exist:
| Username |
| Alice    |
| Bob      |
When "Alice" sends "Bob" "Image A"
Then "Bob" can see "Image A"

Is "Image A" the url to the image? And, if it is, where does the image reside for the test itself?

TheMightyLlama
  • 1,243
  • 1
  • 19
  • 51
  • This is a common programming problem where you need to store image location in a variable and pass that variable as argument. You can pass that variable name from gherkin feature file. See Here for storing file location, hope this helps: http://stackoverflow.com/questions/3309899/how-to-pass-a-text-file-as-a-argument – Abir Khan Sep 07 '16 at 09:01
  • @AbirKhan From what you describe I'd need a separate folder containing actual images to test and reference those as "featureimages/imagea.jpg/". Thanks. Feel free to stick this as an answer. I'll accept it. – TheMightyLlama Sep 07 '16 at 10:35
  • Thanks @TheMightyLIama. Added answer as you suggested. – Abir Khan Sep 07 '16 at 12:14

1 Answers1

1

This is a common programming problem where you need to store image location in a variable and pass that variable as argument. You can pass that variable name from gherkin feature file. See Here for storing file location, hope this helps:

How to pass a text file as a argument?

Community
  • 1
  • 1
Abir Khan
  • 119
  • 8