跳转到主要内容

FullConfig

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


属性

configFile

新增于: v1.20 fullConfig.configFile

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

用法

fullConfig.configFile

类型


forbidOnly

新增于: v1.10 fullConfig.forbidOnly

请参阅 testConfig.forbidOnly

用法

fullConfig.forbidOnly

类型


fullyParallel

新增于: v1.20 fullConfig.fullyParallel

请参阅 testConfig.fullyParallel

用法

fullConfig.fullyParallel

类型


globalSetup

新增于: v1.10 fullConfig.globalSetup

请参阅 testConfig.globalSetup

用法

fullConfig.globalSetup

类型


globalTeardown

新增于: 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

新增于: v1.10 fullConfig.preserveOutput

请参阅 testConfig.preserveOutput

用法

fullConfig.preserveOutput

类型

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

projects

新增于: v1.10 fullConfig.projects

已解析的项目列表。

用法

fullConfig.projects

类型


quiet

新增于: v1.10 fullConfig.quiet

请参阅 testConfig.quiet

用法

fullConfig.quiet

类型


reportSlowTests

新增于: v1.10 fullConfig.reportSlowTests

请参阅 testConfig.reportSlowTests

用法

fullConfig.reportSlowTests

类型

  • null | Object
    • max number

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

    • threshold number

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


reporter

新增于: v1.10 fullConfig.reporter

请参阅 testConfig.reporter

用法

fullConfig.reporter

类型

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

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

    • 1 Object

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


rootDir

新增于: v1.20 fullConfig.rootDir

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

用法

fullConfig.rootDir

类型


shard

新增于: v1.10 fullConfig.shard

请参阅 testConfig.shard

用法

fullConfig.shard

类型

  • null | Object
    • total number

      分片总数。

    • current number

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


tags

Added in: v1.57 fullConfig.tags

已解析的全局标签。请参阅 testConfig.tag

用法

fullConfig.tags

类型


updateSnapshots

新增于: v1.10 fullConfig.updateSnapshots

请参阅 testConfig.updateSnapshots

用法

fullConfig.updateSnapshots

类型

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

updateSourceMethod

新增于: v1.50 fullConfig.updateSourceMethod

请参阅 testConfig.updateSourceMethod

用法

fullConfig.updateSourceMethod

类型

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

version

新增于: v1.20 fullConfig.version

Playwright 版本。

用法

fullConfig.version

类型


webServer

新增于: v1.10 fullConfig.webServer

请参阅 testConfig.webServer

用法

fullConfig.webServer

类型


workers

新增于: v1.10 fullConfig.workers

请参阅 testConfig.workers

用法

fullConfig.workers

类型