Files
File upload
The File upload step registers an event listener to automatically upload a file when the native file picker dialog is opened. This step must be executed before the file picker dialog is opened, otherwise it will not work.
Cloud-hosted files
You can upload files to Momentic that are private and not accessible to the public.
Select Files on the left sidebar and click on the Upload file button in the top-right corner. You can upload any file type, including images, documents, and more.
Public files
Make sure the URL you provide is a direct link to the file. For example, if
you want to upload an image, the URL should end with .jpg
, .png
, or
another image file extension. If the URL does not point directly to a file,
Momentic will not be able to access it.
You can upload any files that has a publicly accessible URL. For example, this is a URL for a README.md
file of a public repository on GitHub:
https://raw.githubusercontent.com/momentic-ai/momentic/main/README.md
Local files
If you’re using the Momentic CLI, you can also upload files from your local machine.
Local files can be referenced by path. The path must be absolute or relative the the root momentic.config.yaml
.
File download
You can download a file in a Momentic test by using a Click step and configuring the Wait for download option. This will wait for the file to be downloaded before proceeding to the next step. The default download timeout is 10 seconds.
Current limitations:
- Only one file can be downloaded per step.
- The maximum supported size is 50mb.
- Direct file manipulation (e.g., checking file names or formats) is not supported.