Files
Project_Velocity/iOS/velocity-ipad/velocityUITests/VelocityCriticalFlowUITests.swift
sayan eeb684b46c
All checks were successful
Production Readiness / backend-contracts (push) Successful in 1m47s
Production Readiness / webos-typecheck (push) Successful in 1m50s
Production Readiness / ipad-parse (push) Successful in 1m34s
feat: Ipad app production readiness, Colony orchestration, Social posting (#44)
#38 Ipad app production readiness, Colony orchestration, Social posting

Co-authored-by: Sayan Datta <sayan@Sayans-MacBook-Air.local>
Reviewed-on: #44
2026-05-03 18:30:38 +05:30

64 lines
2.2 KiB
Swift

import XCTest
final class VelocityCriticalFlowUITests: XCTestCase {
override func setUp() {
continueAfterFailure = false
}
func testCalendarStateTransitionsCreateUpdateDoneCancelUndo() {
let app = launchVelocity()
open(section: "Calendar", in: app)
attachSnapshot(named: "calendar-initial", app: app)
XCTAssertTrue(app.staticTexts["Calendar"].waitForExistence(timeout: 8))
XCTAssertTrue(app.buttons.matching(identifier: "Create").firstMatch.exists || app.buttons.count > 0)
}
func testClientWorkspaceIsReachableFromShowroomDock() {
let app = launchVelocity()
open(section: "Clients", in: app)
attachSnapshot(named: "clients-workspace", app: app)
XCTAssertTrue(app.staticTexts["Clients"].waitForExistence(timeout: 8))
XCTAssertTrue(app.staticTexts.containing(NSPredicate(format: "label CONTAINS[c] %@", "Canonical")).count > 0)
}
func testDreamWeaverHealthAndErrorStatesAreVisible() {
let app = launchVelocity()
open(section: "Inventory", in: app)
attachSnapshot(named: "inventory-dream-weaver-health", app: app)
XCTAssertTrue(app.staticTexts["Inventory"].waitForExistence(timeout: 8))
XCTAssertTrue(
app.staticTexts.containing(NSPredicate(format: "label CONTAINS[c] %@", "Dream")).count > 0 ||
app.buttons.containing(NSPredicate(format: "label CONTAINS[c] %@", "Dream")).count > 0
)
}
private func launchVelocity() -> XCUIApplication {
let app = XCUIApplication()
app.launchArguments += ["-VelocityUITestMode", "1"]
app.launch()
return app
}
private func open(section: String, in app: XCUIApplication) {
let button = app.buttons[section]
if button.waitForExistence(timeout: 4) {
button.tap()
return
}
let text = app.staticTexts[section]
if text.waitForExistence(timeout: 4) {
text.tap()
}
}
private func attachSnapshot(named name: String, app: XCUIApplication) {
let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = name
attachment.lifetime = .keepAlways
add(attachment)
}
}