mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
* `@preconcurrency @MainActor` isolation of `Store` * Remove unneeded `@MainActor`s * Remove thread checking code * Remove unneeded `@MainActor`s * Swift 5.10 compatibility fixes * wip * More 5.10 fixes * wip * fixes * wip * wip * up the timeout * wip * Fixes * Remove mainActorASAP in favor of mainActorNow. (#3288) * wip * Run swift-format * Update README.md * Fix integration tests. (#3294) * Fix integration tests. * wip * wip * Run swift-format * mainActorNow doesnt need escaping closure * wip * migration guide * wip * Update MigratingTo1.14.md --------- Co-authored-by: Brandon Williams <mbrandonw@hey.com> Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com> Co-authored-by: mbrandonw <mbrandonw@users.noreply.github.com>
48 lines
1.5 KiB
Swift
48 lines
1.5 KiB
Swift
import XCTest
|
|
|
|
final class SyncUpsUITests: XCTestCase {
|
|
@MainActor
|
|
var app: XCUIApplication = {
|
|
let app = XCUIApplication()
|
|
app.launchEnvironment = [
|
|
"UITesting": "true"
|
|
]
|
|
return app
|
|
}()
|
|
|
|
override func setUp() {
|
|
continueAfterFailure = false
|
|
}
|
|
|
|
// This test demonstrates the simple flow of tapping the "Add" button, filling in some fields in
|
|
// the form, and then adding the sync-up to the list. It's a very simple test, but it takes
|
|
// approximately 10 seconds to run, and it depends on a lot of internal implementation details to
|
|
// get right, such as tapping a button with the literal label "Add".
|
|
//
|
|
// This test is also written in the simpler, "unit test" style in SyncUpsListTests.swift, where
|
|
// it takes 0.025 seconds (400 times faster) and it even tests more. It further confirms that when
|
|
// the sync-up is added to the list its data will be persisted to disk so that it will be
|
|
// available on next launch.
|
|
@MainActor
|
|
func testAdd() throws {
|
|
app.launch()
|
|
app.navigationBars["Daily Sync-ups"].buttons["Add"].tap()
|
|
|
|
let collectionViews = app.collectionViews
|
|
let titleTextField = collectionViews.textFields["Title"]
|
|
let nameTextField = collectionViews.textFields["Name"]
|
|
|
|
titleTextField.typeText("Engineering")
|
|
|
|
nameTextField.tap()
|
|
nameTextField.typeText("Blob")
|
|
|
|
collectionViews.buttons["New attendee"].tap()
|
|
app.typeText("Blob Jr.")
|
|
|
|
app.navigationBars["New sync-up"].buttons["Add"].tap()
|
|
|
|
XCTAssertEqual(collectionViews.staticTexts["Engineering"].exists, true)
|
|
}
|
|
}
|