两个 类 in one input 无法发送密钥

Two classes in one input unable to send keys

我有以下输入

<input type="text" class="input-small note-editable"/>

我如何才能访问该输入以发送密钥? 到目前为止我正在尝试这个:

this.inputForm = element(by.css('.input-small .note-editable'));

this.inputForm = element(by.css('.input-small'));
this.inputForm2 = this.inputForm.element(by.css('.note-editable'));

但是没用,有什么建议吗?

您需要为 类 选择器,而不是后续元素,因此请尝试:

this.inputForm = element(by.css('.input-small.note-editable'));

有关更多示例/讨论,请参阅 CSS Selector that applies to elements with two classes