Files
Project_Velocity/iOS/velocity-ipad/velocityUITests/VelocityCriticalFlowUITests.swift
Sayan Datta 6c93e31741
All checks were successful
Production Readiness / backend-contracts (pull_request) Successful in 3m19s
Production Readiness / webos-typecheck (pull_request) Successful in 2m38s
Production Readiness / ipad-parse (pull_request) Successful in 1m44s
feat: Ipad app production readiness, Colony orchestration, Social posting
2026-05-03 18:28:04 +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)
}
}