Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multipart multipart/form-data and file upload #22

Open
mantishK opened this issue Feb 19, 2016 · 7 comments
Open

Support for multipart multipart/form-data and file upload #22

mantishK opened this issue Feb 19, 2016 · 7 comments
Labels

Comments

@mantishK
Copy link

Support multipart data and uploading file as a form parameter in POST and PUT methods.
There can be a folder that contains all the files that will be uploaded while testing, this path can be set as an argument while running silk.
The names of the file mentioned in the markdown could be relative to this folder. We can add a comment after the field that the filed is a file field and it's value is a file path.

name: Mat
CV: CV/mat-cv.pdf // file
@mantishK mantishK changed the title Support for multipart data and file upload Support for multipart multipart/form-data and file upload Feb 19, 2016
@matryer
Copy link
Owner

matryer commented Feb 21, 2016

I think a link to the file will be good.

[field_name](/path/to/file)
  • field_name - the name of the field to update with
  • /path/to/file - the path to the file to upload

How does that sound? It means that, when rendered, the user could even preview the file.

@mantishK
Copy link
Author

It means that the files to be uploaded while testing will have to be in a repo/server and the files need to be public. This may not always be the case, correct? Also, while testing, silk will download each file and then upload them. It may consume a lot of time if there are too many files/tests. It would be great if we keep the link and have some way of overriding the base path that contains the files to be uploaded. Your thoughts?

@matryer
Copy link
Owner

matryer commented Feb 22, 2016

Silk runs locally (so far) so the files would be nearby, I think they would only get uploaded, and probably to a local server. I think selective test running will help people avoid long-running tests, as would have to be the case anyway.

@mantishK
Copy link
Author

If we are giving local file path, then there are no issues as far as the working of silk is considered. Wouldn't it be hard to share the test docs to others? By hard, I mean, due to local path, the links may not open on other machines.

@matryer
Copy link
Owner

matryer commented Feb 23, 2016

I'm thinking you'd have this:

/tests
  /files
    image1.png
  /silk
    thumbnails.silk.md
      (would mention `../files/image1.png`)

So the files would go alongside the test files. For bigger files, a script to download the files into the correct place might be sensible, but out of scope of Silk.

How does that sound?

@mantishK
Copy link
Author

Sounds good.

@davidbgk
Copy link

I don't know Go at all but I can test a branch and provide some feedback once the feature is implemented given that I'll need it for a project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants