跳至主要内容

FullConfig

可通过testInfo.config访问的已解析配置,该配置会传递给测试报告器。要查看Playwright配置文件的格式,请参阅TestConfig


属性

配置文件

Added in: v1.20 fullConfig.configFile

用于运行测试的配置文件路径。如果未使用配置文件,则该值为空字符串。

用法

fullConfig.configFile

类型


禁止仅

Added in: v1.10 fullConfig.forbidOnly

参见 testConfig.forbidOnly

用法

fullConfig.forbidOnly

类型


fullyParallel

Added in: v1.20 fullConfig.fullyParallel

参见 testConfig.fullyParallel

用法

fullConfig.fullyParallel

类型


全局设置

Added in: v1.10 fullConfig.globalSetup

参见 testConfig.globalSetup

用法

fullConfig.globalSetup

类型


全局拆卸

Added in: v1.10 fullConfig.globalTeardown

参见 testConfig.globalTeardown

用法

fullConfig.globalTeardown

类型


全局超时

Added in: v1.10 fullConfig.globalTimeout

参见 testConfig.globalTimeout

用法

fullConfig.globalTimeout

类型


grep

Added in: v1.10 fullConfig.grep

参见 testConfig.grep

用法

fullConfig.grep

类型


grepInvert

Added in: v1.10 fullConfig.grepInvert

参见 testConfig.grepInvert

用法

fullConfig.grepInvert

类型


maxFailures

Added in: v1.10 fullConfig.maxFailures

参见 testConfig.maxFailures

用法

fullConfig.maxFailures

类型


元数据

Added in: v1.10 fullConfig.metadata

参见 testConfig.metadata

用法

fullConfig.metadata

类型


preserveOutput

Added in: v1.10 fullConfig.preserveOutput

参见 testConfig.preserveOutput

用法

fullConfig.preserveOutput

类型

  • "always" | "never" | "failures-only"

项目

Added in: v1.10 fullConfig.projects

已解决项目的列表。

用法

fullConfig.projects

类型


静默

Added in: v1.10 fullConfig.quiet

参见 testConfig.quiet

用法

fullConfig.quiet

类型


reportSlowTests

Added in: v1.10 fullConfig.reportSlowTests

参见 testConfig.reportSlowTests

用法

fullConfig.reportSlowTests

类型

  • null | Object
    • max number

      要报告的慢速测试文件的最大数量。

    • threshold number

      被视为缓慢的测试文件持续时间(以毫秒为单位)。


报告器

Added in: v1.10 fullConfig.reporter

参见 testConfig.reporter

用法

fullConfig.reporter

类型

  • 字符串 | 数组<Object> | "list" | "dot" | "line" | "github" | "json" | "junit" | "null" | "html"
    • 0 string

      报告器名称、模块或文件路径

    • 1 Object

      一个包含报告器选项的对象(如果有的话)


rootDir

Added in: v1.20 fullConfig.rootDir

用于报告中所有相对路径的基础目录。

用法

fullConfig.rootDir

类型


分片

Added in: v1.10 fullConfig.shard

参见 testConfig.shard

用法

fullConfig.shard

类型


updateSnapshots

Added in: v1.10 fullConfig.updateSnapshots

参见 testConfig.updateSnapshots

用法

fullConfig.updateSnapshots

类型

  • "all" | "changed" | "missing" | "none"

updateSourceMethod

Added in: v1.50 fullConfig.updateSourceMethod

参见 testConfig.updateSourceMethod

用法

fullConfig.updateSourceMethod

类型

  • "overwrite" | "3way" | "patch"

版本

Added in: v1.20 fullConfig.version

Playwright 版本。

用法

fullConfig.version

类型


web服务器

Added in: v1.10 fullConfig.webServer

参见 testConfig.webServer

用法

fullConfig.webServer

类型


工作线程

Added in: v1.10 fullConfig.workers

参见 testConfig.workers

用法

fullConfig.workers

类型