Skip to main content

FullConfig

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

🌐 Resolved configuration which is accessible via testInfo.config and is passed to the test reporters. To see the format of Playwright configuration file, please see TestConfig instead.


属性

🌐 Properties

configFile

Added in: v1.20 fullConfig.configFile

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

🌐 Path to the configuration file used to run the tests. The value is an empty string if no config file was used.

用法

fullConfig.configFile

类型


forbidOnly

Added in: v1.10 fullConfig.forbidOnly

请参阅 testConfig.forbidOnly

🌐 See testConfig.forbidOnly.

用法

fullConfig.forbidOnly

类型


fullyParallel

Added in: v1.20 fullConfig.fullyParallel

请参阅 testConfig.fullyParallel

🌐 See testConfig.fullyParallel.

用法

fullConfig.fullyParallel

类型


globalSetup

Added in: v1.10 fullConfig.globalSetup

参见 testConfig.globalSetup

🌐 See testConfig.globalSetup.

用法

fullConfig.globalSetup

类型

  • [空值] | [字符串]

globalTeardown

Added in: v1.10 fullConfig.globalTeardown

请参阅 testConfig.globalTeardown

🌐 See testConfig.globalTeardown.

用法

fullConfig.globalTeardown

类型

  • [空值] | [字符串]

globalTimeout

Added in: v1.10 fullConfig.globalTimeout

参见 testConfig.globalTimeout

🌐 See testConfig.globalTimeout.

用法

fullConfig.globalTimeout

类型


grep

Added in: v1.10 fullConfig.grep

参见 testConfig.grep

🌐 See testConfig.grep.

用法

fullConfig.grep

类型

  • [正则表达式] | [数组]<[正则表达式]>

grepInvert

Added in: v1.10 fullConfig.grepInvert

请参阅 testConfig.grepInvert

🌐 See testConfig.grepInvert.

用法

fullConfig.grepInvert

类型

  • [空] | [正则表达式] | [数组]<[正则表达式]>

maxFailures

Added in: v1.10 fullConfig.maxFailures

参见 testConfig.maxFailures

🌐 See testConfig.maxFailures.

用法

fullConfig.maxFailures

类型


metadata

Added in: v1.10 fullConfig.metadata

请参见 testConfig.metadata

🌐 See testConfig.metadata.

用法

fullConfig.metadata

类型


preserveOutput

Added in: v1.10 fullConfig.preserveOutput

请参阅 testConfig.preserveOutput

🌐 See testConfig.preserveOutput.

用法

fullConfig.preserveOutput

类型

  • “总是” | “从不” | “仅失败”

projects

Added in: v1.10 fullConfig.projects

已解决的项目列表。

🌐 List of resolved projects.

用法

fullConfig.projects

类型

  • [数组]<[完整项目]>

quiet

Added in: v1.10 fullConfig.quiet

请参阅 testConfig.quiet

🌐 See testConfig.quiet.

用法

fullConfig.quiet

类型


reportSlowTests

Added in: v1.10 fullConfig.reportSlowTests

请参阅 testConfig.reportSlowTests

🌐 See testConfig.reportSlowTests.

用法

fullConfig.reportSlowTests

类型

  • [空] | [对象]
    • max number

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

    • threshold number

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


reporter

Added in: v1.10 fullConfig.reporter

参见 testConfig.reporter

🌐 See testConfig.reporter.

用法

fullConfig.reporter

类型

  • [字符串] | [数组]<[对象]> | "列表" | "点" | "线" | "GitHub" | "JSON" | "JUnit" | "空" | "HTML"
    • 0 string

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

    • 1 Object

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


rootDir

Added in: v1.20 fullConfig.rootDir

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

🌐 Base directory for all relative paths used in the reporters.

用法

fullConfig.rootDir

类型


shard

Added in: v1.10 fullConfig.shard

参见 testConfig.shard

🌐 See testConfig.shard.

用法

fullConfig.shard

类型

  • [空] | [对象]
    • total number

      分片总数。

    • current number

      要执行的分片的索引,从一开始。


tags

Added in: v1.57 fullConfig.tags

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

🌐 Resolved global tags. See testConfig.tag.

用法

fullConfig.tags

类型

  • [数组]<[字符串]>

updateSnapshots

Added in: v1.10 fullConfig.updateSnapshots

参见 testConfig.updateSnapshots

🌐 See testConfig.updateSnapshots.

用法

fullConfig.updateSnapshots

类型

  • “全部” | “已更改” | “缺失” | “无”

updateSourceMethod

Added in: v1.50 fullConfig.updateSourceMethod

请参阅 testConfig.updateSourceMethod

🌐 See testConfig.updateSourceMethod.

用法

fullConfig.updateSourceMethod

类型

  • "覆盖" | "三方" | "补丁"

version

Added in: v1.20 fullConfig.version

Playwright 版本。

🌐 Playwright version.

用法

fullConfig.version

类型


webServer

Added in: v1.10 fullConfig.webServer

请参阅 testConfig.webServer

🌐 See testConfig.webServer.

用法

fullConfig.webServer

类型

  • [空] | [对象]

workers

Added in: v1.10 fullConfig.workers

参见 testConfig.workers

🌐 See testConfig.workers.

用法

fullConfig.workers

类型