mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
change: update tests
This commit is contained in:
@@ -164,6 +164,9 @@ func (dev *IOSDevice) Setup() error {
|
||||
dev.DeviceEntry.UserspaceTUNPort = info.UserspaceTUNPort
|
||||
dev.DeviceEntry.UserspaceTUN = info.UserspaceTUN
|
||||
rsdService, err := ios.NewWithAddrPortDevice(info.Address, info.RsdPort, dev.DeviceEntry)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer rsdService.Close()
|
||||
rsdProvider, err := rsdService.Handshake()
|
||||
if err != nil {
|
||||
|
||||
@@ -56,21 +56,6 @@ const (
|
||||
defaultMjpegPort = 9100
|
||||
)
|
||||
|
||||
const (
|
||||
// Changes the value of maximum depth for traversing elements source tree.
|
||||
// It may help to prevent out of memory or timeout errors while getting the elements source tree,
|
||||
// but it might restrict the depth of source tree.
|
||||
// A part of elements source tree might be lost if the value was too small. Defaults to 50
|
||||
defaultSnapshotMaxDepth = 10
|
||||
// Allows to customize accept/dismiss alert button selector.
|
||||
// It helps you to handle an arbitrary element as accept button in accept alert command.
|
||||
// The selector should be a valid class chain expression, where the search root is the alert element itself.
|
||||
// The default button location algorithm is used if the provided selector is wrong or does not match any element.
|
||||
// e.g. **/XCUIElementTypeButton[`label CONTAINS[c] 'accept'`]
|
||||
acceptAlertButtonSelector = "**/XCUIElementTypeButton[`label IN {'允许','好','仅在使用应用期间','稍后再说'}`]"
|
||||
dismissAlertButtonSelector = "**/XCUIElementTypeButton[`label IN {'不允许','暂不'}`]"
|
||||
)
|
||||
|
||||
func NewIOSDeviceOptions(opts ...IOSDeviceOption) *IOSDeviceOptions {
|
||||
config := &IOSDeviceOptions{}
|
||||
for _, opt := range opts {
|
||||
@@ -84,16 +69,6 @@ func NewIOSDeviceOptions(opts ...IOSDeviceOption) *IOSDeviceOptions {
|
||||
config.WDAMjpegPort = defaultMjpegPort
|
||||
}
|
||||
|
||||
if config.SnapshotMaxDepth == 0 {
|
||||
config.SnapshotMaxDepth = defaultSnapshotMaxDepth
|
||||
}
|
||||
if config.AcceptAlertButtonSelector == "" {
|
||||
config.AcceptAlertButtonSelector = acceptAlertButtonSelector
|
||||
}
|
||||
if config.DismissAlertButtonSelector == "" {
|
||||
config.DismissAlertButtonSelector = dismissAlertButtonSelector
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user