Подтвердите пустое текстовое поле в testcafe - PullRequest
0 голосов
/ 09 апреля 2020

Я проверяю, пустое текстовое поле или нет. Я не уверен, что я делаю здесь не так.

Page Object method
async getTextVal(){
  await this.t.selectText(this.editor) //selecting the text box
  return this.editor.innerText; //fetching the value in the textbox      
}
TestCase
await t.expect(element.getTextVal()).eql(''); //assert statement

getTextVal работает нормально, если присутствует значение. Но проверка пустого значения не удается

1 Ответ

1 голос
/ 09 апреля 2020

попробуй

Page Object method
async getTextVal(){
  await this.t.selectText(this.editor) //selecting the text box
  return await this.editor.innerText; //fetching the value in the textbox      
}
TestCase
await t.expect(await element.getTextVal()).eql(''); //assert statement
...