跳到主要内容

FullConfig

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


属性

configFile

Added in: v1.20 fullConfig.configFile

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

用法

fullConfig.configFile

类型


forbidOnly

Added in: v1.10 fullConfig.forbidOnly

参见 testConfig.forbidOnly

用法

fullConfig.forbidOnly

类型


fullyParallel

Added in: v1.20 fullConfig.fullyParallel

参见 testConfig.fullyParallel

用法

fullConfig.fullyParallel

类型


globalSetup

Added in: v1.10 fullConfig.globalSetup

参见 testConfig.globalSetup

用法

fullConfig.globalSetup

类型


globalTeardown

Added in: v1.10 fullConfig.globalTeardown

参见 testConfig.globalTeardown

用法

fullConfig.globalTeardown

类型


globalTimeout

添加于: v1.10 fullConfig.globalTimeout

参见 testConfig.globalTimeout

用法

fullConfig.globalTimeout

类型


grep

添加于: v1.10 fullConfig.grep

参见 testConfig.grep

用法

fullConfig.grep

类型


grepInvert

添加于: v1.10 fullConfig.grepInvert

参见 testConfig.grepInvert

用法

fullConfig.grepInvert

类型


maxFailures

添加于: v1.10 fullConfig.maxFailures

参见 testConfig.maxFailures

用法

fullConfig.maxFailures

类型


metadata

添加于: v1.10 fullConfig.metadata

参见 testConfig.metadata

用法

fullConfig.metadata

类型


preserveOutput

Added in: v1.10 fullConfig.preserveOutput

参见 testConfig.preserveOutput

用法

fullConfig.preserveOutput

类型

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

projects

Added in: v1.10 fullConfig.projects

已解析的项目列表。

用法

fullConfig.projects

类型


quiet

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

      被视为慢速的测试文件持续时间(毫秒)。

reporter

Added in: v1.10 fullConfig.reporter

参见 testConfig.reporter

用法

fullConfig.reporter

类型

  • string | Array<Object> | "list" | "dot" | "line" | "github" | "json" | "junit" | "null" | "html"
    • 0 string

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

    • 1 Object

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


rootDir

Added in: v1.20 fullConfig.rootDir

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

用法

fullConfig.rootDir

类型


shard

Added in: v1.10 fullConfig.shard

参见 testConfig.shard

用法

fullConfig.shard

类型

  • null | Object
    • total number

      分片总数。

    • current number

      当前要执行的分片索引(从1开始计数)。


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"

version

Added in: v1.20 fullConfig.version

Playwright 版本号。

用法

fullConfig.version

类型


webServer

Added in: v1.10 fullConfig.webServer

参见 testConfig.webServer

用法

fullConfig.webServer

类型


workers

Added in: v1.10 fullConfig.workers

参见 testConfig.workers

用法

fullConfig.workers

类型