mirror of
https://github.com/bitwarden/mobile
synced 2026-01-08 03:23:23 +00:00
Added UI test project
This commit is contained in:
54
src/UiTests/Pages/ExamplePage.cs
Normal file
54
src/UiTests/Pages/ExamplePage.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Bit.UITests.Setup;
|
||||
using Query = System.Func<Xamarin.UITest.Queries.AppQuery, Xamarin.UITest.Queries.AppQuery>;
|
||||
|
||||
namespace Bit.UITests.Pages
|
||||
{
|
||||
public class ExamplePage : BasePage
|
||||
{
|
||||
private readonly Query _loginButton;
|
||||
private readonly Query _passwordInput;
|
||||
|
||||
public ExamplePage()
|
||||
: base()
|
||||
{
|
||||
if (OnAndroid)
|
||||
{
|
||||
_loginButton = x => x.Marked("loginpage_login_button");
|
||||
_passwordInput = x => x.Marked("password_input");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (OniOS)
|
||||
{
|
||||
_loginButton = x => x.Marked("loginpage_login_button");
|
||||
_passwordInput = x => x.Marked("password_input");
|
||||
}
|
||||
}
|
||||
|
||||
protected override PlatformQuery Trait => new PlatformQuery
|
||||
{
|
||||
Android = x => x.Marked("password_input"),
|
||||
iOS = x => x.Marked("password_input"),
|
||||
};
|
||||
|
||||
public ExamplePage TapLogin()
|
||||
{
|
||||
App.Tap(_loginButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ExamplePage InputPassword(string password)
|
||||
{
|
||||
App.Tap(_passwordInput);
|
||||
App.EnterText(password);
|
||||
App.DismissKeyboard();
|
||||
|
||||
App.Screenshot("After I input the email and password fields, I can see both fields filled");
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user