-- Generated by Gleam CI helpers. module CI.Component (run, version, setup, test, list, install, install_deps) where import Prelude import CI.Contract as Contract import Data.Maybe (Maybe) import Effect (Effect) import CI.ModuleDependencies as Dependencies import CI.CLI as Native -- | Execute arbitrary literal CLI arguments. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. -- | @param arguments Literal native CLI argument tokens, passed without shell expansion. run :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), arguments :: Array String } -> Effect Contract.ExecutionResult run args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "playwright" "run" json -- | Print the CLI version. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. version :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String) } -> Effect Contract.ExecutionResult version args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "playwright" "version" json -- | Install the test framework in project using Bun. Browser binaries are installed separately with install. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. -- | @param version Framework version or release tag to install with Bun. Default: "latest". setup :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), version :: Maybe String } -> Effect Contract.ExecutionResult setup args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "playwright" "setup" json -- | Run Playwright Test headlessly, optionally filtering projects and tests. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. -- | @param config Named configuration selected by the native tool. -- | @param testProject Test Project supplied to the playwright test operation. -- | @param grep Grep supplied to the playwright test operation. -- | @param grepInvert Grep Invert supplied to the playwright test operation. -- | @param workers Workers supplied to the playwright test operation. -- | @param reporter Reporter supplied to the playwright test operation. -- | @param output Destination path for generated packages. -- | @param retries Retries supplied to the playwright test operation. -- | @param shard Shard supplied to the playwright test operation. -- | @param forbidOnly Forbid Only supplied to the playwright test operation. -- | @param failOnFlakyTests Fail On Flaky Tests supplied to the playwright test operation. -- | @param updateSnapshots Update Snapshots supplied to the playwright test operation. -- | @param tests Tests supplied to the playwright test operation. Default: []. test :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), config :: Maybe String, testProject :: Maybe (Array String), grep :: Maybe String, grepInvert :: Maybe String, workers :: Maybe Int, reporter :: Maybe String, output :: Maybe String, retries :: Maybe Int, shard :: Maybe String, forbidOnly :: Maybe Boolean, failOnFlakyTests :: Maybe Boolean, updateSnapshots :: Maybe Boolean, tests :: Maybe (Array String) } -> Effect Contract.ExecutionResult test args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "playwright" "test" json -- | List matching tests without launching browsers. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. -- | @param config Named configuration selected by the native tool. -- | @param testProject Test Project supplied to the playwright list operation. -- | @param grep Grep supplied to the playwright list operation. -- | @param grepInvert Grep Invert supplied to the playwright list operation. -- | @param workers Workers supplied to the playwright list operation. -- | @param tests Tests supplied to the playwright list operation. Default: []. list :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), config :: Maybe String, testProject :: Maybe (Array String), grep :: Maybe String, grepInvert :: Maybe String, workers :: Maybe Int, tests :: Maybe (Array String) } -> Effect Contract.ExecutionResult list args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "playwright" "list" json -- | Install browser binaries matching the installed Playwright package. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. -- | @param withDeps With Deps supplied to the playwright install operation. -- | @param onlyShell Only Shell supplied to the playwright install operation. -- | @param browsers Browsers supplied to the playwright install operation. Default: []. install :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), withDeps :: Maybe Boolean, onlyShell :: Maybe Boolean, browsers :: Maybe (Array String) } -> Effect Contract.ExecutionResult install args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "playwright" "install" json -- | Install operating-system browser dependencies; may require elevated privileges. -- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".". -- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist. -- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool. -- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000. -- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. -- | @param browsers Browsers supplied to the playwright install_deps operation. Default: []. install_deps :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), browsers :: Maybe (Array String) } -> Effect Contract.ExecutionResult install_deps args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "playwright" "install_deps" json