feat: consolidate iOS with API and web preserving history
Rebuild & Deploy / rebuild (push) Failing after 23s
Rebuild & Deploy / rebuild (push) Failing after 23s
This commit is contained in:
commit
d735ee72fa
102 files changed
+13077
-258
No files matched your search
@@ -0,0 +1,94 @@
|
||||
import XCTest
|
||||
|
||||
final class ChatUITests: XCTestCase {
|
||||
func testNativeTextChatWithoutVoiceAndAccountPrivacy() {
|
||||
let app = XCUIApplication()
|
||||
app.launchArguments = ["--ui-testing", "--reset-ui-testing", "--ui-chat", "-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryL"]
|
||||
app.launch()
|
||||
XCTAssertTrue(app.navigationBars["Chats"].waitForExistence(timeout: 10))
|
||||
app.buttons["New chat"].tap()
|
||||
let field = app.textFields["chat-draft"]
|
||||
XCTAssertTrue(field.waitForExistence(timeout: 10))
|
||||
field.tap(); field.typeText("Native offline text")
|
||||
app.buttons["Send message"].tap()
|
||||
XCTAssertTrue(app.staticTexts["Native offline text"].waitForExistence(timeout: 10))
|
||||
XCTAssertTrue(app.staticTexts["Offline reply"].exists)
|
||||
app.swipeDown()
|
||||
capture(app, "Native chat standard Opal")
|
||||
XCTAssertFalse(app.buttons["End conversation"].exists)
|
||||
app.navigationBars.buttons.element(boundBy: 0).tap()
|
||||
app.buttons["Chat options"].tap()
|
||||
app.buttons["Sign out"].tap()
|
||||
XCTAssertTrue(app.secureTextFields["Password"].waitForExistence(timeout: 10))
|
||||
XCTAssertFalse(app.staticTexts["Native offline text"].exists)
|
||||
}
|
||||
func testOfflineAdvancedLibraryAndArtifactEditor() {
|
||||
let app = XCUIApplication()
|
||||
app.launchArguments = ["--ui-testing", "--reset-ui-testing", "--ui-chat", "-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryL"]
|
||||
app.launch()
|
||||
XCTAssertTrue(app.buttons["Chat options"].waitForExistence(timeout: 10))
|
||||
app.buttons["Chat options"].tap(); app.buttons["Library and tools"].tap()
|
||||
XCTAssertTrue(app.buttons["New artifact"].waitForExistence(timeout: 10))
|
||||
app.buttons["New artifact"].tap()
|
||||
XCTAssertTrue(app.textFields["Title"].waitForExistence(timeout: 10))
|
||||
app.textFields["Title"].tap(); app.textFields["Title"].typeText("Local artifact")
|
||||
app.textViews.firstMatch.tap(); app.textViews.firstMatch.typeText("Native fixture content")
|
||||
app.buttons["Save"].tap()
|
||||
let artifact = app.buttons.matching(NSPredicate(format: "label CONTAINS 'Local artifact'")).firstMatch
|
||||
XCTAssertTrue(artifact.waitForExistence(timeout: 10))
|
||||
artifact.tap()
|
||||
XCTAssertTrue(app.textViews.firstMatch.waitForExistence(timeout: 10))
|
||||
XCTAssertEqual(app.textViews.firstMatch.value as? String, "Native fixture content")
|
||||
capture(app, "Native artifact")
|
||||
app.buttons["Cancel"].tap()
|
||||
app.buttons["Done"].tap()
|
||||
}
|
||||
private func capture(_ app: XCUIApplication, _ name: String) {
|
||||
let attachment = XCTAttachment(screenshot: app.screenshot()); attachment.name = name; attachment.lifetime = .keepAlways; add(attachment)
|
||||
}
|
||||
func testWorkspaceNativeFixture() {
|
||||
let app = XCUIApplication()
|
||||
app.launchArguments = ["--ui-testing", "--reset-ui-testing", "--ui-chat", "-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryL"]
|
||||
app.launch()
|
||||
XCTAssertTrue(app.buttons["Chat options"].waitForExistence(timeout: 10))
|
||||
app.buttons["Chat options"].tap(); app.buttons["Manage workspaces"].tap()
|
||||
let field = app.textFields["Workspace name"]
|
||||
XCTAssertTrue(field.waitForExistence(timeout: 10)); field.tap(); field.typeText("Writing")
|
||||
app.buttons["Save workspace"].tap()
|
||||
XCTAssertTrue(app.buttons["Writing"].waitForExistence(timeout: 10))
|
||||
capture(app, "Native workspaces")
|
||||
}
|
||||
func testStandardDarkChatScreenshot() {
|
||||
let app = XCUIApplication()
|
||||
app.launchArguments = ["--ui-testing", "--reset-ui-testing", "--ui-chat", "-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryL"]
|
||||
app.launch()
|
||||
XCTAssertTrue(app.buttons["Chat options"].waitForExistence(timeout: 10))
|
||||
app.buttons["Chat options"].tap(); app.buttons["Appearance and model"].tap()
|
||||
app.buttons.matching(NSPredicate(format: "label CONTAINS 'Appearance' AND label CONTAINS 'System'")).firstMatch.tap(); app.buttons["Dark"].tap()
|
||||
app.buttons["Save appearance"].tap(); app.buttons["Done"].tap()
|
||||
capture(app, "Native chat list dark standard")
|
||||
app.buttons["New chat"].tap()
|
||||
let field = app.textFields["chat-draft"]
|
||||
XCTAssertTrue(field.waitForExistence(timeout: 10)); field.tap(); field.typeText("Dark mode fixture")
|
||||
app.buttons["Send message"].tap()
|
||||
XCTAssertTrue(app.staticTexts["Offline reply"].waitForExistence(timeout: 10))
|
||||
app.swipeDown()
|
||||
capture(app, "Native chat dark standard")
|
||||
}
|
||||
func testChatLargeTextAndPreferences() {
|
||||
let app = XCUIApplication()
|
||||
app.launchArguments = ["--ui-testing", "--reset-ui-testing", "--ui-chat", "-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryAccessibilityXXXL"]
|
||||
app.launch()
|
||||
XCTAssertTrue(app.buttons["New chat"].waitForExistence(timeout: 10))
|
||||
app.buttons["Chat options"].tap()
|
||||
app.buttons["Appearance and model"].tap()
|
||||
XCTAssertTrue(app.navigationBars["Chat preferences"].waitForExistence(timeout: 10))
|
||||
XCTAssertTrue(app.buttons["Save appearance"].exists)
|
||||
capture(app, "Appearance accessibility size")
|
||||
app.buttons["Done"].tap()
|
||||
app.tabBars.buttons["Talk"].tap()
|
||||
XCTAssertTrue(app.buttons["Start chatting"].waitForExistence(timeout: 10))
|
||||
app.tabBars.buttons["Activity"].tap()
|
||||
XCTAssertTrue(app.staticTexts["No tasks yet"].waitForExistence(timeout: 15))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user