跳到主要內容

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

類型

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

      報告器名稱或模組或檔案路徑

    • 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

類型