-
-
Notifications
You must be signed in to change notification settings - Fork 751
Expand file tree
/
Copy pathfillField.mustache
More file actions
21 lines (19 loc) · 902 Bytes
/
fillField.mustache
File metadata and controls
21 lines (19 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Fills a text field or textarea, after clearing its value, with the given string.
Field is located by name, label, CSS, or XPath.
The third parameter is an optional context (CSS or XPath locator) to narrow the search.
```js
// by label
I.fillField('Email', 'hello@world.com');
// by name
I.fillField('password', secret('123456'));
// by CSS
I.fillField('form#login input[name=username]', 'John');
// or by strict locator
I.fillField({css: 'form#login input[name=username]'}, 'John');
// within a context
I.fillField('Name', 'John', '#section2');
```
@param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
@param {CodeceptJS.StringOrSecret} value text value to fill.
@param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
@returns {void} automatically synchronized promise through #recorder