diff --git a/cmd/adb/devices.go b/cmd/adb/devices.go index 860038a8..ec1f53fd 100644 --- a/cmd/adb/devices.go +++ b/cmd/adb/devices.go @@ -57,5 +57,5 @@ func getAndroidDevices() (devices []*gadb.Device, err error) { } func init() { - androidRootCmd.AddCommand(listAndroidDevicesCmd) + CmdAndroidRoot.AddCommand(listAndroidDevicesCmd) } diff --git a/cmd/adb/init.go b/cmd/adb/init.go index d7f495e5..b4298371 100644 --- a/cmd/adb/init.go +++ b/cmd/adb/init.go @@ -9,7 +9,7 @@ import ( var serial string -var androidRootCmd = &cobra.Command{ +var CmdAndroidRoot = &cobra.Command{ Use: "adb", Short: "simple utils for android device management", PersistentPreRun: func(cmd *cobra.Command, args []string) {}, @@ -22,7 +22,3 @@ func getDevice(serial string) (*uixt.AndroidDevice, error) { } return device, nil } - -func Init(rootCmd *cobra.Command) { - rootCmd.AddCommand(androidRootCmd) -} diff --git a/cmd/adb/install.go b/cmd/adb/install.go index 16677076..8c99c963 100644 --- a/cmd/adb/install.go +++ b/cmd/adb/install.go @@ -66,5 +66,5 @@ func init() { installCmd.Flags().BoolVarP(&replace, "replace", "r", false, "replace existing application") installCmd.Flags().BoolVarP(&downgrade, "downgrade", "d", false, "allow version code downgrade (debuggable packages only)") installCmd.Flags().BoolVarP(&grant, "grant", "g", false, "grant all runtime permissions") - androidRootCmd.AddCommand(installCmd) + CmdAndroidRoot.AddCommand(installCmd) } diff --git a/cmd/adb/screencap.go b/cmd/adb/screencap.go index 64582ac9..261a469d 100644 --- a/cmd/adb/screencap.go +++ b/cmd/adb/screencap.go @@ -46,5 +46,5 @@ var screencapAndroidDevicesCmd = &cobra.Command{ func init() { screencapAndroidDevicesCmd.Flags().StringVarP(&serial, "serial", "s", "", "filter by device's serial") - androidRootCmd.AddCommand(screencapAndroidDevicesCmd) + CmdAndroidRoot.AddCommand(screencapAndroidDevicesCmd) } diff --git a/cmd/build.go b/cmd/build.go index 78baaec1..ffd02e3d 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -10,7 +10,7 @@ import ( "github.com/httprunner/httprunner/v5/internal/sdk" ) -var buildCmd = &cobra.Command{ +var CmdBuild = &cobra.Command{ Use: "build $path ...", Short: "build plugin for testing", Long: `build python/go plugin for testing`, @@ -33,7 +33,5 @@ var buildCmd = &cobra.Command{ var output string func init() { - rootCmd.AddCommand(buildCmd) - - buildCmd.Flags().StringVarP(&output, "output", "o", "", "funplugin product output path, default: cwd") + CmdBuild.Flags().StringVarP(&output, "output", "o", "", "funplugin product output path, default: cwd") } diff --git a/cmd/doc_test.go b/cmd/cli/doc_test.go similarity index 61% rename from cmd/doc_test.go rename to cmd/cli/doc_test.go index b39f1f69..40b34f6b 100644 --- a/cmd/doc_test.go +++ b/cmd/cli/doc_test.go @@ -1,14 +1,16 @@ -package cmd +package main import ( "testing" + "github.com/httprunner/httprunner/v5/cmd" "github.com/spf13/cobra/doc" "github.com/stretchr/testify/assert" ) // run this test to generate markdown docs for hrp command func TestGenMarkdownTree(t *testing.T) { - err := doc.GenMarkdownTree(rootCmd, "../../docs/cmd") + addAllCommands() + err := doc.GenMarkdownTree(cmd.RootCmd, "../../docs/cmd") assert.Nil(t, err) } diff --git a/cmd/cli/main.go b/cmd/cli/main.go index af6b6c30..40ff8fa2 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -7,8 +7,25 @@ import ( "github.com/getsentry/sentry-go" "github.com/httprunner/httprunner/v5/cmd" + "github.com/httprunner/httprunner/v5/cmd/adb" + "github.com/httprunner/httprunner/v5/cmd/ios" + "github.com/httprunner/httprunner/v5/code" ) +func addAllCommands() { + // adds all child commands to the root command and sets flags appropriately. + cmd.RootCmd.AddCommand(cmd.CmdBuild) + cmd.RootCmd.AddCommand(cmd.CmdConvert) + cmd.RootCmd.AddCommand(cmd.CmdPytest) + cmd.RootCmd.AddCommand(cmd.CmdRun) + cmd.RootCmd.AddCommand(cmd.CmdScaffold) + cmd.RootCmd.AddCommand(cmd.CmdServer) + cmd.RootCmd.AddCommand(cmd.CmdWiki) + + cmd.RootCmd.AddCommand(ios.CmdIOSRoot) + cmd.RootCmd.AddCommand(adb.CmdAndroidRoot) +} + func main() { defer func() { if err := recover(); err != nil { @@ -21,6 +38,9 @@ func main() { } }() - exitCode := cmd.Execute() + addAllCommands() + + err := cmd.RootCmd.Execute() + exitCode := code.GetErrorCode(err) os.Exit(exitCode) } diff --git a/cmd/convert.go b/cmd/convert.go index 8695d6b1..881abf94 100644 --- a/cmd/convert.go +++ b/cmd/convert.go @@ -14,7 +14,7 @@ import ( "github.com/httprunner/httprunner/v5/internal/builtin" ) -var convertCmd = &cobra.Command{ +var CmdConvert = &cobra.Command{ Use: "convert $path...", Short: "convert multiple source format to HttpRunner JSON/YAML/gotest/pytest cases", Args: cobra.MinimumNArgs(1), @@ -105,18 +105,16 @@ var ( ) func init() { - rootCmd.AddCommand(convertCmd) + CmdConvert.Flags().BoolVar(&fromJSONFlag, "from-json", true, "load from json case format") + CmdConvert.Flags().BoolVar(&fromYAMLFlag, "from-yaml", false, "load from yaml case format") + CmdConvert.Flags().BoolVar(&fromHARFlag, "from-har", false, "load from HAR format") + CmdConvert.Flags().BoolVar(&fromPostmanFlag, "from-postman", false, "load from postman format") + CmdConvert.Flags().BoolVar(&fromCurlFlag, "from-curl", false, "load from curl format") - convertCmd.Flags().BoolVar(&fromJSONFlag, "from-json", true, "load from json case format") - convertCmd.Flags().BoolVar(&fromYAMLFlag, "from-yaml", false, "load from yaml case format") - convertCmd.Flags().BoolVar(&fromHARFlag, "from-har", false, "load from HAR format") - convertCmd.Flags().BoolVar(&fromPostmanFlag, "from-postman", false, "load from postman format") - convertCmd.Flags().BoolVar(&fromCurlFlag, "from-curl", false, "load from curl format") + CmdConvert.Flags().BoolVar(&toJSONFlag, "to-json", true, "convert to JSON case scripts") + CmdConvert.Flags().BoolVar(&toYAMLFlag, "to-yaml", false, "convert to YAML case scripts") + CmdConvert.Flags().BoolVar(&toPyTestFlag, "to-pytest", false, "convert to pytest scripts") - convertCmd.Flags().BoolVar(&toJSONFlag, "to-json", true, "convert to JSON case scripts") - convertCmd.Flags().BoolVar(&toYAMLFlag, "to-yaml", false, "convert to YAML case scripts") - convertCmd.Flags().BoolVar(&toPyTestFlag, "to-pytest", false, "convert to pytest scripts") - - convertCmd.Flags().StringVarP(&outputDir, "output-dir", "d", "", "specify output directory") - convertCmd.Flags().StringVarP(&profilePath, "profile", "p", "", "specify profile path to override headers and cookies") + CmdConvert.Flags().StringVarP(&outputDir, "output-dir", "d", "", "specify output directory") + CmdConvert.Flags().StringVarP(&profilePath, "profile", "p", "", "specify profile path to override headers and cookies") } diff --git a/cmd/ios/apps.go b/cmd/ios/apps.go index 6c49c32b..978ee8a4 100644 --- a/cmd/ios/apps.go +++ b/cmd/ios/apps.go @@ -71,5 +71,5 @@ var appType string func init() { listAppsCmd.Flags().StringVarP(&udid, "udid", "u", "", "specify device by udid") listAppsCmd.Flags().StringVarP(&appType, "type", "t", "user", "filter application type [user|system|internal|all]") - iosRootCmd.AddCommand(listAppsCmd) + CmdIOSRoot.AddCommand(listAppsCmd) } diff --git a/cmd/ios/devices.go b/cmd/ios/devices.go index e9d7bcfa..b7796e33 100644 --- a/cmd/ios/devices.go +++ b/cmd/ios/devices.go @@ -74,5 +74,5 @@ var listDevicesCmd = &cobra.Command{ var udid string func init() { - iosRootCmd.AddCommand(listDevicesCmd) + CmdIOSRoot.AddCommand(listDevicesCmd) } diff --git a/cmd/ios/init.go b/cmd/ios/init.go index f146f3c6..b0f94ea6 100644 --- a/cmd/ios/init.go +++ b/cmd/ios/init.go @@ -7,7 +7,7 @@ import ( "github.com/httprunner/httprunner/v5/uixt/option" ) -var iosRootCmd = &cobra.Command{ +var CmdIOSRoot = &cobra.Command{ Use: "ios", Short: "simple utils for ios device management", } @@ -19,7 +19,3 @@ func getDevice(udid string) (*uixt.IOSDevice, error) { } return device, nil } - -func Init(rootCmd *cobra.Command) { - rootCmd.AddCommand(iosRootCmd) -} diff --git a/cmd/ios/install.go b/cmd/ios/install.go index 5401d093..865687e3 100644 --- a/cmd/ios/install.go +++ b/cmd/ios/install.go @@ -49,5 +49,5 @@ var installCmd = &cobra.Command{ func init() { installCmd.Flags().StringVarP(&udid, "udid", "u", "", "filter by device's serial") - iosRootCmd.AddCommand(installCmd) + CmdIOSRoot.AddCommand(installCmd) } diff --git a/cmd/ios/mount.go b/cmd/ios/mount.go index e51fd235..b204aecc 100644 --- a/cmd/ios/mount.go +++ b/cmd/ios/mount.go @@ -79,5 +79,5 @@ func init() { mountCmd.Flags().BoolVar(&unmountDeveloperDiskImage, "reset", false, "unmount developer disk images") mountCmd.Flags().StringVarP(&developerDiskImageDir, "dir", "d", defaultDeveloperDiskImageDir, "specify developer disk image directory") mountCmd.Flags().StringVarP(&udid, "udid", "u", "", "specify device by udid") - iosRootCmd.AddCommand(mountCmd) + CmdIOSRoot.AddCommand(mountCmd) } diff --git a/cmd/ios/ps.go b/cmd/ios/ps.go index 4201b918..d930fc64 100644 --- a/cmd/ios/ps.go +++ b/cmd/ios/ps.go @@ -46,5 +46,5 @@ var isAll bool func init() { psCmd.Flags().StringVarP(&udid, "udid", "u", "", "specify device by udid") psCmd.Flags().BoolVarP(&isAll, "all", "a", false, "print all processes including system processes") - iosRootCmd.AddCommand(psCmd) + CmdIOSRoot.AddCommand(psCmd) } diff --git a/cmd/ios/reboot.go b/cmd/ios/reboot.go index 10a7353d..3c1bd66e 100644 --- a/cmd/ios/reboot.go +++ b/cmd/ios/reboot.go @@ -40,5 +40,5 @@ var rebootCmd = &cobra.Command{ func init() { rebootCmd.Flags().StringVarP(&udid, "udid", "u", "", "specify device by udid") - iosRootCmd.AddCommand(rebootCmd) + CmdIOSRoot.AddCommand(rebootCmd) } diff --git a/cmd/ios/tunnel.go b/cmd/ios/tunnel.go index fd4720e8..eb2c935b 100644 --- a/cmd/ios/tunnel.go +++ b/cmd/ios/tunnel.go @@ -36,5 +36,5 @@ var tunnelCmd = &cobra.Command{ } func init() { - iosRootCmd.AddCommand(tunnelCmd) + CmdIOSRoot.AddCommand(tunnelCmd) } diff --git a/cmd/ios/uninstall.go b/cmd/ios/uninstall.go index 14ace0ac..9012cfea 100644 --- a/cmd/ios/uninstall.go +++ b/cmd/ios/uninstall.go @@ -56,5 +56,5 @@ func init() { uninstallCmd.Flags().StringVarP(&udid, "udid", "u", "", "filter by device's serial") uninstallCmd.Flags().StringVarP(&bundleId, "bundleId", "b", "", "bundleId to uninstall") - iosRootCmd.AddCommand(uninstallCmd) + CmdIOSRoot.AddCommand(uninstallCmd) } diff --git a/cmd/ios/xctest.go b/cmd/ios/xctest.go index 5c8797c3..af3744c5 100644 --- a/cmd/ios/xctest.go +++ b/cmd/ios/xctest.go @@ -52,5 +52,5 @@ func init() { xctestCmd.Flags().StringVarP(&bundleID, "bundleID", "b", "com.gtf.wda.runner.xctrunner", "specify ios bundleID") xctestCmd.Flags().StringVarP(&testRunnerBundleID, "testRunnerBundleID", "t", "com.gtf.wda.runner.xctrunner", "specify ios testRunnerBundleID") xctestCmd.Flags().StringVarP(&xctestConfig, "xctestConfig", "x", "GtfWdaRunner.xctest", "specify ios xctestConfig") - iosRootCmd.AddCommand(xctestCmd) + CmdIOSRoot.AddCommand(xctestCmd) } diff --git a/cmd/pytest.go b/cmd/pytest.go index 512c0851..d6bf8bb8 100644 --- a/cmd/pytest.go +++ b/cmd/pytest.go @@ -13,7 +13,7 @@ import ( "github.com/httprunner/httprunner/v5/internal/sdk" ) -var pytestCmd = &cobra.Command{ +var CmdPytest = &cobra.Command{ Use: "pytest $path ...", Short: "run API test with pytest", Args: cobra.MinimumNArgs(1), @@ -38,10 +38,6 @@ var pytestCmd = &cobra.Command{ }, } -func init() { - rootCmd.AddCommand(pytestCmd) -} - func runPytest(args []string) error { args = append([]string{"run"}, args...) return myexec.ExecPython3Command("httprunner", args...) diff --git a/cmd/root.go b/cmd/root.go index 77bc8ae1..fb82adb6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,14 +4,11 @@ import ( "github.com/spf13/cobra" hrp "github.com/httprunner/httprunner/v5" - "github.com/httprunner/httprunner/v5/cmd/adb" - "github.com/httprunner/httprunner/v5/cmd/ios" - "github.com/httprunner/httprunner/v5/code" "github.com/httprunner/httprunner/v5/internal/version" ) // rootCmd represents the base command when called without any subcommands -var rootCmd = &cobra.Command{ +var RootCmd = &cobra.Command{ Use: "hrp", Short: "All-in-One Testing Framework for API, UI and Performance", Long: ` @@ -62,16 +59,8 @@ var ( venv string ) -// Execute adds all child commands to the root command and sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. -func Execute() int { - rootCmd.PersistentFlags().StringVarP(&logLevel, "log-level", "l", "INFO", "set log level") - rootCmd.PersistentFlags().BoolVar(&logJSON, "log-json", false, "set log to json format (default colorized console)") - rootCmd.PersistentFlags().StringVar(&venv, "venv", "", "specify python3 venv path") - - ios.Init(rootCmd) - adb.Init(rootCmd) - - err := rootCmd.Execute() - return code.GetErrorCode(err) +func init() { + RootCmd.PersistentFlags().StringVarP(&logLevel, "log-level", "l", "INFO", "set log level") + RootCmd.PersistentFlags().BoolVar(&logJSON, "log-json", false, "set log to json format (default colorized console)") + RootCmd.PersistentFlags().StringVar(&venv, "venv", "", "specify python3 venv path") } diff --git a/cmd/run.go b/cmd/run.go index 050330b7..c0259436 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -7,7 +7,7 @@ import ( ) // runCmd represents the run command -var runCmd = &cobra.Command{ +var CmdRun = &cobra.Command{ Use: "run $path...", Short: "run API test with go engine", Long: `run yaml/json testcase files for API test`, @@ -38,15 +38,14 @@ var ( ) func init() { - rootCmd.AddCommand(runCmd) - runCmd.Flags().BoolVarP(&continueOnFailure, "continue-on-failure", "c", false, "continue running next step when failure occurs") - runCmd.Flags().BoolVar(&requestsLogOff, "log-requests-off", false, "turn off request & response details logging") - runCmd.Flags().BoolVar(&httpStatOn, "http-stat", false, "turn on HTTP latency stat (DNSLookup, TCP Connection, etc.)") - runCmd.Flags().BoolVar(&pluginLogOn, "log-plugin", false, "turn on plugin logging") - runCmd.Flags().StringVarP(&proxyUrl, "proxy-url", "p", "", "set proxy url") - runCmd.Flags().BoolVarP(&saveTests, "save-tests", "s", false, "save tests summary") - runCmd.Flags().BoolVarP(&genHTMLReport, "gen-html-report", "g", false, "generate html report") - runCmd.Flags().Float32Var(&caseTimeout, "case-timeout", 3600, "set testcase timeout (seconds)") + CmdRun.Flags().BoolVarP(&continueOnFailure, "continue-on-failure", "c", false, "continue running next step when failure occurs") + CmdRun.Flags().BoolVar(&requestsLogOff, "log-requests-off", false, "turn off request & response details logging") + CmdRun.Flags().BoolVar(&httpStatOn, "http-stat", false, "turn on HTTP latency stat (DNSLookup, TCP Connection, etc.)") + CmdRun.Flags().BoolVar(&pluginLogOn, "log-plugin", false, "turn on plugin logging") + CmdRun.Flags().StringVarP(&proxyUrl, "proxy-url", "p", "", "set proxy url") + CmdRun.Flags().BoolVarP(&saveTests, "save-tests", "s", false, "save tests summary") + CmdRun.Flags().BoolVarP(&genHTMLReport, "gen-html-report", "g", false, "generate html report") + CmdRun.Flags().Float32Var(&caseTimeout, "case-timeout", 3600, "set testcase timeout (seconds)") } func makeHRPRunner() *hrp.HRPRunner { diff --git a/cmd/scaffold.go b/cmd/scaffold.go index f4028d23..77c1cd1b 100644 --- a/cmd/scaffold.go +++ b/cmd/scaffold.go @@ -9,7 +9,7 @@ import ( "github.com/httprunner/httprunner/v5/internal/scaffold" ) -var scaffoldCmd = &cobra.Command{ +var CmdScaffold = &cobra.Command{ Use: "startproject $project_name", Aliases: []string{"scaffold"}, Short: "create a scaffold project", @@ -49,10 +49,9 @@ var ( ) func init() { - rootCmd.AddCommand(scaffoldCmd) - scaffoldCmd.Flags().BoolVarP(&force, "force", "f", false, "force to overwrite existing project") - scaffoldCmd.Flags().BoolVar(&genPythonPlugin, "py", true, "generate hashicorp python plugin") - scaffoldCmd.Flags().BoolVar(&genGoPlugin, "go", false, "generate hashicorp go plugin") - scaffoldCmd.Flags().BoolVar(&ignorePlugin, "ignore-plugin", false, "ignore function plugin") - scaffoldCmd.Flags().BoolVar(&empty, "empty", false, "generate empty project") + CmdScaffold.Flags().BoolVarP(&force, "force", "f", false, "force to overwrite existing project") + CmdScaffold.Flags().BoolVar(&genPythonPlugin, "py", true, "generate hashicorp python plugin") + CmdScaffold.Flags().BoolVar(&genGoPlugin, "go", false, "generate hashicorp go plugin") + CmdScaffold.Flags().BoolVar(&ignorePlugin, "ignore-plugin", false, "ignore function plugin") + CmdScaffold.Flags().BoolVar(&empty, "empty", false, "generate empty project") } diff --git a/cmd/server.go b/cmd/server.go index 9a02f5cc..5fb6494d 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -8,7 +8,7 @@ import ( ) // serverCmd represents the server command -var serverCmd = &cobra.Command{ +var CmdServer = &cobra.Command{ Use: "server start", Short: "start hrp server", Long: `start hrp server, call httprunner by HTTP`, @@ -29,7 +29,6 @@ var ( ) func init() { - rootCmd.AddCommand(serverCmd) - serverCmd.Flags().IntVarP(&port, "port", "p", 8082, "port to run the server on") - serverCmd.Flags().StringVarP(&mcpConfigPath, "mcp-config", "c", "$HOME/.hrp/mcp.json", "path to the MCP config file") + CmdServer.Flags().IntVarP(&port, "port", "p", 8082, "port to run the server on") + CmdServer.Flags().StringVarP(&mcpConfigPath, "mcp-config", "c", "$HOME/.hrp/mcp.json", "path to the MCP config file") } diff --git a/cmd/wiki.go b/cmd/wiki.go index a89720b3..380f04d9 100644 --- a/cmd/wiki.go +++ b/cmd/wiki.go @@ -10,7 +10,7 @@ import ( "github.com/httprunner/httprunner/v5/internal/wiki" ) -var wikiCmd = &cobra.Command{ +var CmdWiki = &cobra.Command{ Use: "wiki", Aliases: []string{"info", "docs", "doc"}, Short: "visit https://httprunner.com", @@ -26,7 +26,3 @@ var wikiCmd = &cobra.Command{ return wiki.OpenWiki() }, } - -func init() { - rootCmd.AddCommand(wikiCmd) -} diff --git a/docs/cmd/hrp.md b/docs/cmd/hrp.md index 1a594405..5ee9573a 100644 --- a/docs/cmd/hrp.md +++ b/docs/cmd/hrp.md @@ -1,6 +1,6 @@ ## hrp -Next-Generation API Testing Solution. +All-in-One Testing Framework for API, UI and Performance ### Synopsis @@ -12,30 +12,52 @@ Next-Generation API Testing Solution. ██║ ██║ ██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║██║ ╚████║███████╗██║ ██║ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ -HttpRunner is an open source API testing tool that supports HTTP(S)/HTTP2/WebSocket/RPC -network protocols, covering API testing, performance testing and digital experience -monitoring (DEM) test types. Enjoy! ✨ 🚀 ✨ +HttpRunner: Enjoy your All-in-One Testing Solution ✨ 🚀 ✨ -License: Apache-2.0 +💡 Simple Yet Powerful + - Natural language driven test scenarios powered by LLM + - User-friendly SDK API with IDE auto-completion + - Intuitive GoTest/YAML/JSON/Text testcase format + +📌 Comprehensive Testing Capabilities + - UI Automation: Android/iOS/Harmony/Browser + - API Testing: HTTP(S)/HTTP2/WebSocket/RPC + - Load Testing: run API testcase concurrently with boomer + +🧩 High Scalability + - Plugin system for custom functions + - Distributed testing support + - Cross-platform: macOS/Linux/Windows + +🛠 Easy Integration + - CI/CD friendly with JSON logs and HTML reports + - Rich ecosystem tools + +Learn more: Website: https://httprunner.com -Github: https://github.com/httprunner/httprunner -Copyright 2017 debugtalk +GitHub: https://github.com/httprunner/httprunner + +Copyright © 2017-present debugtalk. Apache-2.0 License. ### Options ``` - -h, --help help for hrp + -h, --help help for hrp + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path ``` ### SEE ALSO -* [hrp boom](hrp_boom.md) - run load test with boomer +* [hrp adb](hrp_adb.md) - simple utils for android device management * [hrp build](hrp_build.md) - build plugin for testing * [hrp convert](hrp_convert.md) - convert multiple source format to HttpRunner JSON/YAML/gotest/pytest cases +* [hrp ios](hrp_ios.md) - simple utils for ios device management * [hrp pytest](hrp_pytest.md) - run API test with pytest * [hrp run](hrp_run.md) - run API test with go engine * [hrp server](hrp_server.md) - start hrp server * [hrp startproject](hrp_startproject.md) - create a scaffold project * [hrp wiki](hrp_wiki.md) - visit https://httprunner.com -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_adb.md b/docs/cmd/hrp_adb.md new file mode 100644 index 00000000..d36a15d7 --- /dev/null +++ b/docs/cmd/hrp_adb.md @@ -0,0 +1,26 @@ +## hrp adb + +simple utils for android device management + +### Options + +``` + -h, --help help for adb +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance +* [hrp adb devices](hrp_adb_devices.md) - List all Android devices +* [hrp adb install](hrp_adb_install.md) - push package to the device and install them automatically +* [hrp adb screencap](hrp_adb_screencap.md) - Start android screen capture + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_adb_devices.md b/docs/cmd/hrp_adb_devices.md new file mode 100644 index 00000000..ba23be21 --- /dev/null +++ b/docs/cmd/hrp_adb_devices.md @@ -0,0 +1,27 @@ +## hrp adb devices + +List all Android devices + +``` +hrp adb devices [flags] +``` + +### Options + +``` + -h, --help help for devices +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp adb](hrp_adb.md) - simple utils for android device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_adb_install.md b/docs/cmd/hrp_adb_install.md new file mode 100644 index 00000000..09200a47 --- /dev/null +++ b/docs/cmd/hrp_adb_install.md @@ -0,0 +1,31 @@ +## hrp adb install + +push package to the device and install them automatically + +``` +hrp adb install [flags] PACKAGE +``` + +### Options + +``` + -d, --downgrade allow version code downgrade (debuggable packages only) + -g, --grant grant all runtime permissions + -h, --help help for install + -r, --replace replace existing application + -s, --serial string filter by device's serial +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp adb](hrp_adb.md) - simple utils for android device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_adb_screencap.md b/docs/cmd/hrp_adb_screencap.md new file mode 100644 index 00000000..d6a12f23 --- /dev/null +++ b/docs/cmd/hrp_adb_screencap.md @@ -0,0 +1,28 @@ +## hrp adb screencap + +Start android screen capture + +``` +hrp adb screencap [flags] +``` + +### Options + +``` + -h, --help help for screencap + -s, --serial string filter by device's serial +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp adb](hrp_adb.md) - simple utils for android device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_build.md b/docs/cmd/hrp_build.md index 16b4b077..eacd2dc5 100644 --- a/docs/cmd/hrp_build.md +++ b/docs/cmd/hrp_build.md @@ -24,8 +24,16 @@ hrp build $path ... [flags] -o, --output string funplugin product output path, default: cwd ``` +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + ### SEE ALSO -* [hrp](hrp.md) - Next-Generation API Testing Solution. +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_convert.md b/docs/cmd/hrp_convert.md index cd692ae1..e89948b1 100644 --- a/docs/cmd/hrp_convert.md +++ b/docs/cmd/hrp_convert.md @@ -22,8 +22,16 @@ hrp convert $path... [flags] --to-yaml convert to YAML case scripts ``` +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + ### SEE ALSO -* [hrp](hrp.md) - Next-Generation API Testing Solution. +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios.md b/docs/cmd/hrp_ios.md new file mode 100644 index 00000000..9d5e0604 --- /dev/null +++ b/docs/cmd/hrp_ios.md @@ -0,0 +1,32 @@ +## hrp ios + +simple utils for ios device management + +### Options + +``` + -h, --help help for ios +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance +* [hrp ios apps](hrp_ios_apps.md) - List all iOS installed apps +* [hrp ios devices](hrp_ios_devices.md) - List all iOS devices +* [hrp ios install](hrp_ios_install.md) - push package to the device and install them automatically +* [hrp ios mount](hrp_ios_mount.md) - A brief description of your command +* [hrp ios ps](hrp_ios_ps.md) - show running processes +* [hrp ios reboot](hrp_ios_reboot.md) - reboot ios device +* [hrp ios tunnel](hrp_ios_tunnel.md) - tunnel start +* [hrp ios uninstall](hrp_ios_uninstall.md) - uninstall package automatically +* [hrp ios xctest](hrp_ios_xctest.md) - run xctest + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_apps.md b/docs/cmd/hrp_ios_apps.md new file mode 100644 index 00000000..9247f336 --- /dev/null +++ b/docs/cmd/hrp_ios_apps.md @@ -0,0 +1,29 @@ +## hrp ios apps + +List all iOS installed apps + +``` +hrp ios apps [flags] +``` + +### Options + +``` + -h, --help help for apps + -t, --type string filter application type [user|system|internal|all] (default "user") + -u, --udid string specify device by udid +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_devices.md b/docs/cmd/hrp_ios_devices.md new file mode 100644 index 00000000..08a90e2b --- /dev/null +++ b/docs/cmd/hrp_ios_devices.md @@ -0,0 +1,27 @@ +## hrp ios devices + +List all iOS devices + +``` +hrp ios devices [flags] +``` + +### Options + +``` + -h, --help help for devices +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_install.md b/docs/cmd/hrp_ios_install.md new file mode 100644 index 00000000..65d5cdf1 --- /dev/null +++ b/docs/cmd/hrp_ios_install.md @@ -0,0 +1,28 @@ +## hrp ios install + +push package to the device and install them automatically + +``` +hrp ios install [flags] PACKAGE +``` + +### Options + +``` + -h, --help help for install + -u, --udid string filter by device's serial +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_mount.md b/docs/cmd/hrp_ios_mount.md new file mode 100644 index 00000000..304baf3f --- /dev/null +++ b/docs/cmd/hrp_ios_mount.md @@ -0,0 +1,31 @@ +## hrp ios mount + +A brief description of your command + +``` +hrp ios mount [flags] +``` + +### Options + +``` + -d, --dir string specify developer disk image directory (default "/Users/debugtalk/.devimages") + -h, --help help for mount + --list list developer disk images + --reset unmount developer disk images + -u, --udid string specify device by udid +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_ps.md b/docs/cmd/hrp_ios_ps.md new file mode 100644 index 00000000..e47c2c36 --- /dev/null +++ b/docs/cmd/hrp_ios_ps.md @@ -0,0 +1,29 @@ +## hrp ios ps + +show running processes + +``` +hrp ios ps [flags] +``` + +### Options + +``` + -a, --all print all processes including system processes + -h, --help help for ps + -u, --udid string specify device by udid +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_reboot.md b/docs/cmd/hrp_ios_reboot.md new file mode 100644 index 00000000..8479c4e1 --- /dev/null +++ b/docs/cmd/hrp_ios_reboot.md @@ -0,0 +1,28 @@ +## hrp ios reboot + +reboot ios device + +``` +hrp ios reboot [flags] +``` + +### Options + +``` + -h, --help help for reboot + -u, --udid string specify device by udid +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_tunnel.md b/docs/cmd/hrp_ios_tunnel.md new file mode 100644 index 00000000..c4e49451 --- /dev/null +++ b/docs/cmd/hrp_ios_tunnel.md @@ -0,0 +1,27 @@ +## hrp ios tunnel + +tunnel start + +``` +hrp ios tunnel [flags] +``` + +### Options + +``` + -h, --help help for tunnel +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_uninstall.md b/docs/cmd/hrp_ios_uninstall.md new file mode 100644 index 00000000..35bfed94 --- /dev/null +++ b/docs/cmd/hrp_ios_uninstall.md @@ -0,0 +1,29 @@ +## hrp ios uninstall + +uninstall package automatically + +``` +hrp ios uninstall [flags] PACKAGE +``` + +### Options + +``` + -b, --bundleId string bundleId to uninstall + -h, --help help for uninstall + -u, --udid string filter by device's serial +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_ios_xctest.md b/docs/cmd/hrp_ios_xctest.md new file mode 100644 index 00000000..c9937bed --- /dev/null +++ b/docs/cmd/hrp_ios_xctest.md @@ -0,0 +1,31 @@ +## hrp ios xctest + +run xctest + +``` +hrp ios xctest [flags] +``` + +### Options + +``` + -b, --bundleID string specify ios bundleID (default "com.gtf.wda.runner.xctrunner") + -h, --help help for xctest + -t, --testRunnerBundleID string specify ios testRunnerBundleID (default "com.gtf.wda.runner.xctrunner") + -u, --udid string specify ios device's UDID + -x, --xctestConfig string specify ios xctestConfig (default "GtfWdaRunner.xctest") +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + +### SEE ALSO + +* [hrp ios](hrp_ios.md) - simple utils for ios device management + +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_pytest.md b/docs/cmd/hrp_pytest.md index c7c3923d..034b2289 100644 --- a/docs/cmd/hrp_pytest.md +++ b/docs/cmd/hrp_pytest.md @@ -12,8 +12,16 @@ hrp pytest $path ... [flags] -h, --help help for pytest ``` +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + ### SEE ALSO -* [hrp](hrp.md) - Next-Generation API Testing Solution. +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_run.md b/docs/cmd/hrp_run.md index a7fcf82f..2d9f41fc 100644 --- a/docs/cmd/hrp_run.md +++ b/docs/cmd/hrp_run.md @@ -32,8 +32,16 @@ hrp run $path... [flags] -s, --save-tests save tests summary ``` +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + ### SEE ALSO -* [hrp](hrp.md) - Next-Generation API Testing Solution. +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_server.md b/docs/cmd/hrp_server.md index e6dd9e56..96ccfeb7 100644 --- a/docs/cmd/hrp_server.md +++ b/docs/cmd/hrp_server.md @@ -4,7 +4,7 @@ start hrp server ### Synopsis -start hrp server. exec automation by http +start hrp server, call httprunner by HTTP ``` hrp server start [flags] @@ -13,12 +13,21 @@ hrp server start [flags] ### Options ``` - -h, --help help for server - -p, --port int Port to run the server on (default 8082) + -h, --help help for server + -c, --mcp-config string path to the MCP config file (default "$HOME/.hrp/mcp.json") + -p, --port int port to run the server on (default 8082) +``` + +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path ``` ### SEE ALSO -* [hrp](hrp.md) - Next-Generation API Testing Solution. +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_startproject.md b/docs/cmd/hrp_startproject.md index f321ff1a..52dfc6c7 100644 --- a/docs/cmd/hrp_startproject.md +++ b/docs/cmd/hrp_startproject.md @@ -17,8 +17,16 @@ hrp startproject $project_name [flags] --py generate hashicorp python plugin (default true) ``` +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + ### SEE ALSO -* [hrp](hrp.md) - Next-Generation API Testing Solution. +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/docs/cmd/hrp_wiki.md b/docs/cmd/hrp_wiki.md index 95f28ef1..3437e9c7 100644 --- a/docs/cmd/hrp_wiki.md +++ b/docs/cmd/hrp_wiki.md @@ -12,8 +12,16 @@ hrp wiki [flags] -h, --help help for wiki ``` +### Options inherited from parent commands + +``` + --log-json set log to json format (default colorized console) + -l, --log-level string set log level (default "INFO") + --venv string specify python3 venv path +``` + ### SEE ALSO -* [hrp](hrp.md) - Next-Generation API Testing Solution. +* [hrp](hrp.md) - All-in-One Testing Framework for API, UI and Performance -###### Auto generated by spf13/cobra on 9-Nov-2024 +###### Auto generated by spf13/cobra on 24-Apr-2025 diff --git a/internal/version/VERSION b/internal/version/VERSION index 3ea45e4d..6bc8bb73 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2504242112 +v5.0.0-beta-2504242231