Merge pull request #1531 from httprunner/wcl

release v4.3.1

- feat: add option WithScreenShot
- feat: run xctest before start ios automation
- feat: run step with specified loop times
- feat: add options for FindTexts
- refactor: move all UI APIs to uixt pkg
- docs: add examples for UI APIs
This commit is contained in:
debugtalk
2022-12-14 00:31:04 +08:00
40 changed files with 1054 additions and 592 deletions

View File

@@ -1,10 +1,5 @@
package hrp
import (
"github.com/httprunner/httprunner/v4/hrp/pkg/gidevice"
"github.com/httprunner/httprunner/v4/hrp/pkg/uixt"
)
type StepType string
const (
@@ -19,39 +14,6 @@ const (
stepTypeIOS StepType = "ios"
)
var (
WithIdentifier = uixt.WithIdentifier
WithMaxRetryTimes = uixt.WithMaxRetryTimes
WithWaitTime = uixt.WithWaitTime // only applicable to SwipeToTap* action
WithIndex = uixt.WithIndex // index of the target element, should start from 1, only applicable to ocr actions
WithTimeout = uixt.WithTimeout
WithIgnoreNotFoundError = uixt.WithIgnoreNotFoundError
WithText = uixt.WithText
WithID = uixt.WithID
WithDescription = uixt.WithDescription
WithDuration = uixt.WithDuration // only applicable to ios swipe action
WithSteps = uixt.WithSteps // only applicable to android swipe action
WithDirection = uixt.WithDirection
WithCustomDirection = uixt.WithCustomDirection
WithScope = uixt.WithScope // only applicable to ocr actions
WithOffset = uixt.WithOffset
)
var (
WithPerfSystemCPU = gidevice.WithPerfSystemCPU
WithPerfSystemMem = gidevice.WithPerfSystemMem
WithPerfSystemDisk = gidevice.WithPerfSystemDisk
WithPerfSystemNetwork = gidevice.WithPerfSystemNetwork
WithPerfGPU = gidevice.WithPerfGPU
WithPerfFPS = gidevice.WithPerfFPS
WithPerfNetwork = gidevice.WithPerfNetwork
WithPerfBundleID = gidevice.WithPerfBundleID
WithPerfPID = gidevice.WithPerfPID
WithPerfOutputInterval = gidevice.WithPerfOutputInterval
WithPerfProcessAttributes = gidevice.WithPerfProcessAttributes
WithPerfSystemAttributes = gidevice.WithPerfSystemAttributes
)
type StepResult struct {
Name string `json:"name" yaml:"name"` // step name
StepType StepType `json:"step_type" yaml:"step_type"` // step type, testcase/request/transaction/rendezvous
@@ -83,6 +45,7 @@ type TStep struct {
Extract map[string]string `json:"extract,omitempty" yaml:"extract,omitempty"`
Validators []interface{} `json:"validate,omitempty" yaml:"validate,omitempty"`
Export []string `json:"export,omitempty" yaml:"export,omitempty"`
Loops int `json:"loops,omitempty" yaml:"loops,omitempty"`
}
// IStep represents interface for all types for teststeps, includes: