【发布时间】:2018-02-02 20:30:37
【问题描述】:
我有一小套量角器测试。在测试中,我有一些从公共基类扩展而来的页面对象类。在我的量角器配置中,我有:
specs: [
'./showcase/e2e/**/*.e2e-spec.ts'
]
如果我使用此配置运行 Protractor,则所有测试都会运行。但是,如果我尝试运行单个测试,则会遇到错误。
我正在尝试使用此命令运行特定测试:
protractor --specs showcase/e2e/app/components/dropdown/dropdown.e2e-spec.ts
然后我得到一个错误:
Error: TSError: ⨯ Unable to compile TypeScript
showcase/e2e/shared/components/dropdown/dropdown.po.ts (3,32): Property 'setPrototypeOf' does not exist on type 'ObjectConstructor'. (2339)
这里是dropdown.po.ts的内容:
import { ExamplePage } from '../example.po';
export const COMPONENT_ID = 'dropdown';
export class DropdownPage extends ExamplePage {
navigateTo() {
this.navigateToComponentPage('dropdown');
}
}
一定是我错过了什么。知道为什么在尝试运行单个测试用例时出现此错误,但在运行所有内容时没有错误吗?我被难住了。
【问题讨论】:
-
运行整个套件时看起来您使用的是ecma6,但是当您运行单个测试时,它的目标不是您想要的
标签: javascript angular typescript protractor