跳到主要内容

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

      要报告的慢速测试文件的最大数量。默认为 5

    • threshold number

      被认为是慢速的测试持续时间,以毫秒为单位。默认为 15 秒。


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

类型