Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusFailed = TestCaseStatus("failed") // Defined by Apple StatusPassed = TestCaseStatus("passed") // Defined by Apple StatusExpectedFailure = TestCaseStatus("expected failure") // Defined by Apple StatusStalled = TestCaseStatus("stalled") // Defined by us )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestAttachment ¶
type TestCase ¶
type TestCase struct {
ClassName string
MethodName string
Status TestCaseStatus
Err TestError
Duration time.Duration
Attachments []TestAttachment
}
type TestCaseStatus ¶
type TestCaseStatus string
type TestConfig ¶
type TestConfig struct {
// The identifier of the app under test
BundleId string
// The identifier of the test runner. For unit tests (non-UI tests) this is also the
// app under test (BundleId can be left empty) as the .xctest bundle is packaged into the app under test
TestRunnerBundleId string
// XctestConfigName is the name of the
XctestConfigName string
// Env is passed as environment variables to the test runner
Env map[string]any
// Args are passed to the test runner as launch arguments
Args []string
// TestsToRun specifies a list of tests that should be executed. All other tests are ignored. To execute all tests
// pass nil.
// The format of the values is {PRODUCT_MODULE_NAME}.{CLASS}/{METHOD} where {PRODUCT_MODULE_NAME} and {METHOD} are
// optional. If {METHOD} is omitted, all tests of {CLASS} are executed
TestsToRun []string
// TestsToSkip specifies a list of tests that should be skipped. See TestsToRun for the format
TestsToSkip []string
// XcTest needs to be set to true if the TestRunnerBundleId is a unit test and not a UI test
XcTest bool
// The device on which the test is executed
Device ios.DeviceEntry
// The listener for receiving results
Listener *TestListener
}
TestConfig specifies the parameters of a test execution
type TestListener ¶
type TestListener struct {
TestSuites []TestSuite
// contains filtered or unexported fields
}
TestListener collects test results from the test execution
func NewTestListener ¶
func (*TestListener) Done ¶
func (t *TestListener) Done() <-chan struct{}
func (*TestListener) FinishWithError ¶
func (t *TestListener) FinishWithError(err error)
func (*TestListener) LogDebugMessage ¶
func (t *TestListener) LogDebugMessage(msg string)
func (*TestListener) LogMessage ¶
func (t *TestListener) LogMessage(msg string)
func (*TestListener) TestRunnerKilled ¶
func (t *TestListener) TestRunnerKilled()
type TestSuite ¶
type TestSuite struct {
Name string
StartDate time.Time
EndDate time.Time
TestDuration time.Duration
TotalDuration time.Duration
TestCases []TestCase
}
func RunTestWithConfig ¶
func RunTestWithConfig(ctx context.Context, testConfig TestConfig) ([]TestSuite, error)
func StartXCTestWithConfig ¶
func StartXCTestWithConfig(ctx context.Context, xctestrunFilePath string, device ios.DeviceEntry, listener *TestListener) ([]TestSuite, error)
Click to show internal directories.
Click to hide internal directories.