【发布时间】:2019-06-23 07:47:23
【问题描述】:
[![我有一个表格,其中有多行和 5 列,我正在尝试查找电子邮件 ID,然后在电子邮件可用时返回状态。这是代码 文件 A
async function checkInviteUserStatus(xyz) {
const tablecontent = this.getTableContent();
const rows = tablecontent.all(by.tagName('tr'));
let ind: number;
return new Promise(_ => {
rows.each((tr, index) => {
const cols = tr.all(by.tagName('td'));
let rowindex = false;
cols.each((td, i) => {
td.getText().then(text => {
if (text === emailId) {
rowindex = true;
ind = i;
}
if (rowindex) {
if (i === ind + 1) {
console.log('Entering worked');
console.log('status entered test' + text); // prints correct value here
resolve(text);
}
}
});
});
});
});
}
await `enter code here`
myProfile.checkInviteUserStatus('test12.535116665229136@test.com').then(t => {
console.log('testing ' + t);
});
【问题讨论】:
-
粘贴代码,选择,使用
Ctrl + K或{}按钮格式化。
标签: angular protractor angular6 ui-automation