add openhack files

This commit is contained in:
Ryan Peters
2022-11-03 16:41:13 -04:00
commit b2c9f7e29f
920 changed files with 118861 additions and 0 deletions

View File

@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using Xamarin.UITest;
using NUnit.Framework;
namespace MyDriving.UITests
{
public class CurrentTripTests : AbstractSetup
{
public CurrentTripTests (Platform platform) : base (platform)
{
}
[Test]
public void RecordTripTest()
{
new CurrentTripPage()
.NavigateTo("Current Trip");
new CurrentTripPage()
.StartRecordingTrip()
.StopRecordingTrip()
.SaveTrip("Test Cloud Test Drive");
new TripSummaryPage()
.AssertOnPage();
}
}
}

View File

@ -0,0 +1,42 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using NUnit.Framework;
using Xamarin.UITest;
namespace MyDriving.UITests
{
public class LoginTests : AbstractSetup
{
public LoginTests(Platform platform) : base(platform)
{
}
[Test]
public void SkipAuthenticationTest()
{
ClearKeychain();
new LoginPage()
.SkipAuthentication();
new CurrentTripPage()
.AssertOnPage();
}
/*[Test]
public void LoginWithFacebookTest()
{
ClearKeychain();
new LoginPage()
.LoginWithFacebook();
new FacebookLoginPage()
.Login();
new CurrentTripPage()
.AssertOnPage();
}*/
}
}

View File

@ -0,0 +1,67 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using NUnit.Framework;
using Xamarin.UITest;
namespace MyDriving.UITests
{
public class NavigationTests : AbstractSetup
{
public NavigationTests(Platform platform) : base(platform)
{
}
[Test]
public void NavigateToProfileTabTest ()
{
new CurrentTripPage()
.NavigateTo("Profile");
new ProfilePage()
.AssertOnPage();
}
[Test]
public void NavigateToSettingsTest ()
{
if (OnAndroid)
{
new CurrentTripPage()
.NavigateTo("Settings");
}
if (OniOS)
{
new CurrentTripPage()
.NavigateTo("Profile");
new ProfilePage()
.NavigateToSettings();
}
new SettingsPage()
.AssertOnPage();
}
[Test]
public void NavigateToPastTripsTabTest ()
{
new CurrentTripPage()
.NavigateTo("Past Trips");
new PastTripsPage()
.AssertOnPage();
}
[Test]
public void NavigateToCurrentTripTabTest ()
{
new CurrentTripPage()
.NavigateTo("Current Trip");
new CurrentTripPage()
.AssertOnPage();
}
}
}

View File

@ -0,0 +1,64 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using Xamarin.UITest;
using NUnit.Framework;
namespace MyDriving.UITests
{
public class PastTripsTests : AbstractSetup
{
public PastTripsTests (Platform platform) : base (platform)
{
}
[Test]
public void PullToRefreshTest ()
{
new CurrentTripPage()
.NavigateTo("Past Trips");
new PastTripsPage()
.PullToRefresh ();
}
[Test]
public void NavigateToDetailsTest ()
{
new CurrentTripPage()
.NavigateTo("Past Trips");
new PastTripsPage ()
.NavigateToPastTripsDetail ("James@ToVivace");
new PastTripDetailPage()
.AssertOnPage();
}
[Test]
public void MoveTripSliderTest ()
{
new CurrentTripPage()
.NavigateTo("Past Trips");
new PastTripsPage()
.NavigateToPastTripsDetail("James@ToVivace");
new PastTripDetailPage()
.MoveTripSlider ();
}
[Test]
public void ClickTripSliderEndpointsTest ()
{
new CurrentTripPage()
.NavigateTo("Past Trips");
new PastTripsPage()
.NavigateToPastTripsDetail("James@ToVivace");
new PastTripDetailPage()
.ClickTripSliderEndpoints ();
}
}
}

View File

@ -0,0 +1,65 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
using Xamarin.UITest;
using NUnit.Framework;
namespace MyDriving.UITests
{
public class SettingsTests : AbstractSetup
{
public SettingsTests (Platform platform) : base (platform)
{
}
[Test]
public void ChangeDistanceUnits ()
{
if (OnAndroid)
{
new CurrentTripPage()
.NavigateTo("Settings");
}
if (OniOS)
{
new CurrentTripPage()
.NavigateTo("Profile");
new ProfilePage()
.NavigateToSettings();
}
new SettingsPage()
.SetDistanceSetting()
.NavigateTo("Profile");
new ProfilePage()
.CheckDistanceMetric(true);
}
[Test]
public void ChangeCapacityUnits ()
{
if (OnAndroid)
{
new CurrentTripPage()
.NavigateTo("Settings");
}
if (OniOS)
{
new CurrentTripPage()
.NavigateTo("Profile");
new ProfilePage()
.NavigateToSettings();
}
new SettingsPage()
.SetCapacitySetting()
.NavigateTo("Profile");
new ProfilePage()
.CheckFuelMetric(true);
}
}
}