如何使用Angular Harness获得输入的值?我试着这样做:
readonly name = this.locatorFor('input');
async getName(): Promise<string> {
return (await this.name()).text();
}我总是得到空值
1) ComponentHarness should locate a required element based on CSS selector
- Expected '' to be 'test1'.发布于 2020-05-10 17:59:21
所以我找到了答案,尽管你已经输入了像input.clear()这样的特定函数,以获得你需要使用的值:
readonly name = this.locatorFor('input');
async getName(): Promise<string> {
return (await this.name()).getProperty('value');
}要了解有关如何使用angular harness的更多信息,建议您查看Angular Material的github
Here我找到了我的答案
https://stackoverflow.com/questions/61704016
复制相似问题