【问题标题】:Can I run TestCafe tests with unused Typescript page objects我可以使用未使用的 Typescript 页面对象运行 TestCafe 测试吗
【发布时间】:2020-08-27 14:32:17
【问题描述】:

我正在使用页面对象模式在 TestCafe 中编写测试。

一些页面对象是事先编写好的(在实际使用之前),因为我知道页面并且知道会发生什么。

但是,当尝试使用未使用的页面对象运行测试时,我会收到如下错误消息:

Error: TypeScript compilation failed.
C:/path-to/a.page-object.ts (40, 7): 'PageObjectExample' is declared but never used.

是否有 TestCafe 或 TypeScript 选项(暂时)允许编译这些类型的测试?

【问题讨论】:

  • 你也有eslint检查吗?

标签: typescript testing automated-tests testcafe pageobjects


【解决方案1】:

您似乎正在使用自定义 tsconfig,因为此错误是由于 noUnusedLocal 选项而发生的。在你的配置中去掉这个选项。

另见:

Ignore all errors in a typescript file

Customize TestCafe Compiler Options

【讨论】:

    猜你喜欢
    • 2019-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-10
    • 1970-01-01
    • 1970-01-01
    • 2020-03-04
    • 1970-01-01
    相关资源
    最近更新 更多