samedi 12 août 2017

How to write XCUI test for whether I navigate to correct screen or not?

I am writing test UI test case for following UI enter image description here

I want to test on Login click whether I am navigating correctly on Dashboard screen or not.

Is there any method to do this?

My current testing code is like

func testExample() {

        let usernameTextField = app.textFields["Username"]
        usernameTextField.tap()
        usernameTextField.typeText("abc@gmail.com")

        let passwordTextField = app.textFields["Password"]
        passwordTextField.tap()
        passwordTextField.typeText("abc123")

        app.buttons["Login" ].tap()

                //let loginButton = app.staticTexts["Login"]
                //XCTAssertEqual(loginButton.exists, true)

        app.navigationBars["UIView"].buttons["Back"].tap()


    }

Aucun commentaire:

Enregistrer un commentaire