Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 9d524aa

Browse files
committed
UITest fixes
1 parent 9c201d7 commit 9d524aa

File tree

4 files changed

+37
-21
lines changed
  • design/samples/Cheesesquare.UITests
  • v7-appcompat/samples/AndroidSupportSample.UITests
  • v7-gridlayout/samples/AndroidSupportSample.UITests
  • v7-preference/samples/AndroidSupportSample.UITests

4 files changed

+37
-21
lines changed

design/samples/Cheesesquare.UITests/Tests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void BeforeEachTest ()
2626
public void ClickingHamburgerShouldRevealDrawer ()
2727
{
2828
app.Screenshot ("Launch");
29-
app.Tap(t => t.Class("ImageButton"));
29+
app.Tap(t => t.Marked("Navigate up"));
3030
app.WaitForElement(t => t.Text("Discussion"));
3131
app.Screenshot ("Tap Hamburger");
3232
}
@@ -37,7 +37,7 @@ public void ClickingFloatingActionButtonShouldDisplaySnackbar ()
3737
app.Screenshot ("Launch");
3838
app.Tap (q => q.Id ("fab"));
3939
app.Screenshot ("Tap Button");
40-
app.WaitForElement (q => q.Id ("snackbar_text"));
40+
app.WaitForElement (q => q.Id("snackbar_text"), timeout: TimeSpan.FromSeconds(10));
4141
app.Screenshot ("Snackbar");
4242
}
4343

v7-appcompat/samples/AndroidSupportSample.UITests/Tests.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,20 @@ public void ActionBarTabs ()
9191
public void DisplayOptions ()
9292
{
9393
app.Screenshot ("Launch");
94-
app.Tap(q => q.Text("Display Options"));
95-
app.WaitForElement (q => q.Class ("Toolbar"));
94+
app.Tap(q => q.Marked("Display Options"));
95+
app.WaitForElement (q => q.Marked ("toggle_navigation"));
9696
app.Screenshot ("Display Options");
9797

98-
app.Tap (q => q.Id ("toggle_home_as_up"));
99-
app.WaitForElement (q => q.Class ("ImageButton"));
98+
app.Tap (q => q.Marked ("toggle_home_as_up"));
99+
app.WaitForElement (q => q.Marked ("Navigate up"));
100100
app.Screenshot ("Toggle Home as Up");
101101

102-
app.Tap (q => q.Id ("toggle_show_title"));
103-
app.WaitForNoElement (q => q.Text ("Display Options"));
102+
app.Tap (q => q.Marked ("toggle_show_title"));
103+
app.WaitForNoElement (q => q.Marked ("Display Options"));
104104
app.Screenshot ("Hide Title");
105-
app.Tap (q => q.Id ("toggle_show_title"));
106-
app.WaitForElement (q => q.Text ("Display Options"));
105+
app.Tap (q => q.Marked ("toggle_show_title"));
106+
app.WaitForElement (q => q.Marked ("Display Options"));
107107
app.Screenshot ("Show Title");
108-
109-
app.Tap (q => q.Id ("toggle_visibility"));
110-
app.WaitForNoElement (q => q.Class ("Toolbar"));
111-
app.Screenshot ("Hide Toolbar");
112108
}
113109

114110
[Test]

v7-gridlayout/samples/AndroidSupportSample.UITests/Tests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void BeforeEachTest ()
2222
.StartApp ();
2323
}
2424

25-
// [Test]
25+
[Test]
2626
public void Repl ()
2727
{
2828
app.Repl ();
@@ -55,13 +55,13 @@ public void FormXml ()
5555
}
5656

5757
[Test]
58-
public void FormJava ()
58+
public void FormCSharp ()
5959
{
6060
app.Screenshot ("Launch");
61-
app.Tap (q => q.Text ("3. Form (Java)"));
62-
app.Screenshot ("Tap 3. Form (Java)");
61+
app.Tap (q => q.Text ("3. Form (C#)"));
62+
app.Screenshot ("Tap 3. Form (C#)");
6363
app.WaitForElement (q => q.Class ("GridLayout"));
64-
app.Screenshot ("Form Java");
64+
app.Screenshot ("Form C#");
6565
}
6666
}
6767
}

v7-preference/samples/AndroidSupportSample.UITests/Tests.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void BeforeEachTest ()
2222
.StartApp ();
2323
}
2424

25-
//[Test]
25+
[Test]
2626
public void Repl ()
2727
{
2828
app.Repl ();
@@ -32,8 +32,28 @@ public void Repl ()
3232
public void AppLaunches ()
3333
{
3434
app.Screenshot ("Launch");
35-
app.WaitForElement (q => q.Class ("PercentFrameLayout"));
35+
app.WaitForElement (q => q.Marked ("List Preference"));
3636
}
37+
38+
[Test]
39+
public void ListPreference()
40+
{
41+
app.Screenshot("Launch");
42+
app.WaitForElement(q => q.Marked("List Preference"));
43+
app.Tap(q => q.Marked("List Preference"));
44+
app.WaitForElement(q => q.Marked("Three"));
45+
app.Screenshot("List Preference");
46+
}
47+
48+
[Test]
49+
public void EditTextPreference()
50+
{
51+
app.Screenshot("Launch");
52+
app.WaitForElement(q => q.Marked("Edit Text Preference"));
53+
app.Tap(q => q.Marked("Edit Text Preference"));
54+
app.WaitForElement(q => q.Marked("Dialog Title Edit Text Preference"));
55+
app.Screenshot("Edit Text Preference");
56+
}
3757
}
3858
}
3959

0 commit comments

Comments
 (0)