简体   繁体   English

量角器不识别延伸

[英]Protractor does not recognise extends

I have basic inheritance: 我有基本的继承:

export class Page {}
export class LoginPage extends Page {}

In test I have: 在测试中,我有:

it('should do sth', ()=> {
    let loginPage = new LoginPage();

What I get is: 我得到的是:

Error: ReferenceError: __extends is not defined 错误:ReferenceError:__extends未定义

Does protractor support extends ? 量角器的支撑是否延伸?

It depends. 这取决于。 Are you using ES6 for your protractor tests? 您是否正在使用ES6进行量角器测试? If you are using ES5, probably not (see ECMAScript 6 equivalents in ES5 ). 如果您使用的是ES5,则可能不会使用(请参阅ES5中的ECMAScript 6等效项 )。

There is a discussion on using ES6 with protractor... here . 有使用ES6用量角器...的讨论在这里

There will be Typescript support soon and that will allow you to extend a class Page. 很快就会有Typescript支持,这将使您可以扩展Class Page。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM