0
次のメソッドは、データテーブルを通過させ、アサーションを実行しないで、自動的にキュウリステップを通過するものをアサートしないためです。分度器:getText()が実行されていないときの.then
Then(/^the following <fields> are displayed in the Method Information panel$/, (table) => {
var hashes = table.hashes();
var expectedValues: string[] = new Array();
return hashes.forEach(function (hash) {
console.log("In For Each");
expectedValues.push(hash.fields);
var index = expectedValues.length - 1;
console.log(expectedValues[index])
expectedValues[index] = expectedValues[index].replace(' ', '');
return element(by.id("label" + expectedValues[index])).getText()
.then(function (actualValues) {
console.log("In Then:" + actualValues);
report.takeScreenshot();
return expecting(actualValues).to.deeply.equal(expectedValues[index]);
}, function (err) {
report.logError("An error occurred while comparing values." + err);
});
}, function (err) {
report.logError("An error occurred while comparing values." + err);
});
});
コンソールログには、次のようになります。あなたがライン上でリターンを削除した場合
In For Each
Name
In For Each
Description
In For Each
Type
In For Each
Instrument System
√ Then the following <fields> are displayed in the Method Information panel
| fields |
| Name |
| Description |
| Type |
| Instrument System |
で何かを得る両方のリターンを取り除かないと、それはまだ、その後にはなりません。私は個々のリターンを個別に取り除きましたが、それでもそれには入りません。 – cpegs
getText()を切り替えても助けにならなかった – cpegs
あなたは本当ですか**要素(by.id( "label" + expectedValues [index]))**何かを探しますか? ところで、私は見たことがありません**予想**の代わりに**期待して**。キュウリなの?また、私は期待に戻りません。それは必要ですか ? – bwarff