This project allows Zalenium to store test artifacts eg: screenshots, videos to a S3 bucket. Most of the code is based on adrichem artifact-store that allows the same but for Azure Blob Storage.
Post a multipart file upload to the / endpoint and the 'artifact-store' does the following:
- Saves each file on AWS S3.
- Generates metadata for each file (url, originalname, mime-type)
- If you included a key called 'metadata' in the form, its content is treated as a JSON object and included in the metadata.
- Stores the metadata on AWS S3.
- Sends the metadata to Elasticsearch for indexing.
You first need to have Node.js installed (version 8.9.0 or greater) and run npm install
to resolve the dependencies.
Running the artifact-store is quite simple, just supply it your AWS access key and specify the asset and metadata buckets that you created in S3.
node index.js --access-key $AWS_ACCESS_KEY_ID \
--secret-key $AWS_SECRET_ACCESS_KEY \
--region $AWS_REGION \
--asset-bucket $AWS_ASSET_BUCKET \
--metadata-bucket $AWS_ASSET_METADATA_BUCKET
Testing sending data to S3 via artifact-store is also quite straightforward, here is a CURL multipart example:
curl -X POST \
http://127.0.0.1:4000 \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Postman-Token: 300521a6-0fc8-4051-bb9a-54ba58ee7b64' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F files=@/file-path/filename.jpg
If you have a specific feature request or if you found a bug, please use GitHub issues. Fork this project and send a pull request with improvements.