I.upload

Upload a file.

Usage

I.upload(field, pathToFile)
Parameter Type Remarks
field string Keyword to identify the file upload field
pathToFile string Path to the file to upload.
Currently, only absolute paths from the project root are supported.

Example

Here, we will use this "Photo" file upload field for illustration.

Project:

In our project, we have created a 'photos' directory and uploaded 'cat.png' and 'dog.png'.

-- [myproject]
   |-- photos
       |-- cat.png
       |-- dog.png
   |-- login_test
   |-- profile_test

Click on the "plus" sign in toolbar of the project directory to open the file upload dialog.

Test:

I.upload('Photo', 'photos/cat.png');

This uploads the "photos/cat.png" to the "Photos" file field.