blob: 74bd895821d68efd8f1b62d55967e2c0ab6b9fa1 (
plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
using NUnit.Framework;
using Xamarin.UITest;
using System;
using System.Threading;
namespace Xamarin.Forms.Core.UITests
{
[TestFixture]
[Category ("DisplayAlert")]
internal class DisplayAlertUITests : BaseTestFixture
{
protected override void NavigateToGallery ()
{
App.NavigateToGallery (GalleryQueries.DisplayAlertGallery);
}
[Test]
public void TestWithCancelButton ()
{
App.Tap (c => c.Marked ("Alert Override1"));
App.Screenshot ("Display Alert");
App.WaitForElement (c => c.Marked ("TheAlertTitle"));
App.WaitForElement (c => c.Marked ("TheAlertMessage"));
App.WaitForElement (c => c.Marked ("TheCancelButton"));
App.Screenshot ("Display Alert Closed");
App.Tap (c => c.Marked ("TheCancelButton"));
App.WaitForNoElement (c => c.Marked ("TheAlertTitle"));
}
[Test]
public void TestWithCancelAndOkButton ()
{
App.Tap (c => c.Marked ("Alert Override2"));
App.Screenshot ("Display Alert");
App.WaitForElement (c => c.Marked ("TheAlertTitle"));
App.WaitForElement (c => c.Marked ("TheAlertMessage"));
App.WaitForElement (c => c.Marked ("TheAcceptButton"));
App.WaitForElement (c => c.Marked ("TheCancelButton"));
App.Tap (c => c.Marked ("TheCancelButton"));
App.Screenshot ("Display Alert Closed");
App.WaitForNoElement (c => c.Marked ("TheAlertTitle"));
}
[Test]
public void TestOkAndCancelResults ()
{
App.Tap (c => c.Marked ("Alert Override2"));
App.Screenshot ("Display Alert");
App.WaitForElement (c => c.Marked ("TheCancelButton"));
App.Tap (c => c.Marked ("TheCancelButton"));
App.Screenshot ("Display Alert Closed with cancel");
App.WaitForElement (c => c.Marked ("Result: False"));
App.Tap (c => c.Marked ("test2"));
App.Screenshot ("Display Alert");
App.WaitForElement (c => c.Marked ("TheAcceptButton"));
App.Tap (c => c.Marked ("TheAcceptButton"));
App.Screenshot ("Display Alert Closed with True");
App.WaitForElement (c => c.Marked ("Result: True"));
}
}
}
|