0
UIテストを実行すると、次のエラーが発生します。私はJavascriptを初めて使用しているので、私はほとんどのサンプルコードに従っています。どこに間違っているのか分かりません。誰かがなぜこのエラーを受けているのか、そして適切な修正が何であるかを説明することができますか?分度器:TypeError:fnは関数ではありません
エラー:
[13:00:19] E/launcher - fn is not a function
[13:00:19] E/launcher - TypeError: fn is not a function
ホームページオブジェクト:
Homepage.prototype = Object.create({}, {
checkInBtn: {
get: function() {
return element(by.css('div.checkin.booking-date input'));
}
}, datePickerDay: {
value: function (day) {
return element(by.cssContainingText('.ui-datepicker-calendar a', day));
}
}, selectCheckInDate: {
value: function (day) {
return this.checkInBtn.click().then(this.datePickerDay(day).click());
}
},
});
module.exports = Homepage;
キュウリ、分度器Stepfile
this.When(/^I enter the trip information and search$/, function (table) {
var page = new homepage();
var checkOutDay = new Date(data["DepartureDate"]).getDate();
page.selectCheckInDate(checkInDay);
expect(page.checkInBtn.getText()).to.eventually.have.string(checkInDay);
});
あなたのページオブジェクトで宣言されている大文字のH 'Homepage()'ではないはずですが、 'var page = new homepage()'を呼び出していますか? – Gunderson