Skip to content

Commit

Permalink
Fix test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Aug 26, 2023
1 parent fb27c93 commit bcc7858
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Tests/UITests/TestAppUITests/AccountLoginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
19 changes: 19 additions & 0 deletions Tests/UITests/TestAppUITests/AccountResetPasswordTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Check failure on line 25 in Tests/UITests/TestAppUITests/AccountResetPasswordTests.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Todo Violation: TODOs should be resolved (the error?) (todo)

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

Check failure on line 34 in Tests/UITests/TestAppUITests/AccountResetPasswordTests.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Todo Violation: TODOs should be resolved (rewrite) (todo)
let app = XCUIApplication()
Expand Down
4 changes: 4 additions & 0 deletions Tests/UITests/TestAppUITests/Context/Context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,22 @@ extension TestableView {
}

func enter<Input: StringProtocol>(field: String, text: Input) throws {
XCTAssertTrue(app.textFields[field].waitForExistence(timeout: 1.0))
try app.textFields[field].enter(value: String(text))
}

func enter<Input: StringProtocol>(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)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction>
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForRunning = "YES">
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
Expand All @@ -15,11 +21,30 @@
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:TestApp.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
Expand All @@ -43,4 +68,27 @@
referenceType = "1">
</LocationScenarioReference>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2F6D139128F5F384007C25D6"
BuildableName = "TestApp.app"
BlueprintName = "TestApp"
ReferencedContainer = "container:UITests.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

0 comments on commit bcc7858

Please sign in to comment.