NEW: Start my new Ultimate Portfolio App course with a free Hacking with Swift+ trial! >>

Testing problems for Portfolio App

Forums > SwiftUI

I encountered my first failed test on the app thus far.

func testingEditingProjectUpdates() {
    XCTAssertEqual(app.tables.cells.count, 0, "Should be no list rows")

    XCTAssertEqual(app.tables.cells.count, 1, "Should be 1 list rows")

    app.buttons["NEW PROJECT"].tap()
    app.textFields["Project name"].tap()


    app.buttons["Open Projects"].tap()
    XCTAssertTrue(app.buttons["NEW PROJECT 2"].exists, "This should be here")


I get this failure at the app.keys["space"].tap()

Failed to get matching snapshot: No matches found for Descendants matching type Key from input

I have experimented with different settings on the simulator to see if the keyboard would be effected, but to no avail.

Any ideas?



Run the App normal and then do the step EG create a new project and then tap in the textfield and if the keyboard do not show in simultor do Cmd-K to bring up the keyboard.

I am getting the same with the "Return" but comment out and test passes


Thanks NigelGee, that seemed to do the trick.


Hacking with Swift is sponsored by Stream

SPONSORED Check out Stream's cross-platform open source chat SDK on GitHub! Write once and deploy your app with fully featured chat UI on iOS and macOS.

Go to GitHub

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.