diff --git a/Tests/UITests/TestAppUITests/AccountLoginTests.swift b/Tests/UITests/TestAppUITests/AccountLoginTests.swift index 8164a16b..e6e73c87 100644 --- a/Tests/UITests/TestAppUITests/AccountLoginTests.swift +++ b/Tests/UITests/TestAppUITests/AccountLoginTests.swift @@ -45,7 +45,7 @@ final class AccountLoginTests: XCTestCase { XCTAssertTrue(app.staticTexts["This field cannot be empty."].waitForExistence(timeout: 1.0)) } - func testLoginWithEmail() throws { // TODO throws? + func testLoginWithEmail() throws { let app = TestApp.launch(serviceType: "mail") let setup = app.openAccountSetup() diff --git a/Tests/UITests/TestAppUITests/AccountResetPasswordTests.swift b/Tests/UITests/TestAppUITests/AccountResetPasswordTests.swift index 068a9027..354847a7 100644 --- a/Tests/UITests/TestAppUITests/AccountResetPasswordTests.swift +++ b/Tests/UITests/TestAppUITests/AccountResetPasswordTests.swift @@ -11,6 +11,25 @@ import XCTestExtensions final class AccountResetPasswordTests: XCTestCase { + func testRestPassword() throws { + let app = TestApp.launch(serviceType: "mail") + let setup = app.openAccountSetup() + + setup.tap(button: "Forgot Password?") + + XCTAssertTrue(setup.staticTexts["Reset Password"].waitForExistence(timeout: 2.0)) + + try setup.enter(email: Defaults.email) + setup.tap(button: "Reset Password") + + // TODO the error? + + XCTAssertTrue(app.staticTexts["Sent out a link to reset the password."].waitForExistence(timeout: 6.0)) + + setup.tap(button: "Done") + app.verify(timeout: 6.0) + } + func testResetPasswordUsernameComponents() throws { throw XCTSkip() // TODO rewrite let app = XCUIApplication() diff --git a/Tests/UITests/TestAppUITests/Context/Context.swift b/Tests/UITests/TestAppUITests/Context/Context.swift index 81e5221b..cbd861cf 100644 --- a/Tests/UITests/TestAppUITests/Context/Context.swift +++ b/Tests/UITests/TestAppUITests/Context/Context.swift @@ -36,18 +36,22 @@ extension TestableView { } func enter(field: String, text: Input) throws { + XCTAssertTrue(app.textFields[field].waitForExistence(timeout: 1.0)) try app.textFields[field].enter(value: String(text)) } func enter(secureField: String, text: Input) throws { + XCTAssertTrue(app.secureTextFields[secureField].waitForExistence(timeout: 1.0)) try app.secureTextFields[secureField].enter(value: String(text)) } func delete(field: String, count: Int) throws { + XCTAssertTrue(app.textFields[field].waitForExistence(timeout: 1.0)) try app.textFields[field].delete(count: count) } func delete(secureField: String, count: Int) throws { + XCTAssertTrue(app.secureTextFields[secureField].waitForExistence(timeout: 1.0)) try app.secureTextFields[secureField].delete(count: count) } } diff --git a/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme b/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme index 0d69ed21..640b6ecd 100644 --- a/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme +++ b/Tests/UITests/UITests.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme @@ -1,10 +1,16 @@ - + version = "1.7"> + + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + + + + + + - + + + + + + + + + + +