我是Java语言的初学者。如何在此代码中使用辅助功能。谢谢
module.exports.selectDate = function(browser, done, date) {
const css = `div[data-autobot-element-id=DATEPICKER_DAY_${dateformat(date, 'yyyymmdd')}]`;
browser
.clickWaitForElementByCssWithCatch(css, isDisplayed, 30000, 1000)
.nodeify(done);
};
答案 0 :(得分:0)
分别定义函数,然后将其分配给多个module.exports
属性:
function dateFunc(browser, done, date) {
const css = `div[data-autobot-element-id=DATEPICKER_DAY_${dateformat(date, 'yyyymmdd')}]`;
browser
.clickWaitForElementByCssWithCatch(css, isDisplayed, 30000, 1000)
.nodeify(done);
};
module.exports.pickupDate = dateFunc;
module.exports.dropoffDate = datefunc;