OpenVeo test API

API Docs for: 8.0.0
Show:

TagsField

Extends Field
Module: e2e

Summary

Defines a form tags field.

Use Field.get method to get an instance of TagsField.

Constructor

TagsField

Syntax

TagsField

(
  • conf
)

Summary

Parameters:

  • conf Object

    A field configuration object

Example:

var Field = require('@openveo/test').e2e.fields.Field;

var TagsField = Field.get({
  type: 'tags',
  name: 'My field',
  baseElement: element(by.css('form'))
});

Methods

clear

Inherited from Field but overwritten in lib/e2e/fields/TagsField.js:184

Syntax

clear

() Promise

Summary

Clears field value by removing all tags.

Returns:

Promise:

Promise resolving when the field is cleared

Example:

myField.clear().then(function() {
  console.log('Field cleared');
});

getDescription

Syntax

getDescription

() Promise

Summary

Gets field description.

Returns:

Promise:

Promise resolving with the description

Example:

myField.getDescription().then(function(description) {
  console.log('Field description is : ' + description);
});

getElement

Syntax

getElement

() Promise

Summary

Gets field element wrapper.

Look for a form element label and return its parent.

Returns:

Promise:

Promise resolving with the element

getErrorMessage

Syntax

getErrorMessage

() Promise

Summary

Gets field error message.

Returns:

Promise:

Promise resolving with the error message

Example:

myField.getErrorMessage().then(function(errorMessage) {
  console.log('Error message : ' + errorMessage);
});

getLabel

Syntax

getLabel

() Promise

Summary

Gets field label.

Returns:

Promise:

Promise resolving with the label

Example:

myField.getLabel().then(function(label) {
  console.log('Field label is : ' + label);
});

getText

Syntax

getText

() Promise

Summary

Gets field text representation in case of an inline editable field.

Returns:

Promise:

Promise resolving with field text representation

Example:

myField.getText().then(function(text) {
  console.log(text);
});

getValue

Inherited from Field but overwritten in lib/e2e/fields/TagsField.js:80

Syntax

getValue

() Promise

Summary

Gets field values, the list of tags.

Returns:

Promise:

Promise resolving with the list of tags

Example:

myField.getValue().then(function(tags) {
  console.log(tags);
});

isOnError

Inherited from Field but overwritten in lib/e2e/fields/TagsField.js:212

Syntax

isOnError

() Promise

Summary

Tests if a field is considered as on error.

Returns:

Promise:

Promise resolving with a boolean indicating if the field is on error

Example:

myField.isOnError().then(function(isOnError) {
  console.log('Is field on error ? ' + isOnError);
});

selectTagInAutoComplete

Syntax

selectTagInAutoComplete

(
  • The
)
Promise private

Summary

Selects a tag in auto complete.

Parameters:

  • The String

    value of the tag to select in the auto complete. It should be the same value as the one in the available options

Returns:

Promise:

Promise resolving when given tag has been selected in auto complete

setValue

Inherited from Field but overwritten in lib/e2e/fields/TagsField.js:113

Syntax

setValue

(
  • [values=[]]
)
Promise

Summary

Sets field value.

Parameters:

  • [values=[]] Array optional

    Field's list of tags

Returns:

Promise:

Promise resolving when the field is filled

Example:

myField.setValue(['tag 1', 'tag 2']).then(function() {
  console.log('Value set');
});

setValueUsingAutoCompletion

Syntax

setValueUsingAutoCompletion

(
  • [values=[]]
)
Promise

Summary

Sets field value using auto completion.

Parameters:

  • [values=[]] Array optional

    Field's list of tags

Returns:

Promise:

Promise resolving when the field is filled

Example:

myField.setValueUsingAutoCompletion(['tag 1', 'tag 2']).then(function() {
  console.log('Value set');
});

Properties

availableOptions

Syntax

availableOptions

Array

Summary

The list of available options.

baseElement

Syntax

baseElement

ElementFinder final

Summary

Element from where to look for the field (typically the form element).

name

Syntax

name

String final

Summary

Field label.