跳到主要内容

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

类型


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

类型