mercredi 19 avril 2017

Xamarin UI test - how to open navigation drawer

I am testing my android app using Xamarin UI Testing tool and I have written the following test:

public void login()
    {
        app.Tap(x => x.Id("Activity.LoginActivity.RelativeLayout_email"));
        app.Tap(x => x.Id("EditText_email"));
        app.EnterText(x => x.Id("EditText_email"), "matt@matt.matt");
        app.Tap(x => x.Id("EditText_password"));
        app.EnterText(x => x.Id("EditText_password"), "matt123");
        app.PressEnter();
        app.Tap(x => x.Id("Button_login"));
        app.WaitForElement(x => x.Id("ImageView_OfferItem_photo"), timeout: TimeSpan.FromSeconds(120));
        app.SwipeLeftToRight();
        app.Tap(x => x.Id("ImageView_OfferItem_photo").Index(1));
    }

and at the end I want to open side navigation drawer but I am unable to do it, because I am using native menu icon, that has no id. I tried android.R.id.home, but it did not work, too.

Aucun commentaire:

Enregistrer un commentaire