I am trying to implement testing for POST request to upload file(image, pdf). My feature file is as follows:
Given path 'files' * multipart file fileUpl = { read: 'img1.jpeg', filename: 'img1.jpeg' } * multipart field destination = "posts" When method post Then status 200
The file is being picked up correctly but it is not picking up destination field value.
RESPONSE:
Mixed: content-disposition: form-data; name="fileUpl"; filename="img1.jpeg" content-type: image/jpeg; charset=UTF-8 content-length: 757770 Completed: true IsInMemory: false RealFile: /Users/deepanshu/Desktop/NoonCode/nimble/automation/target/test-classes/apiTests/files/img1.jpeg DefaultDeleteAfter: true
content-disposition: form-data; name="destination"; filename="" content-type: text/plain; charset=UTF-8 content-length: 5 Completed: true IsInMemory: true
How we can pass on field with values in above case.