有人帮我找出意外的令牌问题吗?

时间:2016-12-15 07:11:27

标签: protractor

在命令提示符

上显示意外的令牌问题
onPrepare: function() {
    return browser.getCapabilities().then(caps) {
        var sessionId = caps.caps_['webdriver.remote.sessionid'];
        jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
            savePath: 'C:/report/report/screenshots' + sessionId
        }));
    };
}

1 个答案:

答案 0 :(得分:2)

您忘了为callback function函数传递then()

return browser.getCapabilities().then(function (caps) {
    var sessionId = caps.caps_['webdriver.remote.sessionid'];
    jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
        savePath: 'C:/report/report/screenshots' + sessionId
    }));
});