-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from King-of-Spades/UITest-Inheirt
UITest inheirit
- Loading branch information
Showing
16 changed files
with
979 additions
and
1,100 deletions.
There are no files selected for viewing
545 changes: 0 additions & 545 deletions
545
Xamarin.UITest/FormsGallery/FormsGallery.UITest/CSTests.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading; | ||
using NUnit.Framework; | ||
using Xamarin.UITest; | ||
using Xamarin.UITest.Queries; | ||
|
||
namespace FormsGallery.UITest | ||
{ | ||
[TestFixture(Platform.Android)] | ||
[TestFixture(Platform.iOS)] | ||
public class Cells : HelperMethods | ||
{ | ||
public Cells(Platform platform) | ||
{ | ||
this.platform = platform; | ||
} | ||
|
||
[Test] | ||
public void TextCell() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("TextCell", i); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void ImageCell() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("ImageCell", i); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void SwitchCell() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("SwitchCell", i); | ||
|
||
if (platform == Platform.Android) | ||
{ | ||
app.Tap(x => x.Class("Switch")); | ||
} | ||
else app.Tap(x => x.Class("UISwitch")); | ||
|
||
app.Screenshot("Flipped switch"); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void EntryCell() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("EntryCell", i); | ||
app.EnterText("Type text here", "This is an Entry Cell"); | ||
app.Screenshot("Text entered into Entry Cell"); | ||
app.DismissKeyboard(); | ||
app.Screenshot("Keyboard Dismissed"); | ||
app.Back(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Xamarin.UITest/FormsGallery/FormsGallery.UITest/HelperMethods.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using NUnit.Framework; | ||
using Xamarin.UITest; | ||
|
||
namespace FormsGallery.UITest | ||
{ | ||
public class HelperMethods | ||
{ | ||
|
||
public IApp app; | ||
public Platform platform; | ||
|
||
public void OpenPage(string page, int pageType) | ||
{ | ||
if (pageType == 0) | ||
{ | ||
app.Tap("C# Pages"); | ||
app.Screenshot("C# " + page + " page"); | ||
} | ||
else | ||
{ | ||
app.Tap("XAML Pages"); | ||
app.Screenshot("XAML " + page + " page"); | ||
} | ||
app.ScrollDownTo(page); | ||
app.Screenshot("Scrolled Down To" + page); | ||
app.Tap(x => x.Marked(page)); | ||
app.Screenshot(page); | ||
} | ||
|
||
[SetUp] | ||
public void BeforeEachTest() | ||
{ | ||
app = AppInitializer.StartApp(platform); | ||
} | ||
|
||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
Xamarin.UITest/FormsGallery/FormsGallery.UITest/LayoutsWithMultipleChildren.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading; | ||
using NUnit.Framework; | ||
using Xamarin.UITest; | ||
using Xamarin.UITest.Queries; | ||
|
||
namespace FormsGallery.UITest | ||
{ | ||
[TestFixture(Platform.Android)] | ||
[TestFixture(Platform.iOS)] | ||
public class LayoutsWithMultipleChildren : HelperMethods | ||
{ | ||
public LayoutsWithMultipleChildren(Platform platform) | ||
{ | ||
this.platform = platform; | ||
} | ||
|
||
[Test] | ||
public void StackLayout() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("StackLayout", i); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void AbsoluteLayout() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("AbsoluteLayout", i); | ||
app.Screenshot("Additional screenshot to catch them moving"); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void Grid() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("Grid", i); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void RelativeLayout() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("RelativeLayout", i); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void FlexLayout() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("FlexLayout", i); | ||
|
||
// Right to left | ||
app.SwipeRightToLeft(); | ||
app.Screenshot("Swiped right to left"); | ||
// Left to right | ||
app.SwipeLeftToRight(); | ||
app.Screenshot("Swiped left to right"); | ||
// Down | ||
app.ScrollDown(); | ||
app.Screenshot("Scrolled Down"); | ||
// Up | ||
app.ScrollUp(); | ||
app.Screenshot("Scrolled Up"); | ||
// end | ||
app.Back(); | ||
} | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
Xamarin.UITest/FormsGallery/FormsGallery.UITest/LayoutsWithSingleContent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading; | ||
using NUnit.Framework; | ||
using Xamarin.UITest; | ||
using Xamarin.UITest.Queries; | ||
|
||
namespace FormsGallery.UITest | ||
{ | ||
[TestFixture(Platform.Android)] | ||
[TestFixture(Platform.iOS)] | ||
public class LayoutsWithSingleContent : HelperMethods | ||
{ | ||
public LayoutsWithSingleContent(Platform platform) | ||
{ | ||
this.platform = platform; | ||
} | ||
|
||
[Test] | ||
public void ContentView() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("ContentView", i); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void Frame() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("Frame", i); | ||
app.Back(); | ||
} | ||
} | ||
|
||
[Test] | ||
public void ScrollView() | ||
{ | ||
for (int i = 0; i >= 1; i++) | ||
{ | ||
OpenPage("ScrollView", i); | ||
app.ScrollDown(); | ||
app.Screenshot("Scrolled down"); | ||
app.ScrollUp(); | ||
app.Screenshot("Scrolled back up"); | ||
app.Back(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.