Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Added UITest
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuarezruiz authored and PureWeen committed Dec 3, 2020
1 parent d0494e6 commit 92d4c68
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace Xamarin.Forms.Controls.Issues
[Issue(IssueTracker.Github, 12079, "SwipeView crash if Text not is set on SwipeItem", PlatformAffected.UWP)]
public class Issue12079 : TestContentPage
{
const string SwipeViewId = "SwipeViewId";

protected override void Init()
{
Title = "Issue 12079";
Expand All @@ -38,7 +40,10 @@ protected override void Init()
IconImageSource = "calculator.png"
};

swipeItem.Invoked += (sender, e) => { DisplayAlert("SwipeView", "Invoked", "Ok"); };
swipeItem.Invoked += (sender, e) =>
{
DisplayAlert("Issue12079", "Invoked", "Ok");
};

var swipeItems = new SwipeItems { swipeItem };

Expand All @@ -60,16 +65,38 @@ protected override void Init()

var swipeView = new SwipeView
{
AutomationId = SwipeViewId,
HeightRequest = 60,
WidthRequest = 300,
LeftItems = swipeItems,
Content = swipeContent
};

var result = new Label();

swipeView.SwipeEnded += (sender, args) =>
{
result.Text = "Success";
};

layout.Children.Add(instructions);
layout.Children.Add(swipeView);
layout.Children.Add(result);

Content = layout;
}

#if UITEST
[Test]
[Category(UITestCategories.SwipeView)]
public void SwipeItemNoTextWindows()
{
RunningApp.WaitForElement(SwipeViewId);
RunningApp.SwipeLeftToRight(SwipeViewId);
RunningApp.Tap(SwipeViewId);
RunningApp.WaitForElement( c => c.Marked("Success"));
RunningApp.Screenshot ("The test has passed");
}
#endif
}
}

0 comments on commit 92d4c68

Please sign in to comment.