forked from xamarin-automation-service/uitest-pop-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseTestFixture.cs
42 lines (35 loc) · 1.14 KB
/
BaseTestFixture.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using NUnit.Framework;
using Xamarin.UITest;
namespace Xamarin.UITest.POPSample
{
[TestFixture(Platform.Android)]
[TestFixture(Platform.iOS)]
public abstract class BaseTestFixture
{
protected IApp app => AppManager.App;
protected bool OnAndroid => AppManager.Platform == Platform.Android;
protected bool OniOS => AppManager.Platform == Platform.iOS;
protected BaseTestFixture(Platform platform)
{
AppManager.Platform = platform;
}
[SetUp]
public virtual void BeforeEachTest()
{
AppManager.StartApp();
}
protected void EnterTask(string name, string notes = null)
{
new TaskListPage()
.GoToAddTask();
new TaskDetailsPage()
.EnterTask(name, notes)
.Save();
new TaskListPage()
.VerifyTaskExists(name);
}
// You can edit this file to define functionality that is common across many or all tests.
// For example, you could add a method here to log in or dismiss a welcome dialogue.
}
}