Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,21 @@ steps:
- BUILDKITE_ANALYTICS_TAGS
- BUILDKITE_ANALYTICS_DEBUG_ENABLED

- label: ":swift: Swift: XCUITest (test-collector-swift)"
command: swift-xcuitest/bin/test
agents:
queue: macos
artifact_paths:
- swift-xcuitest/artifacts/SwiftXCUITest.xcresult/**/*
env:
BUILDKITE_ANALYTICS_TAGS: '{"test.framework.name":"xcuitest","language.name":"swift","custom.tag.from":"upload"}'
plugins:
- tests#v1.0.0:
test-runner: custom
suite-slug: test-engine-client-examples
upload-results: false
install-client: false

- label: ":android: Android"
commands:
- cd android
Expand Down
1 change: 1 addition & 0 deletions swift-xcuitest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
artifacts/
12 changes: 12 additions & 0 deletions swift-xcuitest/ExampleApp/ExampleApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import SwiftUI

@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
Text("Swift XCUITest example")
.accessibilityIdentifier("status")
.padding()
}
}
}
24 changes: 24 additions & 0 deletions swift-xcuitest/ExampleAppUITests/ExampleAppUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Core
import XCTest

final class ExampleAppUITests: XCTestCase {
override func setUpWithError() throws {
continueAfterFailure = false
}

func test01AppLaunches() {
let app = XCUIApplication()
app.launch()

XCTAssertTrue(app.staticTexts["status"].waitForExistence(timeout: 5))
}

func test02ExecutionTag() {
tagExecution("custom.tag.from", "execution")

let app = XCUIApplication()
app.launch()

XCTAssertEqual(app.staticTexts["status"].label, "Swift XCUITest example")
}
}
15 changes: 15 additions & 0 deletions swift-xcuitest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Swift XCUITest example

This example runs passing UI tests against a minimal iOS app and uploads the
results with [`test-collector-swift`](https://github.com/buildkite/test-collector-swift).
It uses a shared scheme, a lexical test plan, and an explicit `.xcresult`
bundle so the same command works locally and on a macOS Buildkite agent.

Run it with:

```sh
bin/test
```

The script selects the first available iPhone Simulator. Set
`XCUITEST_DESTINATION` to pass a different `xcodebuild` destination.
Loading