68 lines
3.5 KiB
Swift
68 lines
3.5 KiB
Swift
import XCTest
|
|
import XCUIAutomation
|
|
|
|
final class MikeMailUITests: XCTestCase {
|
|
@MainActor
|
|
func testMailWindowAndCompose() throws {
|
|
continueAfterFailure = false
|
|
let app = XCUIApplication()
|
|
app.launchArguments = ["-ApplePersistenceIgnoreState", "YES", "-checkOnLaunch", "NO", "-idleEnabled", "NO", "-selectedFolder", "", "-selectedMessage", ""]
|
|
app.launch()
|
|
app.activate()
|
|
XCTAssertTrue(app.buttons["Neue Nachricht"].waitForExistence(timeout: 5), app.debugDescription)
|
|
XCTAssertTrue(app.staticTexts["Nachricht auswählen"].waitForExistence(timeout: 5), app.debugDescription)
|
|
app.buttons["Neue Nachricht"].click()
|
|
XCTAssertTrue(app.buttons["Anhang hinzufügen"].waitForExistence(timeout: 5))
|
|
XCTAssertFalse(app.buttons["Senden"].isEnabled)
|
|
XCTAssertTrue(app.buttons["Adressbuch"].exists)
|
|
XCTAssertTrue(app.textFields["recipientField"].exists)
|
|
XCTAssertTrue(app.textFields["composeCC"].exists)
|
|
XCTAssertTrue(app.textFields["composeBCC"].exists)
|
|
app.buttons["Abbrechen"].click()
|
|
app.buttons["Konten"].click()
|
|
XCTAssertTrue(app.secureTextFields.firstMatch.waitForExistence(timeout: 5))
|
|
XCTAssertTrue(app.buttons["Speichern"].exists)
|
|
XCTAssertTrue(app.buttons["Neues Konto hinzufügen"].exists)
|
|
XCTAssertTrue(app.buttons["Konto löschen"].exists)
|
|
app.buttons["clearLocalMessages"].click()
|
|
XCTAssertTrue(app.buttons["Lokale Mails endgültig löschen"].waitForExistence(timeout: 5))
|
|
app.buttons["Abbrechen"].click()
|
|
XCTAssertTrue(app.buttons["clearLocalMessages"].exists)
|
|
app.buttons["Neues Konto hinzufügen"].click()
|
|
XCTAssertTrue(app.textFields["accountEmail"].waitForExistence(timeout: 5))
|
|
XCTAssertFalse(app.buttons["Speichern"].isEnabled)
|
|
XCTAssertTrue(app.buttons["Verbindung testen"].exists)
|
|
app.buttons["Schließen"].click()
|
|
XCTAssertTrue(app.descendants(matching: .any)["Abrufen"].firstMatch.waitForExistence(timeout: 5), app.debugDescription)
|
|
}
|
|
|
|
@MainActor
|
|
func testMessageWindowAndActions() throws {
|
|
continueAfterFailure = false
|
|
let app = XCUIApplication()
|
|
app.launchArguments = ["-ApplePersistenceIgnoreState", "YES", "-checkOnLaunch", "NO", "-idleEnabled", "NO",
|
|
"--ui-fixture", "-pollMinutes", "0", "-selectedFolder", "unified:inbox", "-selectedMessage", "", "-mailSearch", ""]
|
|
app.launch()
|
|
app.activate()
|
|
if app.windows.count == 0 {
|
|
app.menuBars.menuBarItems["File"].click()
|
|
app.menuItems["New"].hover()
|
|
app.menuItems["New Window"].click()
|
|
}
|
|
let table = app.outlines.element(boundBy: 1)
|
|
XCTAssertTrue(table.waitForExistence(timeout: 5), app.debugDescription)
|
|
let row = table.descendants(matching: .outlineRow).firstMatch
|
|
XCTAssertTrue(row.waitForExistence(timeout: 5), app.debugDescription)
|
|
app.activate()
|
|
table.staticTexts["UI-Nachricht 1"].firstMatch.doubleClick()
|
|
let detail = app.windows["UI-Nachricht 1"]
|
|
XCTAssertTrue(detail.waitForExistence(timeout: 5))
|
|
let reply = detail.buttons["Antworten…"].firstMatch
|
|
XCTAssertTrue(reply.waitForExistence(timeout: 5), app.debugDescription)
|
|
XCTAssertGreaterThanOrEqual(app.windows.count, 2, app.debugDescription)
|
|
reply.click()
|
|
XCTAssertTrue(app.textFields["composeCC"].waitForExistence(timeout: 5))
|
|
app.buttons["Abbrechen"].click()
|
|
}
|
|
}
|