Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Analyzer / code fix provider for UITest [Test] without [Category] #23287

Merged
merged 10 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Microsoft.Maui-dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Mac.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.WinUI.Tests", "src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj", "{A3E22F99-F380-4005-8483-3ACA6C104220}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UITest.Analyzers", "src\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj", "{55905937-1399-46DB-BA38-E426801CB759}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -648,6 +650,10 @@ Global
{A3E22F99-F380-4005-8483-3ACA6C104220}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3E22F99-F380-4005-8483-3ACA6C104220}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3E22F99-F380-4005-8483-3ACA6C104220}.Release|Any CPU.Build.0 = Release|Any CPU
{55905937-1399-46DB-BA38-E426801CB759}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55905937-1399-46DB-BA38-E426801CB759}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55905937-1399-46DB-BA38-E426801CB759}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55905937-1399-46DB-BA38-E426801CB759}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -766,6 +772,7 @@ Global
{5DDA6439-CDE0-4BFE-8BF9-77962BC69ACA} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{6E1ADE49-680E-4CA3-8FEA-6450802F8250} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{A3E22F99-F380-4005-8483-3ACA6C104220} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{55905937-1399-46DB-BA38-E426801CB759} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}
Expand Down
7 changes: 7 additions & 0 deletions Microsoft.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Mac.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.WinUI.Tests", "src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj", "{A1D6B9E5-D8FF-436A-9ACF-703CA5E4BD02}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.Analyzers", "src\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj", "{F1BC506B-3A9E-4779-994E-339AFB21C9B9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -682,6 +684,10 @@ Global
{A1D6B9E5-D8FF-436A-9ACF-703CA5E4BD02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1D6B9E5-D8FF-436A-9ACF-703CA5E4BD02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1D6B9E5-D8FF-436A-9ACF-703CA5E4BD02}.Release|Any CPU.Build.0 = Release|Any CPU
{F1BC506B-3A9E-4779-994E-339AFB21C9B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1BC506B-3A9E-4779-994E-339AFB21C9B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1BC506B-3A9E-4779-994E-339AFB21C9B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1BC506B-3A9E-4779-994E-339AFB21C9B9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -807,6 +813,7 @@ Global
{29115330-6854-4715-B382-18EA3A8A8731} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{E8CAE2B6-62B3-431C-A76D-1CCD961A1FB4} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{A1D6B9E5-D8FF-436A-9ACF-703CA5E4BD02} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{F1BC506B-3A9E-4779-994E-339AFB21C9B9} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<ProjectReference Include="..\..\..\TestUtils\src\UITest.Appium\UITest.Appium.csproj" />
<ProjectReference Include="..\..\..\TestUtils\src\UITest.Core\UITest.Core.csproj" />
<ProjectReference Include="..\..\..\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj" />
<ProjectReference Include="..\..\..\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj"
PrivateAssets="all"
ReferenceOutputAssembly="false"
OutputItemType="Analyzer" />
</ItemGroup>

<ItemGroup Condition="$(UseLocalVisualTestUtils) == ''">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<ProjectReference Include="..\..\..\TestUtils\src\UITest.Appium\UITest.Appium.csproj" />
<ProjectReference Include="..\..\..\TestUtils\src\UITest.Core\UITest.Core.csproj" />
<ProjectReference Include="..\..\..\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj" />
<ProjectReference Include="..\..\..\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj"
PrivateAssets="all"
ReferenceOutputAssembly="false"
OutputItemType="Analyzer" />
</ItemGroup>

<ItemGroup Condition="$(UseLocalVisualTestUtils) == ''">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ protected override void NavigateToGallery()
// TODO: UI testing alert code is not yet implemented on Windows.
#if !WINDOWS
[Test]
[Category(UITestCategories.DisplayAlert)]
public void AlertCancel()
{
var test = Test.Alerts.AlertCancel;
Expand Down Expand Up @@ -55,6 +56,7 @@ public void AlertCancel()
}

[Test]
[Category(UITestCategories.DisplayAlert)]
[TestCase(Test.Alerts.AlertAcceptCancelClickAccept, "ACCEPT")]
[TestCase(Test.Alerts.AlertAcceptCancelClickCancel, "CANCEL")]
public void AlertAcceptCancel(Test.Alerts test, string buttonText)
Expand Down Expand Up @@ -92,6 +94,7 @@ public void AlertAcceptCancel(Test.Alerts test, string buttonText)
}

[Test]
[Category(UITestCategories.ActionSheet)]
[TestCase(Test.Alerts.ActionSheetClickItem, "ITEM 2")]
[TestCase(Test.Alerts.ActionSheetClickCancel, "CANCEL")]
[TestCase(Test.Alerts.ActionSheetClickDestroy, "DESTROY")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Microsoft.Maui.TestCases.Tests
{
[Category(UITestCategories.Image)]
public class ImageLoadingGalleryTests : CoreGalleryBasePageTest
{
public ImageLoadingGalleryTests(TestDevice device)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.Maui.TestCases.Tests
{
[Category(UITestCategories.InputTransparent)]
public class InputTransparencyGalleryTests : CoreGalleryBasePageTest
{
const string ButtonGallery = "Input Transparency Gallery";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.Maui.TestCases.Tests.Issues
{
[Category(UITestCategories.SoftInput)]
public class HideSoftInputOnTappedPageTests : _IssuesUITest
{
public HideSoftInputOnTappedPageTests(TestDevice device) : base(device) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public IsInvokeRequiredRaceCondition(TestDevice device) : base(device)
public override string Issue => "Application.Current.Dispatcher.IsDispatchRequired race condition causes crash";

[Test]
[Category(UITestCategories.Dispatcher)]
public void ApplicationDispatcherIsInvokeRequiredRaceConditionCausesCrash()
{
App.WaitForElement("crashButton");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public Issue10947(TestDevice device)
string FooterEntry => "FooterEntry";

[Test]
[Category(UITestCategories.CollectionView)]
public void CollectionViewHeaderShouldNotScroll()
{
var headerEntry = App.WaitForElement(HeaderEntry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public Issue15815(TestDevice device)

public override string Issue => "Horizontal CollectionView does not show the last element under some condition";

[Test]
[Test, Category(UITestCategories.CollectionView)]
public void LastItemIsVisilbe()
{
var lastItem = App.WaitForElement("id-2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.Maui.TestCases.Tests.Issues;

[Category(UITestCategories.RefreshView)]
public class Issue16910 : _IssuesUITest
{
public override string Issue => "IsRefreshing binding works";
Expand All @@ -16,7 +17,7 @@ public Issue16910(TestDevice device)

}

[Test]
[Test]
public void BindingUpdatesFromProgrammaticRefresh()
{
_ = App.WaitForElement("StartRefreshing");
Expand All @@ -28,8 +29,7 @@ public void BindingUpdatesFromProgrammaticRefresh()

// Windows only works with touch inputs which we don't have running on the test server
#if !WINDOWS && !MACCATALYST
[Test]
[Category(UITestCategories.RefreshView)]
[Test]
public void BindingUpdatesFromInteractiveRefresh()
{
_ = App.WaitForElement("CollectionView");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Issue16918(TestDevice device)
public override string Issue => "ImageButton is not properly anti-aliased when scaled down";

[Test]
[Category(UITestCategories.ImageButton)]
public void Issue16918Test()
{
// https://github.com/dotnet/maui/issues/16918
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void EntryClearButtonWorksEntryDoesntClearWhenNotClickingOnClear()
}

[Test]
[Category(UITestCategories.Entry)]
public void EntryClearButtonWorks()
{
// https://github.com/dotnet/maui/issues/17453
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Issue17694(TestDevice device) : base(device)
public override string Issue => "Circle view not rotating from center";

[Test]
[Category(UITestCategories.Animation)]
public void Issue17694Test()
{
App.WaitForElement("Spin");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public Issue17801(TestDevice device) : base(device) { }
public override string Issue => "ScrollView always has a scroll bar on iOS";

[Test]
[Category(UITestCategories.ScrollView)]
public void NoScrollbarsTest()
{
App.WaitForElement("WaitForStubControl");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public Issue18242(TestDevice device) : base(device)
public override string Issue => "Button ImageSource not Scaling as expected";

[Test]
[Category(UITestCategories.Button)]
[FailsOnIOS("iOS will be fixed in https://github.com/dotnet/maui/pull/20953")]
[FailsOnMac("Catalyst will be fixed in https://github.com/dotnet/maui/pull/20953")]
public void Issue18242Test()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public Issue18251(TestDevice device) : base(device) { }
public override string Issue => "IllegalArgumentException when changing number of tabbar pages";

[Test]
[Category(UITestCategories.Shell)]
public void NoExceptionShouldBeThrownAddingShellTabs()
{
App.WaitForElement("button");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Issue19509(TestDevice device) : base(device)

[Test]
[FailsOnMac("VerifyScreenshot method not implemented on macOS")]
[Category(UITestCategories.Entry)]
public void EntryTextColorStopsWorkingAfterPropertyIsUpdatedFromBinding()
{
App.WaitForElement("WaitForStubControl");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public Issue19556(TestDevice device)
: base(device)
{ }

[Test]
[Test]
[Category(UITestCategories.Label)]
public void SystemFontsShouldRenderCorrectly()
{
_ = App.WaitForElement("label");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Issue19592(TestDevice device) : base(device)
}

[Test]
[Category(UITestCategories.Label)]
public void SpanLineHeightShouldNotGrowProgressively()
{
_ = App.WaitForElement("label");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Issue19803(TestDevice device) : base(device)
public override string Issue => "[iOS] Setting Binding on Span GridItemsLayout results in NullReferenceException";

[Test]
[Category(UITestCategories.CollectionView)]
public void NoNREWhenChangingGridItemsLayout()
{
_ = App.WaitForElement("button");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public Issue19926(TestDevice device)
: base(device)
{ }

[Test]
[Test]
[Category(UITestCategories.BoxView)]
public void PropertiesShouldBeCorrectlyApplied()
{
_ = App.WaitForElement("boxView");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
using NUnit.Framework.Legacy;

namespace Microsoft.Maui.TestCases.Tests.Issues;

[Category(UITestCategories.Entry)]
public class Issue19956: _IssuesUITest
{
public Issue19956(TestDevice device) : base(device) { }

public override string Issue => "Sticky headers and bottom content insets";

[Test]
[Category(UITestCategories.Entry)]
public void ContentAccountsForStickyHeaders()
{
// This is an iOS Keyboard Scrolling issue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public Issue20156(TestDevice device)
{ }

[Test]
[Category(UITestCategories.Border)]
[FailsOnMac("VerifyScreenshot method not implemented on macOS")]
public void BorderShouldHaveNoThickness()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Issue20199(TestDevice device) : base(device)
}

[Test]
[Category(UITestCategories.Page)]
[FailsOnMac("VerifyScreenshot method not implemented on macOS")]
public void TitleViewShouldBeVisible()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public Issue20294(TestDevice device) : base(device) { }
public override string Issue => "CollectionView containing a Footer and a Border with StrokeThickness set to decimal value crashes on scroll";

[Test]
[Category(UITestCategories.CollectionView)]
public void ScrollToEndDoesntCrash()
{
App.ScrollTo("FOOTER");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Issue20439(TestDevice device) : base(device)
}

[Test]
[Category(UITestCategories.Entry)]
public void ErrorShouldNotBeThrown()
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public Issue20696(TestDevice device) : base(device)

#if IOS
[Test]
#endif
[Category(UITestCategories.Shell)]
#endif
public void FlyoutHeaderShouldBeResized()
{
_ = App.WaitForElement("GoToTest");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public Issue20842(TestDevice device) : base(device)
public override string Issue => "Verify data templates in CollectionView virtualize correctly";

[Test]
[Category(UITestCategories.CollectionView)]
public async Task VerifyCollectionViewItemsAfterScrolling()
{
App.WaitForElement(scrollUpButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public Issue20903(TestDevice device) : base(device) { }
public override string Issue => "Double-tap behavior should work correctly when adding a new double-tap handler";

[Test]
[Category(UITestCategories.Gestures)]
public async Task RegisterTwoDoubleTapHandlersAndCheckNumberOfFiredEventsAsync()
{
_ = App.WaitForElement("AddDoubleTapHandlerButton");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public Issue20920(TestDevice device) : base(device) { }
public override string Issue => "Nested ScrollView does not work in Android";

[Test]
[Category(UITestCategories.ScrollView)]
public void ScrollingBothDirectionsWithNestedScrollViews()
{
// TODO: Correct this test for other platforms
Expand Down
Loading
Loading