Skip to content

Instantly share code, notes, and snippets.

@neewy
Created March 21, 2017 08:31
Show Gist options
  • Save neewy/2aa20eb186352bd8d957082855e622d2 to your computer and use it in GitHub Desktop.
Save neewy/2aa20eb186352bd8d957082855e622d2 to your computer and use it in GitHub Desktop.
using System;
using System.IO;
using System.Linq;
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Queries;
namespace SSBI.UITests
{
[TestFixture(Platform.iOS)]
public class DrawerTestIOS
{
IApp app;
Platform platform;
public DrawerTestIOS(Platform platform)
{
this.platform = platform;
}
[SetUp]
public void BeforeEachTest()
{
app = AppInitializer.StartApp(platform);
}
[Test]
public void NewTest()
{
app.Tap(x => x.Text("Menu"));
app.Screenshot("Tapped on view with class: UIButtonLabel with text: Menu with marked: Menu");
app.Tap(x => x.Marked("Characteristics"));
app.Screenshot("Tapped on view with class: UILabel with text: Characteristics with marked: Characteristics");
app.Tap(x => x.Marked("Ok"));
app.Screenshot("Tapped on view with class: _UIAlertControllerActionView with marked: Ok");
app.Tap(x => x.Text("Menu"));
app.Screenshot("Tapped on view with class: UIButtonLabel with text: Menu with marked: Menu");
app.Tap(x => x.Marked("Groups"));
app.Screenshot("Tapped on view with class: UILabel with text: Groups with marked: Groups");
app.Tap(x => x.Marked("Ok"));
app.Screenshot("Tapped on view with class: _UIAlertControllerActionView with marked: Ok");
app.Tap(x => x.Text("Menu"));
app.Screenshot("Tapped on view with class: UIButtonLabel with text: Menu with marked: Menu");
app.Tap(x => x.Class("Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer").Index(4));
app.Screenshot("Tapped on view with class: Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer");
app.Tap(x => x.Marked("Ok"));
app.Screenshot("Tapped on view with class: _UIAlertControllerActionView with marked: Ok");
app.Tap(x => x.Text("Menu"));
app.Screenshot("Tapped on view with class: UIButtonLabel with text: Menu with marked: Menu");
app.Tap(x => x.Marked("Settings"));
app.Screenshot("Tapped on view with class: UILabel with text: Settings with marked: Settings");
app.Tap(x => x.Marked("Ok"));
app.Screenshot("Tapped on view with class: _UIAlertControllerActionView with marked: Ok");
app.Tap(x => x.Marked("Menu"));
app.Screenshot("Tapped on view with class: UINavigationButton with marked: Menu");
app.SwipeRightToLeft();
app.Screenshot("Swiped left");
app.Tap(x => x.Text("Menu"));
app.Screenshot("Tapped on view with class: UIButtonLabel with text: Menu with marked: Menu");
app.Tap(x => x.Class("UIView").Index(6));
app.Screenshot("Tapped on view with class: UIView");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment