-
-
Notifications
You must be signed in to change notification settings - Fork 752
Expand file tree
/
Copy pathattachFile.mustache
More file actions
17 lines (14 loc) · 934 Bytes
/
attachFile.mustache
File metadata and controls
17 lines (14 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Attaches a file to element located by label, name, CSS or XPath
Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
File will be uploaded to remote system (if tests are running remotely).
The third parameter is an optional context (CSS or XPath locator) to narrow the search.
```js
I.attachFile('Avatar', 'data/avatar.jpg');
I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
// within a context
I.attachFile('Avatar', 'data/avatar.jpg', '.form-container');
```
@param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
@param {string} pathToFile local file path relative to codecept.conf.ts or codecept.conf.js config file.
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
@returns {void} automatically synchronized promise through #recorder