【发布时间】:2017-01-10 02:29:48
【问题描述】:
我已经为 atom 安装了 typescript,用于编写自动化的量角器脚本。
我的代码是用 Jasmine 框架编写的,因为量角器很好地支持它。
我用这个结构写的。
describe('Sign in',function(){
it ('Verify Modules Present', function(){
loginPage.enterUsernameAndPasswordWithSignIn('a','b');
browser.sleep(3000);
var module = element(by.xpath("//*[@ng-reflect-router-link='My']"));
browser.wait(protractor.ExpectedConditions.elementToBeClickable(module),
8000).thenCatch(function () {
assert.fail(' element is not click able');
});
var expectedModuleName = ["My", "X","Y", "Z" ];
var testArray = ["My", "X","Y", "Z" ];;
logger.log('info','Checking All modules');
for (var i = 0; i < testArray.length;i++) {
var moduleName = text.verifyText("//*[@ng-reflect-router-link='"+ testArray[i] + "']");
expect(moduleName).toBe(expectedModuleName[i]);
}
logger.log('info','Checked All modules');
});
});
我收到以下错误。
我的理解是:Typescript 无法找到 Jasmine 库。 该怎么做?
我经过:https://angular.io/docs/ts/latest/testing/jasmine-testing-101.html
但找不到太多。我也安装了打字。但我不知道如何使用它。
如何将 Jasmine Framework 配置为 Protractor 的 atom 以便解决此错误?
如果不是这样,哪个编辑器可以这样做以及如何做到这一点?
请指导我..
【问题讨论】:
-
在规范顶部添加以下两行,甚至还包括 /// - ///
import bb = require ('主干'); -
您能详细说明一下吗?
标签: typescript jasmine protractor atom-editor