Merge branch 'main' into merge-main-net9

# Conflicts:
#	src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj
#	src/TestUtils/src/DeviceTests.Runners/TestUtils.DeviceTests.Runners.csproj
This commit is contained in:
Rui Marinho 2024-05-16 16:16:40 +01:00
Родитель 203b1d5a98 86c60b3201
Коммит f42bdc8a36
588 изменённых файлов: 1618 добавлений и 1006 удалений

21
.github/DEVELOPMENT.md поставляемый
Просмотреть файл

@ -89,7 +89,6 @@ Use main for bug fixes that dont require API changes. For new features
│ ├── samples
│ │ ├── Maui.Controls.Sample
│ │ ├── Maui.Controls.Sample.Sandbox
│ │ ├── Controls.Sample.UITests
├── Essentials
│ ├── samples
│ │ ├── Essentials.Sample
@ -101,7 +100,6 @@ Use main for bug fixes that dont require API changes. For new features
- *Maui.Controls.Sample*: Full gallery sample with all of the controls and features of .NET MAUI
- *Maui.Controls.Sample.Sandbox*: Empty project useful for testing reproductions or use cases
- *Contols.Sample.UITests*: Sample used for the automated UI tests
- *Essentials.Sample*: Full gallery demonstrating the library previously known as essentials. These are all the non UI related MAUI APIs.
### Device Test Projects
@ -138,10 +136,23 @@ These are tests used for exercising the UI through accessibility layers to simul
```
├── Controls
│ ├── samples
│ │ ├── Controls.Sample.UITests
│ ├── tests
│ │ ├── Controls.AppiumTests
│ ├── ├── Controls.TestCases.App
│ │ ├── Controls.TestCases.Shared.Tests
```
- *Controls.TestCases.App*: .NET MAUI Sample used for the automated UI tests
- *Controls.TestCases.Shared.Tests*: .NET MAUI library used to define the UI tests
Each platform has a specific UI tests library project where it is possible to add specific tests per platform.
```
├── Controls
│ ├── tests
│ │ ├── Controls.TestCases.Android.Tests
│ │ ├── Controls.TestCases.iOS.Tests
│ │ ├── Controls.TestCases.Mac.Tests
│ │ ├── Controls.TestCases.WinUI.Tests
```
### Unit Test Projects

Просмотреть файл

@ -203,9 +203,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.Int
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.InternalsHiddenAssembly", "src\Controls\tests\Xaml.UnitTests.InternalsHiddenAssembly\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj", "{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.AppiumTests", "src\Controls\tests\UITests\Controls.AppiumTests.csproj", "{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample.UITests", "src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj", "{07C26A25-08C2-4C52-9574-1C33EC8E7919}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.App", "src\Controls\tests\TestCases\Controls.TestCases.App.csproj", "{07C26A25-08C2-4C52-9574-1C33EC8E7919}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.IntegrationTests", "src\TestUtils\src\Microsoft.Maui.IntegrationTests\Microsoft.Maui.IntegrationTests.csproj", "{A6976D43-B3A4-47AF-89D9-FA388B56B52B}"
EndProject
@ -245,7 +243,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGen.UnitTests", "src\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{054C5BAC-3671-4F76-B32E-47CF4E64BB39}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compatibility.Core.UnitTests", "src\Compatibility\Core\tests\Compatibility.UnitTests\Compatibility.Core.UnitTests.csproj", "{1D950CD3-6778-4729-B6D9-446088093F34}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compatibility.Core.UnitTests", "src\Compatibility\Core\tests\Compatibility.UnitTests\Compatibility.Core.UnitTests.csproj", "{1D950CD3-6778-4729-B6D9-446088093F34}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Shared.Tests", "src\Controls\tests\TestCases.Shared.Tests\Controls.TestCases.Shared.Tests.csproj", "{C450F8F4-C40F-4C15-978F-F43BA7DEA29D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Android.Tests", "src\Controls\tests\TestCases.Android.Tests\Controls.TestCases.Android.Tests.csproj", "{7042E8FF-472F-4CB5-8AAE-DAD87BA32207}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.iOS.Tests", "src\Controls\tests\TestCases.iOS.Tests\Controls.TestCases.iOS.Tests.csproj", "{5DDA6439-CDE0-4BFE-8BF9-77962BC69ACA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Mac.Tests", "src\Controls\tests\TestCases.Mac.Tests\Controls.TestCases.Mac.Tests.csproj", "{6E1ADE49-680E-4CA3-8FEA-6450802F8250}"
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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -557,10 +565,6 @@ Global
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.Build.0 = Release|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Release|Any CPU.Build.0 = Release|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
@ -624,6 +628,26 @@ Global
{1D950CD3-6778-4729-B6D9-446088093F34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D950CD3-6778-4729-B6D9-446088093F34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D950CD3-6778-4729-B6D9-446088093F34}.Release|Any CPU.Build.0 = Release|Any CPU
{C450F8F4-C40F-4C15-978F-F43BA7DEA29D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C450F8F4-C40F-4C15-978F-F43BA7DEA29D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C450F8F4-C40F-4C15-978F-F43BA7DEA29D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C450F8F4-C40F-4C15-978F-F43BA7DEA29D}.Release|Any CPU.Build.0 = Release|Any CPU
{7042E8FF-472F-4CB5-8AAE-DAD87BA32207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7042E8FF-472F-4CB5-8AAE-DAD87BA32207}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7042E8FF-472F-4CB5-8AAE-DAD87BA32207}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7042E8FF-472F-4CB5-8AAE-DAD87BA32207}.Release|Any CPU.Build.0 = Release|Any CPU
{5DDA6439-CDE0-4BFE-8BF9-77962BC69ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DDA6439-CDE0-4BFE-8BF9-77962BC69ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DDA6439-CDE0-4BFE-8BF9-77962BC69ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DDA6439-CDE0-4BFE-8BF9-77962BC69ACA}.Release|Any CPU.Build.0 = Release|Any CPU
{6E1ADE49-680E-4CA3-8FEA-6450802F8250}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E1ADE49-680E-4CA3-8FEA-6450802F8250}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E1ADE49-680E-4CA3-8FEA-6450802F8250}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E1ADE49-680E-4CA3-8FEA-6450802F8250}.Release|Any CPU.Build.0 = Release|Any CPU
{A3E22F99-F380-4005-8483-3ACA6C104220}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -717,8 +741,7 @@ Global
{B5F38A9E-1949-4779-8739-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{B5F38A9E-1949-4779-6666-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{07C26A25-08C2-4C52-9574-1C33EC8E7919} = {E1082E26-D700-4127-9329-66D673FD2D55}
{07C26A25-08C2-4C52-9574-1C33EC8E7919} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{A6976D43-B3A4-47AF-89D9-FA388B56B52B} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{DA908446-C6A1-473C-BF5C-83E600F5C69E} = {0AF0E771-4E09-4F05-B187-B43A2B9F62B0}
{9B37E707-EE0B-480E-AEB9-0176784879BE} = {DA908446-C6A1-473C-BF5C-83E600F5C69E}
@ -738,6 +761,11 @@ Global
{06747B55-91DB-47F5-B7A2-56526C28A0D3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{054C5BAC-3671-4F76-B32E-47CF4E64BB39} = {0AF0E771-4E09-4F05-B187-B43A2B9F62B0}
{1D950CD3-6778-4729-B6D9-446088093F34} = {054C5BAC-3671-4F76-B32E-47CF4E64BB39}
{C450F8F4-C40F-4C15-978F-F43BA7DEA29D} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{7042E8FF-472F-4CB5-8AAE-DAD87BA32207} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}

Просмотреть файл

@ -11,7 +11,7 @@
"src\\Controls\\samples\\Controls.Sample.Profiling\\Maui.Controls.Sample.Profiling.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\samples\\Controls.Sample.UITests\\Controls.Sample.UITests.csproj",
"src\\Controls\\tests\\TestCases\\Controls.TestCases.App.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj",
"src\\Controls\\src\\Core\\Controls.Core.csproj",
@ -22,7 +22,10 @@
"src\\Controls\\tests\\Core.UnitTests\\Controls.Core.UnitTests.csproj",
"src\\Controls\\tests\\CustomAttributes\\Controls.CustomAttributes.csproj",
"src\\Controls\\tests\\DeviceTests\\Controls.DeviceTests.csproj",
"src\\Controls\\tests\\UITests\\Controls.AppiumTests.csproj",
"src\\Controls\\tests\\TestCases.Android.Tests\\Controls.TestCases.Android.Tests.csproj",
"src\\Controls\\tests\\TestCases.iOS.Tests\\Controls.TestCases.iOS.Tests.csproj",
"src\\Controls\\tests\\TestCases.Mac.Tests\\Controls.TestCases.Mac.Tests.csproj",
"src\\Controls\\tests\\TestCases.Shared.Tests\\Controls.TestCases.Shared.Tests.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.ExternalAssembly\\Controls.Xaml.UnitTests.ExternalAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsVisibleAssembly\\Controls.Xaml.UnitTests.InternalsVisibleAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsHiddenAssembly\\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj",

Просмотреть файл

@ -183,9 +183,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.Int
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.InternalsHiddenAssembly", "src\Controls\tests\Xaml.UnitTests.InternalsHiddenAssembly\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj", "{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.AppiumTests", "src\Controls\tests\UITests\Controls.AppiumTests.csproj", "{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample.UITests", "src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj", "{07C26A25-08C2-4C52-9574-1C33EC8E7919}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.App", "src\Controls\tests\TestCases\Controls.TestCases.App.csproj", "{07C26A25-08C2-4C52-9574-1C33EC8E7919}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.IntegrationTests", "src\TestUtils\src\Microsoft.Maui.IntegrationTests\Microsoft.Maui.IntegrationTests.csproj", "{A6976D43-B3A4-47AF-89D9-FA388B56B52B}"
EndProject
@ -217,6 +215,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.Appium", "src\TestUt
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.NUnit", "src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj", "{A7B4FF91-8AF6-4A36-805C-B73D888AC1BE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Shared.Tests", "src\Controls\tests\TestCases.Shared.Tests\Controls.TestCases.Shared.Tests.csproj", "{34DC60C1-C722-4134-99A4-E69B9AF1EAE3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Android.Tests", "src\Controls\tests\TestCases.Android.Tests\Controls.TestCases.Android.Tests.csproj", "{78B6A973-63DD-4BCC-92F6-5C479401E5D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.iOS.Tests", "src\Controls\tests\TestCases.iOS.Tests\Controls.TestCases.iOS.Tests.csproj", "{AF5A8B2E-13E7-4D94-A44E-BC96180C1FCC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Mac.Tests", "src\Controls\tests\TestCases.Mac.Tests\Controls.TestCases.Mac.Tests.csproj", "{0B3AF328-82B8-431D-8AFF-45F0F86CEA0E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.WinUI.Tests", "src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj", "{DACF87DB-6354-4B18-A34C-923A55F317F0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -485,10 +493,6 @@ Global
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.Build.0 = Release|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Release|Any CPU.Build.0 = Release|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
@ -534,6 +538,26 @@ Global
{A7B4FF91-8AF6-4A36-805C-B73D888AC1BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7B4FF91-8AF6-4A36-805C-B73D888AC1BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7B4FF91-8AF6-4A36-805C-B73D888AC1BE}.Release|Any CPU.Build.0 = Release|Any CPU
{34DC60C1-C722-4134-99A4-E69B9AF1EAE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34DC60C1-C722-4134-99A4-E69B9AF1EAE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34DC60C1-C722-4134-99A4-E69B9AF1EAE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34DC60C1-C722-4134-99A4-E69B9AF1EAE3}.Release|Any CPU.Build.0 = Release|Any CPU
{78B6A973-63DD-4BCC-92F6-5C479401E5D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78B6A973-63DD-4BCC-92F6-5C479401E5D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78B6A973-63DD-4BCC-92F6-5C479401E5D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78B6A973-63DD-4BCC-92F6-5C479401E5D3}.Release|Any CPU.Build.0 = Release|Any CPU
{AF5A8B2E-13E7-4D94-A44E-BC96180C1FCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF5A8B2E-13E7-4D94-A44E-BC96180C1FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF5A8B2E-13E7-4D94-A44E-BC96180C1FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF5A8B2E-13E7-4D94-A44E-BC96180C1FCC}.Release|Any CPU.Build.0 = Release|Any CPU
{0B3AF328-82B8-431D-8AFF-45F0F86CEA0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B3AF328-82B8-431D-8AFF-45F0F86CEA0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B3AF328-82B8-431D-8AFF-45F0F86CEA0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B3AF328-82B8-431D-8AFF-45F0F86CEA0E}.Release|Any CPU.Build.0 = Release|Any CPU
{DACF87DB-6354-4B18-A34C-923A55F317F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DACF87DB-6354-4B18-A34C-923A55F317F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DACF87DB-6354-4B18-A34C-923A55F317F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DACF87DB-6354-4B18-A34C-923A55F317F0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -617,8 +641,7 @@ Global
{B5F38A9E-1949-4779-8739-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{B5F38A9E-1949-4779-6666-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{07C26A25-08C2-4C52-9574-1C33EC8E7919} = {E1082E26-D700-4127-9329-66D673FD2D55}
{07C26A25-08C2-4C52-9574-1C33EC8E7919} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{A6976D43-B3A4-47AF-89D9-FA388B56B52B} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{DA908446-C6A1-473C-BF5C-83E600F5C69E} = {0AF0E771-4E09-4F05-B187-B43A2B9F62B0}
{9B37E707-EE0B-480E-AEB9-0176784879BE} = {DA908446-C6A1-473C-BF5C-83E600F5C69E}
@ -633,6 +656,11 @@ Global
{401CA2F5-EAD1-4414-AE8F-42444BF458EB} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{5BC29B1A-1EBC-41BF-A0B6-D1B73F8A4991} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{A7B4FF91-8AF6-4A36-805C-B73D888AC1BE} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{34DC60C1-C722-4134-99A4-E69B9AF1EAE3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{78B6A973-63DD-4BCC-92F6-5C479401E5D3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{AF5A8B2E-13E7-4D94-A44E-BC96180C1FCC} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{0B3AF328-82B8-431D-8AFF-45F0F86CEA0E} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{DACF87DB-6354-4B18-A34C-923A55F317F0} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}

Просмотреть файл

@ -14,7 +14,7 @@
"src\\Controls\\Maps\\src\\Controls.Maps.csproj",
"src\\Controls\\samples\\Controls.Sample.Profiling\\Maui.Controls.Sample.Profiling.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample.UITests\\Controls.Sample.UITests.csproj",
"src\\Controls\\tests\\TestCases\\Controls.TestCases.App.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj",
@ -28,7 +28,11 @@
"src\\Controls\\tests\\CustomAttributes\\Controls.CustomAttributes.csproj",
"src\\Controls\\tests\\DeviceTests\\Controls.DeviceTests.csproj",
"src\\Controls\\tests\\SourceGen.UnitTests\\SourceGen.UnitTests.csproj",
"src\\Controls\\tests\\UITests\\Controls.AppiumTests.csproj",
"src\\Controls\\tests\\TestCases.Android.Tests\\Controls.TestCases.Android.Tests.csproj",
"src\\Controls\\tests\\TestCases.iOS.Tests\\Controls.TestCases.iOS.Tests.csproj",
"src\\Controls\\tests\\TestCases.Mac.Tests\\Controls.TestCases.Mac.Tests.csproj",
"src\\Controls\\tests\\TestCases.WinUI.Tests\\Controls.TestCases.WinUI.Tests.csproj",
"src\\Controls\\tests\\TestCases.Shared.Tests\\Controls.TestCases.Shared.Tests.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.ExternalAssembly\\Controls.Xaml.UnitTests.ExternalAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsHiddenAssembly\\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsVisibleAssembly\\Controls.Xaml.UnitTests.InternalsVisibleAssembly.csproj",

Просмотреть файл

@ -17,7 +17,7 @@
"src\\Controls\\Maps\\src\\Controls.Maps.csproj",
"src\\Controls\\samples\\Controls.Sample.Profiling\\Maui.Controls.Sample.Profiling.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample.UITests\\Controls.Sample.UITests.csproj",
"src\\Controls\\tests\\TestCases\\Controls.TestCases.App.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj",
@ -30,7 +30,11 @@
"src\\Controls\\tests\\Core.UnitTests\\Controls.Core.UnitTests.csproj",
"src\\Controls\\tests\\CustomAttributes\\Controls.CustomAttributes.csproj",
"src\\Controls\\tests\\DeviceTests\\Controls.DeviceTests.csproj",
"src\\Controls\\tests\\UITests\\Controls.AppiumTests.csproj",
"src\\Controls\\tests\\TestCases.Android.Tests\\Controls.TestCases.Android.Tests.csproj",
"src\\Controls\\tests\\TestCases.iOS.Tests\\Controls.TestCases.iOS.Tests.csproj",
"src\\Controls\\tests\\TestCases.Mac.Tests\\Controls.TestCases.Mac.Tests.csproj",
"src\\Controls\\tests\\TestCases.WinUI.Tests\\Controls.TestCases.WinUI.Tests.csproj",
"src\\Controls\\tests\\TestCases.Shared.Tests\\Controls.TestCases.Shared.Tests.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.ExternalAssembly\\Controls.Xaml.UnitTests.ExternalAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsHiddenAssembly\\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsVisibleAssembly\\Controls.Xaml.UnitTests.InternalsVisibleAssembly.csproj",

Просмотреть файл

@ -4,7 +4,7 @@
"projects": [
"src\\BlazorWebView\\samples\\MauiRazorClassLibrarySample\\MauiRazorClassLibrarySample.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample.UITests\\Controls.Sample.UITests.csproj",
"src\\Controls\\tests\\TestCases\\Controls.TestCases.App.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj"
]
}

Просмотреть файл

@ -237,8 +237,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.DeviceTests.Shared", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.DeviceTests", "src\Graphics\tests\DeviceTests\Graphics.DeviceTests.csproj", "{34969E49-FA6E-41BB-9813-5689BB14021E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.AppiumTests", "src\Controls\tests\UITests\Controls.AppiumTests.csproj", "{A23B108A-AB56-4692-B9DA-0E23602E3955}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.ExternalAssembly", "src\Controls\tests\Xaml.UnitTests.ExternalAssembly\Controls.Xaml.UnitTests.ExternalAssembly.csproj", "{F2ADA552-6328-4B2D-8D48-FCDD32C4AF60}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.InternalsVisibleAssembly", "src\Controls\tests\Xaml.UnitTests.InternalsVisibleAssembly\Controls.Xaml.UnitTests.InternalsVisibleAssembly.csproj", "{B5F38A9E-1949-4779-6666-D682B09E0CB3}"
@ -247,7 +245,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.IntegrationT
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.InternalsHiddenAssembly", "src\Controls\tests\Xaml.UnitTests.InternalsHiddenAssembly\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj", "{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample.UITests", "src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj", "{F39F75DC-671B-4649-8005-1929797B3217}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.App", "src\Controls\tests\TestCases\Controls.TestCases.App.csproj", "{F39F75DC-671B-4649-8005-1929797B3217}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.Core", "src\TestUtils\src\UITest.Core\UITest.Core.csproj", "{352C2381-1DEC-4487-819D-340D1EA98FBE}"
EndProject
@ -267,6 +265,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compatibility.Core.UnitTest
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGen.UnitTests", "src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj", "{199777D4-0EA9-4AAB-82A0-0B53D4BA9E4B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Shared.Tests", "src\Controls\tests\TestCases.Shared.Tests\Controls.TestCases.Shared.Tests.csproj", "{759A73E9-0F51-4A44-BA03-9B2AE4524423}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Android.Tests", "src\Controls\tests\TestCases.Android.Tests\Controls.TestCases.Android.Tests.csproj", "{6A6AA47E-4913-46B3-84A8-A0C9CF3EB4F7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.iOS.Tests", "src\Controls\tests\TestCases.iOS.Tests\Controls.TestCases.iOS.Tests.csproj", "{29115330-6854-4715-B382-18EA3A8A8731}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.TestCases.Mac.Tests", "src\Controls\tests\TestCases.Mac.Tests\Controls.TestCases.Mac.Tests.csproj", "{E8CAE2B6-62B3-431C-A76D-1CCD961A1FB4}"
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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -619,10 +627,6 @@ Global
{34969E49-FA6E-41BB-9813-5689BB14021E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34969E49-FA6E-41BB-9813-5689BB14021E}.Release|Any CPU.Build.0 = Release|Any CPU
{34969E49-FA6E-41BB-9813-5689BB14021E}.Release|Any CPU.Deploy.0 = Release|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Release|Any CPU.Build.0 = Release|Any CPU
{F2ADA552-6328-4B2D-8D48-FCDD32C4AF60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2ADA552-6328-4B2D-8D48-FCDD32C4AF60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2ADA552-6328-4B2D-8D48-FCDD32C4AF60}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -676,6 +680,26 @@ Global
{199777D4-0EA9-4AAB-82A0-0B53D4BA9E4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{199777D4-0EA9-4AAB-82A0-0B53D4BA9E4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{199777D4-0EA9-4AAB-82A0-0B53D4BA9E4B}.Release|Any CPU.Build.0 = Release|Any CPU
{759A73E9-0F51-4A44-BA03-9B2AE4524423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{759A73E9-0F51-4A44-BA03-9B2AE4524423}.Debug|Any CPU.Build.0 = Debug|Any CPU
{759A73E9-0F51-4A44-BA03-9B2AE4524423}.Release|Any CPU.ActiveCfg = Release|Any CPU
{759A73E9-0F51-4A44-BA03-9B2AE4524423}.Release|Any CPU.Build.0 = Release|Any CPU
{6A6AA47E-4913-46B3-84A8-A0C9CF3EB4F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6A6AA47E-4913-46B3-84A8-A0C9CF3EB4F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A6AA47E-4913-46B3-84A8-A0C9CF3EB4F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A6AA47E-4913-46B3-84A8-A0C9CF3EB4F7}.Release|Any CPU.Build.0 = Release|Any CPU
{29115330-6854-4715-B382-18EA3A8A8731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29115330-6854-4715-B382-18EA3A8A8731}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29115330-6854-4715-B382-18EA3A8A8731}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29115330-6854-4715-B382-18EA3A8A8731}.Release|Any CPU.Build.0 = Release|Any CPU
{E8CAE2B6-62B3-431C-A76D-1CCD961A1FB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8CAE2B6-62B3-431C-A76D-1CCD961A1FB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8CAE2B6-62B3-431C-A76D-1CCD961A1FB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8CAE2B6-62B3-431C-A76D-1CCD961A1FB4}.Release|Any CPU.Build.0 = Release|Any CPU
{A1D6B9E5-D8FF-436A-9ACF-703CA5E4BD02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -785,12 +809,11 @@ Global
{4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7} = {50C758FE-4E10-409A-94F5-A75480960864}
{66CC98E3-6A1A-4C44-A23C-B575E82106EC} = {C564DDD6-DE79-45CD-88EA-3F690481572A}
{34969E49-FA6E-41BB-9813-5689BB14021E} = {936C47A9-A7EA-4FBD-8733-CED1D4100E69}
{A23B108A-AB56-4692-B9DA-0E23602E3955} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{F2ADA552-6328-4B2D-8D48-FCDD32C4AF60} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{B5F38A9E-1949-4779-6666-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{1C899C94-8744-4E2A-8E23-1660393236FD} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{F39F75DC-671B-4649-8005-1929797B3217} = {E1082E26-D700-4127-9329-66D673FD2D55}
{F39F75DC-671B-4649-8005-1929797B3217} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{352C2381-1DEC-4487-819D-340D1EA98FBE} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{8C8CD467-11F9-4A14-8AF3-047B2CFD19A7} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{8050448A-E08F-4972-9B47-16042A5DFE82} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
@ -800,6 +823,11 @@ Global
{6730CE13-8567-4DC8-B2AF-B12C39818825} = {123AA89E-1638-4E0E-B828-B8F9F9F906A2}
{9F3DD0E7-8A71-4BA8-A3E6-690DC5A9F3D7} = {6730CE13-8567-4DC8-B2AF-B12C39818825}
{199777D4-0EA9-4AAB-82A0-0B53D4BA9E4B} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{759A73E9-0F51-4A44-BA03-9B2AE4524423} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{6A6AA47E-4913-46B3-84A8-A0C9CF3EB4F7} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}

Просмотреть файл

@ -14,7 +14,7 @@ Appium relies on different implementations called `drivers` for each platform th
### The sample project
The project that is used for UI Tests is located here: `src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj`
The project that is used for UI Tests is located here: `src\Controls\tests\TestCases\Controls.TestCases.App.csproj`
There are two types of tests you can add, Issue and Gallery.
@ -26,21 +26,21 @@ You will need to create some kind of UI to test against, which will go in the Co
Then in the Controls.AppiumTests project add a new class that derives from `_IssuesUITest` and add your test.
You can use the example for the sample project [here](https://github.com/dotnet/maui/blob/main/src/Controls/samples/Controls.Sample.UITests/Issues/RefreshViewPage.cs) and the example for the corresponding test [here](https://github.com/dotnet/maui/tree/main/src/Controls/tests/UITests/Tests/Issues/RefreshViewTests.cs).
You can use the example for the sample project [here](https://github.com/dotnet/maui/blob/main/src/Controls/tests/TestCases/Issues/RefreshViewPage.cs) and the example for the corresponding test [here](https://github.com/dotnet/maui/tree/main/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/RefreshViewTests.cs).
### Adding a GalleryPage
Gallery tests are to make it easier to run the same set of tests on controls, if you are creating a new control you would want to add a new gallery page.
We have some base classes you can derive from to make setting this up easier: [CoreGalleryPage](https://github.com/dotnet/maui/blob/main/src/Controls/samples/Controls.Sample.UITests/CoreViews/CoreGalleryPage.cs) and [ContentViewGalleryPage](https://github.com/dotnet/maui/blob/main/src/Controls/samples/Controls.Sample.UITests/Elements/ContentViewGalleryPage.cs)
We have some base classes you can derive from to make setting this up easier: [CoreGalleryPage](https://github.com/dotnet/maui/blob/main/src/Controls/tests/TestCases/CoreViews/CoreGalleryPage.cs) and [ContentViewGalleryPage](https://github.com/dotnet/maui/blob/main/src/Controls/tests/TestCases/Elements/ContentViewGalleryPage.cs)
All controls you intend to interact with need to set the 'AutomationId' property as this will be what you use to query for the element.
Once you have created your GalleryPage, add it to [CorePageView](https://github.com/dotnet/maui/blob/5419846b1f20bdab1b5ce1dff40287edc5c38f12/src/Controls/samples/Controls.Sample.UITests/CoreViews/CorePageView.cs#L45C41-L45C41) so that it will show up on the main page at launch.
Once you have created your GalleryPage, add it to [CorePageView](https://github.com/dotnet/maui/blob/5419846b1f20bdab1b5ce1dff40287edc5c38f12/src/Controls/tests/TestCases/CoreViews/CorePageView.cs#L45C41-L45C41) so that it will show up on the main page at launch.
### Adding the test
The project that hosts the tests is located here: `src\Controls\tests\UITests\Controls.AppiumTests.csproj`
The project that hosts the tests is located here: `src\Controls\tests\TestCases.Shared.Tests\Controls.TestCases.Shared.Tests.csproj`
This project is using [NUnit](https://nunit.org/)

Просмотреть файл

@ -120,10 +120,11 @@
</PropertyGroup>
<PropertyGroup>
<MicrosoftNETTestSdkPackageVersion>17.6.0</MicrosoftNETTestSdkPackageVersion>
<XunitPackageVersion>2.5.1</XunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.5.1</XunitRunnerVisualStudioPackageVersion>
<XunitAssertPackageVersion>2.5.1</XunitAssertPackageVersion>
<XUnitAnalyzersPackageVersion>1.3.0</XUnitAnalyzersPackageVersion>
<XunitPackageVersion>2.8.0</XunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.8.0</XunitRunnerVisualStudioPackageVersion>
<XunitAssertPackageVersion>2.8.0</XunitAssertPackageVersion>
<XUnitAnalyzersPackageVersion>1.13.0</XUnitAnalyzersPackageVersion>
<XunitAbstractionsPackageVersion>2.0.3</XunitAbstractionsPackageVersion>
<NSubstitutePackageVersion>5.1.0</NSubstitutePackageVersion>
<CoverletCollectorPackageVersion>6.0.0</CoverletCollectorPackageVersion>
</PropertyGroup>

Просмотреть файл

@ -6,7 +6,8 @@
const int DefaultApiLevel = 30;
var projectPath = Argument("project", EnvironmentVariable("ANDROID_TEST_PROJECT") ?? DEFAULT_PROJECT);
string DEFAULT_ANDROID_PROJECT = "../../src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj";
var projectPath = Argument("project", EnvironmentVariable("ANDROID_TEST_PROJECT") ?? DEFAULT_ANDROID_PROJECT);
var testDevice = Argument("device", EnvironmentVariable("ANDROID_TEST_DEVICE") ?? $"android-emulator-64_{DefaultApiLevel}");
var targetFramework = Argument("tfm", EnvironmentVariable("TARGET_FRAMEWORK") ?? $"{DotnetVersion}-android");
var binlogArg = Argument("binlog", EnvironmentVariable("ANDROID_TEST_BINLOG") ?? "");

Просмотреть файл

@ -3,7 +3,8 @@
#load "./devices-shared.cake"
// Argument handling
var projectPath = Argument("project", EnvironmentVariable("MAC_TEST_PROJECT") ?? DEFAULT_PROJECT);
string DEFAULT_MAC_PROJECT = "../../src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj";
var projectPath = Argument("project", EnvironmentVariable("MAC_TEST_PROJECT") ?? DEFAULT_MAC_PROJECT);
var testDevice = Argument("device", EnvironmentVariable("MAC_TEST_DEVICE") ?? "maccatalyst");
var dotnetRoot = Argument("dotnet-root", EnvironmentVariable("DOTNET_ROOT"));
var targetFramework = Argument("tfm", EnvironmentVariable("TARGET_FRAMEWORK") ?? $"{DotnetVersion}-maccatalyst");

Просмотреть файл

@ -11,7 +11,7 @@ var projectMappings = new Dictionary<string, string>
["Graphics.DeviceTests"] = "Graphics.DeviceTests",
["MauiBlazorWebView.DeviceTests"] = "MauiBlazorWebView.DeviceTests",
["Essentials.DeviceTests"] = "Essentials.DeviceTests",
["Controls.Sample.UITests"] = "Controls.Sample.UITests",
["Controls.TestCases.App"] = "Controls.TestCases.App",
["Compatibility.ControlGallery.iOS"] = "Compatibility.ControlGallery.iOS",
["Compatibility.ControlGallery.Android"] = "Compatibility.ControlGallery.Android",
};
@ -23,14 +23,14 @@ string DEFAULT_APP_PROJECT = "";
if (string.Equals(TARGET, "uitest", StringComparison.OrdinalIgnoreCase))
{
DEFAULT_PROJECT = "../../src/Controls/tests/UITests/Controls.AppiumTests.csproj";
DEFAULT_APP_PROJECT = "../../src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj";
DEFAULT_PROJECT = "../../src/Controls/tests/TestCases.Shared.Tests/Controls.TestCases.Shared.Tests.csproj";
DEFAULT_APP_PROJECT = "../../src/Controls/tests/TestCases/Controls.TestCases.App.csproj";
}
if (string.Equals(TARGET, "uitest-build", StringComparison.OrdinalIgnoreCase))
{
DEFAULT_PROJECT = "../../src/Controls/tests/UITests/Controls.AppiumTests.csproj";
DEFAULT_APP_PROJECT = "../../src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj";
DEFAULT_PROJECT = "../../src/Controls/tests/TestCases.Shared.Tests/Controls.TestCases.Shared.Tests.csproj";
DEFAULT_APP_PROJECT = "../../src/Controls/tests/TestCases/Controls.TestCases.App.csproj";
}
if (string.Equals(TARGET, "cg-uitest", StringComparison.OrdinalIgnoreCase))

Просмотреть файл

@ -6,7 +6,8 @@
const string DefaultVersion = "17.2";
// Required arguments
var projectPath = Argument("project", EnvironmentVariable("IOS_TEST_PROJECT") ?? DEFAULT_PROJECT);
string DEFAULT_IOS_PROJECT = "../../src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj";
var projectPath = Argument("project", EnvironmentVariable("IOS_TEST_PROJECT") ?? DEFAULT_IOS_PROJECT);
var testDevice = Argument("device", EnvironmentVariable("IOS_TEST_DEVICE") ?? $"ios-simulator-64_{DefaultVersion}");
var targetFramework = Argument("tfm", EnvironmentVariable("TARGET_FRAMEWORK") ?? $"{DotnetVersion}-ios");
var binlogArg = Argument("binlog", EnvironmentVariable("IOS_TEST_BINLOG") ?? "");

Просмотреть файл

@ -9,7 +9,8 @@ const string defaultVersion = "10.0.19041";
const string dotnetVersion = "net9.0";
// required
FilePath PROJECT = Argument("project", EnvironmentVariable("WINDOWS_TEST_PROJECT") ?? DEFAULT_PROJECT);
string DEFAULT_WINDOWS_PROJECT = "../../src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj";
FilePath PROJECT = Argument("project", EnvironmentVariable("WINDOWS_TEST_PROJECT") ?? DEFAULT_WINDOWS_PROJECT);
// Used for Windows to differentiate between packaged and unpackaged
string TEST_DEVICE = Argument("device", EnvironmentVariable("WINDOWS_TEST_DEVICE") ?? $"");
// Package ID of the WinUI Application
@ -437,9 +438,9 @@ Task("SetupTestPaths")
if (apps.Count() == 0)
{
var arcadeBin = new DirectoryPath("../../artifacts/bin/");
if(TEST_APP_PROJECT.FullPath.Contains("Controls.Sample.UITests"))
if(TEST_APP_PROJECT.FullPath.Contains("Controls.TestCases.App"))
{
binDir = MakeAbsolute(new DirectoryPath(arcadeBin + "/Controls.Sample.UITests/" + CONFIGURATION + "/" + winVersion).Combine(DOTNET_PLATFORM));
binDir = MakeAbsolute(new DirectoryPath(arcadeBin + "/Controls.TestCases.App/" + CONFIGURATION + "/" + winVersion).Combine(DOTNET_PLATFORM));
}
if(PROJECT.FullPath.Contains("Controls.DeviceTests"))

Просмотреть файл

@ -162,12 +162,12 @@ stages:
- name: controls
desc: Controls
androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable
android: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj
app: $(System.DefaultWorkingDirectory)/src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj
android: $(System.DefaultWorkingDirectory)/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj
app: $(System.DefaultWorkingDirectory)/src/Controls/tests/TestCases/Controls.TestCases.App.csproj
iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI
ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj
winui: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj
mac: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj
ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj
winui: $(System.DefaultWorkingDirectory)/src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj
mac: $(System.DefaultWorkingDirectory)/src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj
compatibilityAndroidApp: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj
compatibilityAndroidTestProject: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/test/Android.UITests/Compatibility.ControlGallery.Android.UITests.csproj
compatibilityiOSApp: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj

Просмотреть файл

@ -107,7 +107,7 @@ namespace Microsoft.Maui.Controls.ControlGallery
class IssueModel
{
public IssueTracker IssueTracker { get; set; }
public int IssueNumber { get; set; }
public string IssueNumber { get; set; }
public int IssueTestNumber { get; set; }
public string Name { get; set; }
public string Description { get; set; }

Просмотреть файл

@ -204,8 +204,8 @@ namespace Microsoft.Maui.Controls.ControlGallery
string cellName = "";
if (typeIssueAttribute.IssueTracker.ToString() != "None" &&
typeIssueAttribute.IssueNumber != 1461 &&
typeIssueAttribute.IssueNumber != 342)
typeIssueAttribute.IssueNumber != "1461" &&
typeIssueAttribute.IssueNumber != "342")
{
cellName = typeIssueAttribute.DisplayName;
}

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFrameworks>$(_MauiDotNetTfm)</TargetFrameworks>

Просмотреть файл

@ -30,7 +30,7 @@ namespace UITests
{
string? ciArtifactsDirectory = Environment.GetEnvironmentVariable("BUILD_ARTIFACTSTAGINGDIRECTORY");
if (ciArtifactsDirectory != null)
ciArtifactsDirectory = Path.Combine(ciArtifactsDirectory, "Controls.AppiumTests");
ciArtifactsDirectory = Path.Combine(ciArtifactsDirectory, "Controls.TestCases.Shared.Tests");
string assemblyDirectory = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory)!;
string projectRootDirectory = Path.GetFullPath(Path.Combine(assemblyDirectory, "..", "..", ".."));

Просмотреть файл

@ -1,73 +0,0 @@
using System;
namespace Maui.Controls.Sample
{
[AttributeUsage(
AttributeTargets.Class |
AttributeTargets.Method,
AllowMultiple = true)]
public class IssueAttribute : Attribute
{
public IssueAttribute(IssueTracker issueTracker, int issueNumber, string description,
NavigationBehavior navigationBehavior = NavigationBehavior.Default, int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber.ToString();
Description = description;
PlatformsAffected = PlatformAffected.Default;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueAttribute(IssueTracker issueTracker, string issueNumber, string description,
NavigationBehavior navigationBehavior = NavigationBehavior.Default, int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber;
Description = description;
PlatformsAffected = PlatformAffected.Default;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueAttribute(IssueTracker issueTracker, int issueNumber, string description,
PlatformAffected platformsAffected, NavigationBehavior navigationBehavior = NavigationBehavior.Default,
int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber.ToString();
Description = description;
PlatformsAffected = platformsAffected;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueAttribute(IssueTracker issueTracker, string issueNumber, string description,
PlatformAffected platformsAffected, NavigationBehavior navigationBehavior = NavigationBehavior.Default,
int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber;
Description = description;
PlatformsAffected = platformsAffected;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueTracker IssueTracker { get; }
public string IssueNumber { get; }
public int IssueTestNumber { get; }
public string Description { get; }
public PlatformAffected PlatformsAffected { get; }
public NavigationBehavior NavigationBehavior { get; }
public string DisplayName => IssueTestNumber == 0
? $"{IssueTracker.ToString().Substring(0, 1)}{IssueNumber}"
: $"{IssueTracker.ToString().Substring(0, 1)}{IssueNumber} ({IssueTestNumber})";
}
}

Просмотреть файл

@ -1,10 +0,0 @@
namespace Maui.Controls.Sample
{
public enum IssueTracker
{
Github,
Bugzilla,
ManualTest,
None
}
}

Просмотреть файл

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue20696"
Title="Issue20696">
<Shell.Items>
<FlyoutItem Title="Home">
<ShellContent Title="Home">
<ContentPage>
<Button
AutomationId="button"
Text="Add Button to FlyoutHeader"
Clicked="Button_Clicked"/>
</ContentPage>
</ShellContent>
</FlyoutItem>
</Shell.Items>
<Shell.FlyoutHeader>
<StackLayout>
<Button BackgroundColor="Red" Text="Test Button 1"/>
</StackLayout>
</Shell.FlyoutHeader>
</Shell>

Просмотреть файл

@ -0,0 +1,49 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample.Issues;
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 20696, "[iOS] FlyoutHeader does not change its size after adding new content", PlatformAffected.iOS)]
public class Issue20696Test : ContentPage
{
public Issue20696Test()
{
Content = new VerticalStackLayout()
{
Children =
{
new Button()
{
Text = "Go To Test",
AutomationId = "GoToTest",
Command = new Command(() => Application.Current.MainPage = new Issue20696())
}
}
};
}
}
public partial class Issue20696 : Shell
{
public Issue20696()
{
InitializeComponent();
}
void Button_Clicked(object sender, System.EventArgs e)
{
if (Current.FlyoutHeader is StackLayout stackLaylout)
{
stackLaylout.Add(new Button
{
Text = "Test button 2",
AutomationId = "TestButton2",
BackgroundColor = Colors.Red
});
}
Current.FlyoutIsPresented = true;
}
}

Просмотреть файл

@ -1,10 +0,0 @@
namespace Maui.Controls.Sample
{
public enum NavigationBehavior
{
PushAsync,
PushModalAsync,
SetApplicationRoot,
Default
}
}

Просмотреть файл

@ -1,19 +0,0 @@
using System;
namespace Maui.Controls.Sample
{
[Flags]
public enum PlatformAffected
{
iOS = 1 << 0,
Android = 1 << 1,
WinPhone = 1 << 2,
WinRT = 1 << 3,
UWP = 1 << 4,
WPF = 1 << 5,
macOS = 1 << 6,
Gtk = 1 << 7,
All = ~0,
Default = 0
}
}

Просмотреть файл

@ -51,13 +51,6 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
</ItemGroup>
<ItemGroup>
<ProjectReference
Include="..\..\..\Controls\src\Core\Controls.SourceGen.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\BlazorWebView\samples\MauiRazorClassLibrarySample\MauiRazorClassLibrarySample.csproj" />
</ItemGroup>

Просмотреть файл

@ -38,6 +38,8 @@ namespace Microsoft.Maui.Controls.Platform.Compatibility
{
if (!UpdateSafeAreaMargin())
base.LayoutSubviews();
OnHeaderSizeChanged();
}
public override void SafeAreaInsetsDidChange()

Просмотреть файл

@ -6,7 +6,6 @@ using System.Linq;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Graphics;
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media.Imaging;
@ -23,6 +22,8 @@ namespace Microsoft.Maui.Controls.Platform
FrameworkElement? _control;
VisualElement? _element;
SubscriptionFlags _subscriptionFlags = SubscriptionFlags.None;
bool _isDisposed;
bool _isPanning;
bool _isSwiping;
@ -310,24 +311,61 @@ namespace Microsoft.Maui.Controls.Platform
{
if (_container != null)
{
_container.DragStarting -= HandleDragStarting;
_container.DropCompleted -= HandleDropCompleted;
_container.DragOver -= HandleDragOver;
_container.Drop -= HandleDrop;
_container.Tapped -= OnTap;
_container.DoubleTapped -= OnTap;
_container.ManipulationDelta -= OnManipulationDelta;
_container.ManipulationStarted -= OnManipulationStarted;
_container.ManipulationCompleted -= OnManipulationCompleted;
_container.PointerPressed -= OnPointerPressed;
_container.PointerExited -= OnPointerExited;
_container.PointerReleased -= OnPointerReleased;
_container.PointerCanceled -= OnPointerCanceled;
_container.PointerEntered -= OnPgrPointerEntered;
_container.PointerExited -= OnPgrPointerExited;
_container.PointerMoved -= OnPgrPointerMoved;
_container.PointerPressed -= OnPgrPointerPressed;
_container.PointerReleased -= OnPgrPointerReleased;
if ((_subscriptionFlags & SubscriptionFlags.ContainerDragEventsSubscribed) != 0)
{
_subscriptionFlags &= ~SubscriptionFlags.ContainerDragEventsSubscribed;
_container.DragStarting -= HandleDragStarting;
_container.DropCompleted -= HandleDropCompleted;
}
if ((_subscriptionFlags & SubscriptionFlags.ContainerDropEventsSubscribed) != 0)
{
_subscriptionFlags &= ~SubscriptionFlags.ContainerDropEventsSubscribed;
_container.DragOver -= HandleDragOver;
_container.Drop -= HandleDrop;
_container.DragLeave -= HandleDragLeave;
}
if ((_subscriptionFlags & SubscriptionFlags.ContainerTapAndRightTabEventSubscribed) != 0)
{
_subscriptionFlags &= ~SubscriptionFlags.ContainerTapAndRightTabEventSubscribed;
_container.Tapped -= OnTap;
_container.RightTapped -= OnTap;
}
if ((_subscriptionFlags & SubscriptionFlags.ContainerDoubleTapEventSubscribed) != 0)
{
_subscriptionFlags &= ~SubscriptionFlags.ContainerDoubleTapEventSubscribed;
_container.DoubleTapped -= OnTap;
}
if ((_subscriptionFlags & SubscriptionFlags.ContainerPgrPointerEventsSubscribed) != 0)
{
_subscriptionFlags &= ~SubscriptionFlags.ContainerPgrPointerEventsSubscribed;
_container.PointerEntered -= OnPgrPointerEntered;
_container.PointerExited -= OnPgrPointerExited;
_container.PointerMoved -= OnPgrPointerMoved;
_container.PointerPressed -= OnPgrPointerPressed;
_container.PointerReleased -= OnPgrPointerReleased;
}
if ((_subscriptionFlags & SubscriptionFlags.ContainerManipulationAndPointerEventsSubscribed) != 0)
{
_subscriptionFlags &= ~SubscriptionFlags.ContainerManipulationAndPointerEventsSubscribed;
_container.ManipulationDelta -= OnManipulationDelta;
_container.ManipulationStarted -= OnManipulationStarted;
_container.ManipulationCompleted -= OnManipulationCompleted;
_container.PointerPressed -= OnPointerPressed;
_container.PointerExited -= OnPointerExited;
_container.PointerReleased -= OnPointerReleased;
_container.PointerCanceled -= OnPointerCanceled;
}
}
}
@ -688,12 +726,16 @@ namespace Microsoft.Maui.Controls.Platform
if (canDrag)
{
_subscriptionFlags |= SubscriptionFlags.ContainerDragEventsSubscribed;
_container.DragStarting += HandleDragStarting;
_container.DropCompleted += HandleDropCompleted;
}
if (allowDrop)
{
_subscriptionFlags |= SubscriptionFlags.ContainerDropEventsSubscribed;
_container.DragOver += HandleDragOver;
_container.Drop += HandleDrop;
_container.DragLeave += HandleDragLeave;
@ -718,6 +760,8 @@ namespace Microsoft.Maui.Controls.Platform
if (gestures.HasAnyGesturesFor<TapGestureRecognizer>(g => g.NumberOfTapsRequired == 1)
|| children?.GetChildGesturesFor<TapGestureRecognizer>(g => g.NumberOfTapsRequired == 1).Any() == true)
{
_subscriptionFlags |= SubscriptionFlags.ContainerTapAndRightTabEventSubscribed;
_container.Tapped += OnTap;
_container.RightTapped += OnTap;
}
@ -732,6 +776,8 @@ namespace Microsoft.Maui.Controls.Platform
if (gestures.HasAnyGesturesFor<TapGestureRecognizer>(g => g.NumberOfTapsRequired == 1 || g.NumberOfTapsRequired == 2)
|| children?.GetChildGesturesFor<TapGestureRecognizer>(g => g.NumberOfTapsRequired == 1 || g.NumberOfTapsRequired == 2).Any() == true)
{
_subscriptionFlags |= SubscriptionFlags.ContainerDoubleTapEventSubscribed;
_container.DoubleTapped += OnTap;
}
else
@ -742,6 +788,7 @@ namespace Microsoft.Maui.Controls.Platform
}
}
_subscriptionFlags |= SubscriptionFlags.ContainerPgrPointerEventsSubscribed;
_container.PointerEntered += OnPgrPointerEntered;
_container.PointerExited += OnPgrPointerExited;
_container.PointerMoved += OnPgrPointerMoved;
@ -769,6 +816,7 @@ namespace Microsoft.Maui.Controls.Platform
return;
}
_subscriptionFlags |= SubscriptionFlags.ContainerManipulationAndPointerEventsSubscribed;
_container.ManipulationMode = ManipulationModes.Scale | ManipulationModes.TranslateX | ManipulationModes.TranslateY;
_container.ManipulationDelta += OnManipulationDelta;
_container.ManipulationStarted += OnManipulationStarted;
@ -796,5 +844,17 @@ namespace Microsoft.Maui.Controls.Platform
return new DragEventArgs(package!, (relativeTo) => GetPosition(relativeTo, e), platformArgs);
}
[Flags]
enum SubscriptionFlags : byte
{
None = 0,
ContainerDragEventsSubscribed = 1,
ContainerDropEventsSubscribed = 1 << 1,
ContainerPgrPointerEventsSubscribed = 1 << 2,
ContainerManipulationAndPointerEventsSubscribed = 1 << 3,
ContainerTapAndRightTabEventSubscribed = 1 << 4,
ContainerDoubleTapEventSubscribed = 1 << 5
}
}
}

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace Microsoft.Maui.Controls.CustomAttributes
{
@ -27,6 +28,7 @@ namespace Microsoft.Maui.Controls.CustomAttributes
{
Github,
Bugzilla,
ManualTest,
None
}
@ -46,10 +48,20 @@ namespace Microsoft.Maui.Controls.CustomAttributes
)]
public class IssueAttribute : Attribute
{
bool _modal;
public IssueAttribute(IssueTracker issueTracker, int issueNumber, string description,
NavigationBehavior navigationBehavior = NavigationBehavior.Default, int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber.ToString();
Description = description;
PlatformsAffected = PlatformAffected.Default;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueAttribute(IssueTracker issueTracker, string issueNumber, string description,
NavigationBehavior navigationBehavior = NavigationBehavior.Default, int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber;
@ -62,6 +74,18 @@ namespace Microsoft.Maui.Controls.CustomAttributes
public IssueAttribute(IssueTracker issueTracker, int issueNumber, string description,
PlatformAffected platformsAffected, NavigationBehavior navigationBehavior = NavigationBehavior.Default,
int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber.ToString();
Description = description;
PlatformsAffected = platformsAffected;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueAttribute(IssueTracker issueTracker, string issueNumber, string description,
PlatformAffected platformsAffected, NavigationBehavior navigationBehavior = NavigationBehavior.Default,
int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber;
@ -73,7 +97,7 @@ namespace Microsoft.Maui.Controls.CustomAttributes
public IssueTracker IssueTracker { get; }
public int IssueNumber { get; }
public string IssueNumber { get; }
public int IssueTestNumber { get; }
@ -242,6 +266,7 @@ namespace Microsoft.Maui.Controls.CustomAttributes
IsEnabled,
Navigation,
InputTransparent,
NotInputTransparent,
Layout,
X,
Y,
@ -646,6 +671,7 @@ namespace Microsoft.Maui.Controls.CustomAttributes
VerticalTextAlignmentEnd,
MaxLines,
HtmlTextType,
BrokenHtmlTextType,
HtmlTextTypeMultipleLines,
HtmlTextLabelProperties,
TextTypeToggle,
@ -861,6 +887,7 @@ namespace Microsoft.Maui.Controls.CustomAttributes
{
ToStringOverride,
Spans,
SpanTapped,
PropertyChanged
}
@ -880,5 +907,70 @@ namespace Microsoft.Maui.Controls.CustomAttributes
Position,
IsBounceEnabled
}
public enum ImageLoading
{
FromBundleSvg,
FromBundlePng,
FromBundleJpg,
FromBundleGif,
}
public enum InputTransparency
{
Default,
IsFalse,
IsTrue,
TransLayoutOverlay,
TransLayoutOverlayWithButton,
CascadeTransLayoutOverlay,
CascadeTransLayoutOverlayWithButton,
}
public static class InputTransparencyMatrix
{
// this is both for color diff and cols
const bool truee = true;
public static readonly IReadOnlyDictionary<(bool RT, bool RC, bool NT, bool NC, bool T), (bool Clickable, bool PassThru)> States =
new Dictionary<(bool, bool, bool, bool, bool), (bool, bool)>
{
[(truee, truee, truee, truee, truee)] = (false, truee),
[(truee, truee, truee, truee, false)] = (false, truee),
[(truee, truee, truee, false, truee)] = (false, truee),
[(truee, truee, truee, false, false)] = (false, truee),
[(truee, truee, false, truee, truee)] = (false, truee),
[(truee, truee, false, truee, false)] = (false, truee),
[(truee, truee, false, false, truee)] = (false, truee),
[(truee, truee, false, false, false)] = (false, truee),
[(truee, false, truee, truee, truee)] = (false, truee),
[(truee, false, truee, truee, false)] = (false, truee),
[(truee, false, truee, false, truee)] = (false, truee),
[(truee, false, truee, false, false)] = (truee, false),
[(truee, false, false, truee, truee)] = (false, false),
[(truee, false, false, truee, false)] = (truee, false),
[(truee, false, false, false, truee)] = (false, false),
[(truee, false, false, false, false)] = (truee, false),
[(false, truee, truee, truee, truee)] = (false, false),
[(false, truee, truee, truee, false)] = (false, false),
[(false, truee, truee, false, truee)] = (false, false),
[(false, truee, truee, false, false)] = (truee, false),
[(false, truee, false, truee, truee)] = (false, false),
[(false, truee, false, truee, false)] = (truee, false),
[(false, truee, false, false, truee)] = (false, false),
[(false, truee, false, false, false)] = (truee, false),
[(false, false, truee, truee, truee)] = (false, false),
[(false, false, truee, truee, false)] = (false, false),
[(false, false, truee, false, truee)] = (false, false),
[(false, false, truee, false, false)] = (truee, false),
[(false, false, false, truee, truee)] = (false, false),
[(false, false, false, truee, false)] = (truee, false),
[(false, false, false, false, truee)] = (false, false),
[(false, false, false, false, false)] = (truee, false),
};
public static string GetKey(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans, bool isClickable, bool isPassThru) =>
$"Root{(rootTrans ? "Trans" : "")}{(rootCascade ? "Cascade" : "")}Nested{(nestedTrans ? "Trans" : "")}{(nestedCascade ? "Cascade" : "")}Control{(trans ? "Trans" : "")}Is{(isClickable ? "" : "Not")}ClickableIs{(isPassThru ? "" : "Not")}PassThru";
}
}
}

Просмотреть файл

@ -7,6 +7,7 @@
<RootNamespace>Microsoft.Maui.DeviceTests</RootNamespace>
<AssemblyName>Microsoft.Maui.Controls.DeviceTests</AssemblyName>
<NoWarn>$(NoWarn),CA1416</NoWarn>
<ExcludeMicrosoftNetTestSdk>true</ExcludeMicrosoftNetTestSdk>
<!-- Disable multi-RID builds to workaround a parallel build issue -->
<RuntimeIdentifier Condition="$(TargetFramework.Contains('-maccatalyst'))">maccatalyst-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(TargetFramework.Contains('-maccatalyst')) and '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'arm64'">maccatalyst-arm64</RuntimeIdentifier>

Просмотреть файл

@ -0,0 +1,54 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(_MauiDotNetTfm)</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsTestProject>true</IsTestProject>
<RootNamespace>Microsoft.Maui.TestCases.Tests</RootNamespace>
<DefineConstants>$(DefineConstants);ANDROID</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.7" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Controls\src\Core\Controls.Core.csproj" />
<ProjectReference Include="..\..\..\Core\src\Core.csproj" />
<ProjectReference Include="..\..\..\Graphics\src\Graphics\Graphics.csproj" />
</ItemGroup>
<ItemGroup>
<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" />
</ItemGroup>
<ItemGroup Condition="$(UseLocalVisualTestUtils) == ''">
<PackageReference Include="VisualTestUtils.MagickNet" Version="0.9.46-beta" />
<PackageReference Include="VisualTestUtils" Version="0.9.46-beta" />
</ItemGroup>
<ItemGroup Condition="$(UseLocalVisualTestUtils) != ''">
<ProjectReference Include="$(MauiRootDirectory)..\visual-test-utils\src\VisualTestUtils.MagickNet\VisualTestUtils.MagickNet.csproj" />
<ProjectReference Include="$(MauiRootDirectory)..\visual-test-utils\src\VisualTestUtils\VisualTestUtils.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="snapshots\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="..\TestCases.Shared.Tests\**\*.cs" Exclude="..\TestCases.Shared.Tests\obj\**;..\TestCases.Shared.Tests\bin\**" LinkBase="Shared" Visible="false" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
using NUnit.Framework;
using OpenQA.Selenium.Appium;
using UITest.Core;
namespace Microsoft.Maui.TestCases.Tests;
public class PlatformSpecificSampleTest : UITest
{
public PlatformSpecificSampleTest(TestDevice testDevice) : base(testDevice)
{
}
[Test]
public void SampleTest()
{
if (App is AppiumDriver driver)
{
driver?.GetScreenshot().SaveAsFile($"{nameof(SampleTest)}.png");
}
}
}

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 9.2 KiB

После

Ширина:  |  Высота:  |  Размер: 9.2 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1.6 MiB

После

Ширина:  |  Высота:  |  Размер: 1.6 MiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 28 KiB

После

Ширина:  |  Высота:  |  Размер: 28 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 40 KiB

После

Ширина:  |  Высота:  |  Размер: 40 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 21 KiB

После

Ширина:  |  Высота:  |  Размер: 21 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 46 KiB

После

Ширина:  |  Высота:  |  Размер: 46 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 8.8 KiB

После

Ширина:  |  Высота:  |  Размер: 8.8 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 179 KiB

После

Ширина:  |  Высота:  |  Размер: 179 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 497 KiB

После

Ширина:  |  Высота:  |  Размер: 497 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 492 KiB

После

Ширина:  |  Высота:  |  Размер: 492 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 117 KiB

После

Ширина:  |  Высота:  |  Размер: 117 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 65 KiB

После

Ширина:  |  Высота:  |  Размер: 65 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 802 KiB

После

Ширина:  |  Высота:  |  Размер: 802 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 153 KiB

После

Ширина:  |  Высота:  |  Размер: 153 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 137 KiB

После

Ширина:  |  Высота:  |  Размер: 137 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 25 KiB

После

Ширина:  |  Высота:  |  Размер: 25 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 43 KiB

После

Ширина:  |  Высота:  |  Размер: 43 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 176 KiB

После

Ширина:  |  Высота:  |  Размер: 176 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 83 KiB

После

Ширина:  |  Высота:  |  Размер: 83 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 37 KiB

После

Ширина:  |  Высота:  |  Размер: 37 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 19 KiB

После

Ширина:  |  Высота:  |  Размер: 19 KiB

Просмотреть файл

@ -0,0 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(_MauiDotNetTfm)</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsTestProject>true</IsTestProject>
<RootNamespace>Microsoft.Maui.TestCases.Tests</RootNamespace>
<DefineConstants>$(DefineConstants);MACCATALYST;MACUITEST</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.7" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Controls\src\Core\Controls.Core.csproj" />
<ProjectReference Include="..\..\..\Core\src\Core.csproj" />
<ProjectReference Include="..\..\..\Graphics\src\Graphics\Graphics.csproj" />
</ItemGroup>
<ItemGroup>
<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" />
</ItemGroup>
<ItemGroup Condition="$(UseLocalVisualTestUtils) == ''">
<PackageReference Include="VisualTestUtils.MagickNet" Version="0.9.46-beta" />
<PackageReference Include="VisualTestUtils" Version="0.9.46-beta" />
</ItemGroup>
<ItemGroup Condition="$(UseLocalVisualTestUtils) != ''">
<ProjectReference Include="$(MauiRootDirectory)..\visual-test-utils\src\VisualTestUtils.MagickNet\VisualTestUtils.MagickNet.csproj" />
<ProjectReference Include="$(MauiRootDirectory)..\visual-test-utils\src\VisualTestUtils\VisualTestUtils.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\TestCases.Shared.Tests\**\*.cs" Exclude="..\TestCases.Shared.Tests\obj\**;..\TestCases.Shared.Tests\bin\**" LinkBase="Shared" Visible="false" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
using NUnit.Framework;
using OpenQA.Selenium.Appium;
using UITest.Core;
namespace Microsoft.Maui.TestCases.Tests;
public class PlatformSpecificSampleTest : UITest
{
public PlatformSpecificSampleTest(TestDevice testDevice) : base(testDevice)
{
}
[Test]
public void SampleTest()
{
if (App is AppiumDriver driver)
{
driver?.GetScreenshot().SaveAsFile($"{nameof(SampleTest)}.png");
}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
namespace Microsoft.Maui.TestCases.Tests
{
internal enum Axis
{
X,
Y,
Z
}
}

Просмотреть файл

@ -0,0 +1,42 @@
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFrameworks>$(_MauiDotNetTfm)</TargetFrameworks>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<GenerateMSBuildEditorConfigFile>False</GenerateMSBuildEditorConfigFile>
<RootNamespace>Microsoft.Maui.TestCases.Tests</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Content Include="**\*.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsAndroid)' == 'True' ">
<DefineConstants>$(DefineConstants);ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsiOS)' == 'True' ">
<DefineConstants>$(DefineConstants);IOS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsMacCatalyst)' == 'True' ">
<DefineConstants>$(DefineConstants);MACCATALYST</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsTizen)' == 'True' ">
<DefineConstants>$(DefineConstants);TIZEN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsWindows)' == 'True' ">
<DefineConstants>$(DefineConstants); WINDOWS</DefineConstants>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,42 @@
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFrameworks>$(_MauiDotNetTfm)</TargetFrameworks>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<GenerateMSBuildEditorConfigFile>False</GenerateMSBuildEditorConfigFile>
<RootNamespace>Microsoft.Maui.TestCases.Tests</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Content Include="**\*.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsAndroid)' == 'True' ">
<DefineConstants>$(DefineConstants);ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsiOS)' == 'True' ">
<DefineConstants>$(DefineConstants);IOS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsMacCatalyst)' == 'True' ">
<DefineConstants>$(DefineConstants);MACCATALYST</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsTizen)' == 'True' ">
<DefineConstants>$(DefineConstants);TIZEN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsWindows)' == 'True' ">
<DefineConstants>$(DefineConstants); WINDOWS</DefineConstants>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,4 +1,4 @@
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
internal class FloatToBoolConverter : TypeConverter
{

Просмотреть файл

@ -2,7 +2,7 @@
using UITest.Appium.NUnit;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public static class IUITestContextExtensions
{

Просмотреть файл

@ -1,4 +1,4 @@
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
internal class Matrix : object
{

Просмотреть файл

@ -1,7 +1,7 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
internal static class ParsingUtils
{

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.Maui.Controls;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
internal static class PlatformMethodQueries
{

Просмотреть файл

@ -1,7 +1,7 @@
using Microsoft.Maui.Controls;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
internal static class PlatformMethods
{

Просмотреть файл

@ -1,4 +1,4 @@
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
internal class StringToBoolConverter : TypeConverter
{

Просмотреть файл

@ -1,6 +1,4 @@
using System.Collections.Generic;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
public static class Test
{

Просмотреть файл

@ -2,7 +2,7 @@
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class BorderUITests : UITest
{

Просмотреть файл

@ -1,9 +1,10 @@
using Maui.Controls.Sample;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class ButtonUITests : _ViewUITests
{
@ -27,13 +28,13 @@ namespace Microsoft.Maui.AppiumTests
remote.GoTo();
var textBeforeClick = remote.GetEventLabel().GetText();
Assert.AreEqual("Event: Clicked (none)", textBeforeClick);
ClassicAssert.AreEqual("Event: Clicked (none)", textBeforeClick);
// Click Button
remote.TapView();
var textAfterClick = remote.GetEventLabel().GetText();
Assert.AreEqual("Event: Clicked (fired 1)", textAfterClick);
ClassicAssert.AreEqual("Event: Clicked (fired 1)", textAfterClick);
}
}
}

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class CarouselViewUITests : UITest
{
@ -32,7 +33,7 @@ namespace Microsoft.Maui.AppiumTests
App.WaitForElement("lblPosition");
await Task.Delay(1000);
var result = App.FindElement("lblPosition").GetText();
Assert.AreEqual("3", result);
ClassicAssert.AreEqual("3", result);
}
}
@ -64,7 +65,7 @@ namespace Microsoft.Maui.AppiumTests
void CheckLabelValue(string labelAutomationId, string value)
{
var result = App.FindElement(labelAutomationId).GetText();
Assert.AreEqual(value, result);
ClassicAssert.AreEqual(value, result);
}
}
}

Просмотреть файл

@ -1,7 +1,7 @@
using NUnit.Framework;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class CheckBoxUITests : _ViewUITests
{

Просмотреть файл

@ -3,7 +3,7 @@ using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class ImageLoadingGalleryTests : CoreGalleryBasePageTest
{

Просмотреть файл

@ -1,9 +1,10 @@
using Maui.Controls.Sample;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class InputTransparencyGalleryTests : CoreGalleryBasePageTest
{
@ -48,7 +49,7 @@ namespace Microsoft.Maui.AppiumTests
remote.GoTo(test.ToString());
var textBeforeClick = remote.GetEventLabel().GetText();
Assert.AreEqual($"Event: {test} (none)", textBeforeClick);
ClassicAssert.AreEqual($"Event: {test} (none)", textBeforeClick);
remote.TapView();
@ -57,19 +58,19 @@ namespace Microsoft.Maui.AppiumTests
if (clickable is null || passthru is null)
{
// some tests are really basic so have no need for fancy checks
Assert.AreEqual($"Event: {test} (SUCCESS 1)", textAfterClick);
ClassicAssert.AreEqual($"Event: {test} (SUCCESS 1)", textAfterClick);
}
else if (clickable == true || passthru == true)
{
// if the button is clickable or taps pass through to the base button
Assert.AreEqual($"Event: {test} (SUCCESS 1)", textAfterClick);
ClassicAssert.AreEqual($"Event: {test} (SUCCESS 1)", textAfterClick);
}
else if (Device == TestDevice.Android)
{
// TODO: Android is broken with everything passing through so we just use that
// to test the bottom button was clickable
// https://github.com/dotnet/maui/issues/10252
Assert.AreEqual($"Event: {test} (SUCCESS 1)", textAfterClick);
ClassicAssert.AreEqual($"Event: {test} (SUCCESS 1)", textAfterClick);
}
else
{
@ -77,7 +78,7 @@ namespace Microsoft.Maui.AppiumTests
Task.Delay(500).Wait(); // just make sure that nothing happened
textAfterClick = remote.GetEventLabel().GetText();
Assert.AreEqual($"Event: {test} (none)", textBeforeClick);
ClassicAssert.AreEqual($"Event: {test} (none)", textBeforeClick);
}
}
}

Просмотреть файл

@ -1,7 +1,7 @@
using NUnit.Framework;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public abstract class CoreGalleryBasePageTest : UITest
{

Просмотреть файл

@ -1,10 +1,11 @@
using Maui.Controls.Sample;
using Microsoft.Maui.Graphics;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class DragAndDropUITests : UITest
{
@ -39,9 +40,9 @@ namespace Microsoft.Maui.AppiumTests
}
else
{
Assert.True(textAfterDrag.Contains("DragStarting", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted", StringComparison.OrdinalIgnoreCase));
}
}
@ -68,10 +69,10 @@ namespace Microsoft.Maui.AppiumTests
}
else
{
Assert.True(textAfterDrag.Contains("DragStarting", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("RainbowColorsAdd:Red", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("RainbowColorsAdd:Red", StringComparison.OrdinalIgnoreCase));
}
}
@ -97,65 +98,65 @@ namespace Microsoft.Maui.AppiumTests
{
if (Device == TestDevice.iOS || Device == TestDevice.Mac)
{
Assert.True(textAfterDrag.Contains("DragStarting:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragStarting:DragInteraction", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragStarting:DragSession", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:DragInteraction", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:DragSession", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted:DropInteraction", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted:DropSession", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted:DropInteraction", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted:DropSession", StringComparison.OrdinalIgnoreCase));
// Until the UI test can drag over an item without placing it down
//Assert.True(textAfterDrag.Contains("DragLeave:Sender", StringComparison.OrdinalIgnoreCase));
//Assert.True(textAfterDrag.Contains("DragLeave:DropInteraction", StringComparison.OrdinalIgnoreCase));
//Assert.True(textAfterDrag.Contains("DragLeave:DropSession", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:Sender", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:DropInteraction", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:DropSession", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver:DropInteraction", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver:DropSession", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver:DropInteraction", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver:DropSession", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("Drop:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("Drop:DropInteraction", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("Drop:DropSession", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("Drop:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("Drop:DropInteraction", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("Drop:DropSession", StringComparison.OrdinalIgnoreCase));
}
else if (Device == TestDevice.Android)
{
Assert.True(textAfterDrag.Contains("DragStarting:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragStarting:MotionEvent", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:MotionEvent", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted:DragEvent", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted:DragEvent", StringComparison.OrdinalIgnoreCase));
// Until the UI test can drag over an item without placing it down
//Assert.True(textAfterDrag.Contains("DragLeave:Sender", StringComparison.OrdinalIgnoreCase));
//Assert.True(textAfterDrag.Contains("DragLeave:DragEvent", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:Sender", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:DragEvent", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver:DragEvent", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver:DragEvent", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("Drop:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("Drop:DragEvent", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("Drop:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("Drop:DragEvent", StringComparison.OrdinalIgnoreCase));
}
else
{
Assert.True(textAfterDrag.Contains("DragStarting:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragStarting:DragStartingEventArgs", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragStarting:Handled", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:DragStartingEventArgs", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragStarting:Handled", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DropCompleted:DropCompletedEventArgs", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DropCompleted:DropCompletedEventArgs", StringComparison.OrdinalIgnoreCase));
// Until the UI test can drag over an item without placing it down
//Assert.True(textAfterDrag.Contains("DragLeave:Sender", StringComparison.OrdinalIgnoreCase));
//Assert.True(textAfterDrag.Contains("DragLeave:DragEventArgs", StringComparison.OrdinalIgnoreCase));
//Assert.True(textAfterDrag.Contains("DragLeave:Handled", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:Sender", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:DragEventArgs", StringComparison.OrdinalIgnoreCase));
//ClassicAssert.True(textAfterDrag.Contains("DragLeave:Handled", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("DragOver:DragEventArgs", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("DragOver:DragEventArgs", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("Drop:Sender", StringComparison.OrdinalIgnoreCase));
Assert.True(textAfterDrag.Contains("Drop:DragEventArgs", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("Drop:Sender", StringComparison.OrdinalIgnoreCase));
ClassicAssert.True(textAfterDrag.Contains("Drop:DragEventArgs", StringComparison.OrdinalIgnoreCase));
}
}
}
@ -178,20 +179,20 @@ namespace Microsoft.Maui.AppiumTests
var dragStartRelativeToScreen = GetCoordinatesFromLabel(App.FindElement("DragStartRelativeScreen").GetText());
var dragStartRelativeToLabel = GetCoordinatesFromLabel(App.FindElement("DragStartRelativeLabel").GetText());
Assert.NotNull(dragStartRelativeToSelf);
Assert.NotNull(dragStartRelativeToScreen);
Assert.NotNull(dragStartRelativeToLabel);
ClassicAssert.NotNull(dragStartRelativeToSelf);
ClassicAssert.NotNull(dragStartRelativeToScreen);
ClassicAssert.NotNull(dragStartRelativeToLabel);
Assert.True(dragStartRelativeToSelf!.Value.X > 0 && dragStartRelativeToSelf!.Value.Y > 0);
Assert.True(dragStartRelativeToScreen!.Value.X > 0 && dragStartRelativeToScreen!.Value.Y > 0);
ClassicAssert.True(dragStartRelativeToSelf!.Value.X > 0 && dragStartRelativeToSelf!.Value.Y > 0);
ClassicAssert.True(dragStartRelativeToScreen!.Value.X > 0 && dragStartRelativeToScreen!.Value.Y > 0);
// The position of the drag relative to itself should be less than that relative to the screen
// There are other elements in the screen, plus the ContentView of the test has some margin
Assert.True(dragStartRelativeToSelf!.Value.X < dragStartRelativeToScreen!.Value.X);
Assert.True(dragStartRelativeToSelf!.Value.Y < dragStartRelativeToScreen!.Value.Y);
ClassicAssert.True(dragStartRelativeToSelf!.Value.X < dragStartRelativeToScreen!.Value.X);
ClassicAssert.True(dragStartRelativeToSelf!.Value.Y < dragStartRelativeToScreen!.Value.Y);
// Since the label is below the the box, the Y position of the drag relative to the label should be negative
Assert.True(dragStartRelativeToLabel!.Value.Y < 0);
ClassicAssert.True(dragStartRelativeToLabel!.Value.Y < 0);
}
[Test]
@ -213,24 +214,24 @@ namespace Microsoft.Maui.AppiumTests
var dragRelativeToLabel = GetCoordinatesFromLabel(App.FindElement("DragRelativeLabel").GetText());
var dragStartRelativeToScreen = GetCoordinatesFromLabel(App.FindElement("DragStartRelativeScreen").GetText());
Assert.NotNull(dragRelativeToDrop);
Assert.NotNull(dragRelativeToScreen);
Assert.NotNull(dragRelativeToLabel);
Assert.NotNull(dragStartRelativeToScreen);
ClassicAssert.NotNull(dragRelativeToDrop);
ClassicAssert.NotNull(dragRelativeToScreen);
ClassicAssert.NotNull(dragRelativeToLabel);
ClassicAssert.NotNull(dragStartRelativeToScreen);
Assert.True(dragRelativeToDrop!.Value.X > 0 && dragRelativeToDrop!.Value.Y > 0);
Assert.True(dragRelativeToScreen!.Value.X > 0 && dragRelativeToScreen!.Value.Y > 0);
ClassicAssert.True(dragRelativeToDrop!.Value.X > 0 && dragRelativeToDrop!.Value.Y > 0);
ClassicAssert.True(dragRelativeToScreen!.Value.X > 0 && dragRelativeToScreen!.Value.Y > 0);
// The position of the drag relative to the drop location should be less than that relative to the screen
// There are other elements in the screen, plus the ContentView of the test has some margin
Assert.True(dragRelativeToDrop!.Value.X < dragRelativeToScreen!.Value.X);
Assert.True(dragRelativeToDrop!.Value.Y < dragRelativeToScreen!.Value.Y);
ClassicAssert.True(dragRelativeToDrop!.Value.X < dragRelativeToScreen!.Value.X);
ClassicAssert.True(dragRelativeToDrop!.Value.Y < dragRelativeToScreen!.Value.Y);
// Since the label is below the the box, the Y position of the drag relative to the label should be negative
Assert.True(dragRelativeToLabel!.Value.Y < 0);
ClassicAssert.True(dragRelativeToLabel!.Value.Y < 0);
// The drag is executed left to right, so the X value should be higher than where it started
Assert.True(dragRelativeToScreen!.Value.X > dragStartRelativeToScreen!.Value.X);
ClassicAssert.True(dragRelativeToScreen!.Value.X > dragStartRelativeToScreen!.Value.X);
}
[Test]
@ -254,30 +255,30 @@ namespace Microsoft.Maui.AppiumTests
var dragRelativeToLabel = GetCoordinatesFromLabel(App.FindElement("DragRelativeLabel").GetText());
var dragStartRelativeToScreen = GetCoordinatesFromLabel(App.FindElement("DragStartRelativeScreen").GetText());
Assert.NotNull(dropRelativeToLayout);
Assert.NotNull(dropRelativeToScreen);
Assert.NotNull(dropRelativeToLabel);
ClassicAssert.NotNull(dropRelativeToLayout);
ClassicAssert.NotNull(dropRelativeToScreen);
ClassicAssert.NotNull(dropRelativeToLabel);
Assert.NotNull(dragRelativeToLabel);
Assert.NotNull(dragStartRelativeToScreen);
ClassicAssert.NotNull(dragRelativeToLabel);
ClassicAssert.NotNull(dragStartRelativeToScreen);
Assert.True(dropRelativeToLayout!.Value.X > 0 && dropRelativeToLayout!.Value.Y > 0);
Assert.True(dropRelativeToScreen!.Value.X > 0 && dropRelativeToScreen!.Value.Y > 0);
ClassicAssert.True(dropRelativeToLayout!.Value.X > 0 && dropRelativeToLayout!.Value.Y > 0);
ClassicAssert.True(dropRelativeToScreen!.Value.X > 0 && dropRelativeToScreen!.Value.Y > 0);
// The position of the drop relative the layout should be less than that relative to the screen
// There are other elements in the screen, plus the ContentView of the test has some margin
Assert.True(dropRelativeToLayout!.Value.X < dropRelativeToScreen!.Value.X);
Assert.True(dropRelativeToLayout!.Value.Y < dropRelativeToScreen!.Value.Y);
ClassicAssert.True(dropRelativeToLayout!.Value.X < dropRelativeToScreen!.Value.X);
ClassicAssert.True(dropRelativeToLayout!.Value.Y < dropRelativeToScreen!.Value.Y);
// Since the label is below the the box, the Y position of the drop relative to the label should be negative
Assert.True(dropRelativeToLabel!.Value.Y < 0);
ClassicAssert.True(dropRelativeToLabel!.Value.Y < 0);
// The drop is executed left to right, so the X value should be higher than where it started
Assert.True(dropRelativeToScreen!.Value.X > dragStartRelativeToScreen!.Value.X);
ClassicAssert.True(dropRelativeToScreen!.Value.X > dragStartRelativeToScreen!.Value.X);
// The label receiving the coordinates of the drop is below that which receives the coordinates of the drag
// Therefore, the label that receives the coordinates of the drop should have a smaller Y value (more negative)
Assert.True(dropRelativeToLabel!.Value.Y < dragRelativeToLabel!.Value.Y);
ClassicAssert.True(dropRelativeToLabel!.Value.Y < dragRelativeToLabel!.Value.Y);
}
// Helper function to parse out the X and Y coordinates from text labels 'Drag position: (x),(y)'

Просмотреть файл

@ -1,7 +1,7 @@
using NUnit.Framework;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class EditorUITests : _ViewUITests
{

Просмотреть файл

@ -1,9 +1,10 @@
using Maui.Controls.Sample;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
namespace Microsoft.Maui.TestCases.Tests
{
public class GestureRecognizerUITests : UITest
{
@ -36,7 +37,7 @@ namespace Microsoft.Maui.AppiumTests
App.Tap("secondaryLabel");
var secondaryLabelText = App.FindElement("secondaryLabel").GetText();
Assert.IsNotEmpty(secondaryLabelText);
ClassicAssert.IsNotEmpty(secondaryLabelText);
}
[Test]
@ -51,8 +52,7 @@ namespace Microsoft.Maui.AppiumTests
App.DoubleTap("DoubleTapSurface");
var result = App.FindElement("DoubleTapResults").GetText();
Assert.AreEqual("Success", result);
ClassicAssert.AreEqual("Success", result);
}
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class GroupListViewHeaderIndexOutOfRange : _IssuesUITest
{

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class HideSoftInputOnTappedPageTests : _IssuesUITest
{
@ -47,10 +48,10 @@ namespace Microsoft.Maui.AppiumTests.Issues
App.WaitForElement(control);
App.Click(control);
Assert.IsTrue(App.IsFocused(control));
ClassicAssert.IsTrue(App.IsFocused(control));
App.Click("EmptySpace");
Assert.AreEqual(!hideOnTapped, App.IsFocused(control));
ClassicAssert.AreEqual(!hideOnTapped, App.IsFocused(control));
}
finally
{
@ -73,10 +74,10 @@ namespace Microsoft.Maui.AppiumTests.Issues
App.WaitForElement(control);
App.Tap(control);
Assert.True(App.IsKeyboardShown());
ClassicAssert.True(App.IsKeyboardShown());
App.Tap("EmptySpace");
Assert.AreEqual(!hideOnTapped, App.IsKeyboardShown());
ClassicAssert.AreEqual(!hideOnTapped, App.IsKeyboardShown());
}
finally
{
@ -115,14 +116,14 @@ namespace Microsoft.Maui.AppiumTests.Issues
for (int i = 0; i < 2; i++)
{
App.Click("HideKeyboardWhenTappingPage");
Assert.True(App.IsFocused("HideKeyboardWhenTappingPage"));
ClassicAssert.True(App.IsFocused("HideKeyboardWhenTappingPage"));
App.Click("EmptySpace");
Assert.AreEqual(false, App.IsFocused("HideKeyboardWhenTappingPage"));
ClassicAssert.AreEqual(false, App.IsFocused("HideKeyboardWhenTappingPage"));
App.Click("DontHideKeyboardWhenTappingPage");
Assert.True(App.IsFocused("DontHideKeyboardWhenTappingPage"));
ClassicAssert.True(App.IsFocused("DontHideKeyboardWhenTappingPage"));
App.Click("EmptySpace");
Assert.AreEqual(true, App.IsFocused("DontHideKeyboardWhenTappingPage"));
ClassicAssert.AreEqual(true, App.IsFocused("DontHideKeyboardWhenTappingPage"));
}
}
finally
@ -145,14 +146,14 @@ namespace Microsoft.Maui.AppiumTests.Issues
{
App.WaitForElement("HideKeyboardWhenTappingPage");
App.Tap("HideKeyboardWhenTappingPage");
Assert.True(App.IsKeyboardShown());
ClassicAssert.True(App.IsKeyboardShown());
App.Tap("EmptySpace");
Assert.AreEqual(false, App.IsKeyboardShown());
ClassicAssert.AreEqual(false, App.IsKeyboardShown());
App.Tap("DontHideKeyboardWhenTappingPage");
Assert.True(App.IsKeyboardShown());
ClassicAssert.True(App.IsKeyboardShown());
App.Tap("EmptySpace");
Assert.AreEqual(true, App.IsKeyboardShown());
ClassicAssert.AreEqual(true, App.IsKeyboardShown());
}
}
finally

Просмотреть файл

@ -2,7 +2,7 @@ using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues;
namespace Microsoft.Maui.TestCases.Tests.Issues;
public class IsInvokeRequiredRaceCondition : _IssuesUITest
{

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
#if IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue10234 : _IssuesUITest
{
@ -15,8 +16,6 @@ namespace Microsoft.Maui.AppiumTests.Issues
[Test]
public void ScrollCarouselViewAfterDispose()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows });
try
{
_ = App.WaitForElement("GoToTest");
@ -33,7 +32,8 @@ namespace Microsoft.Maui.AppiumTests.Issues
App.Tap("goToBack");
App.WaitForElement("goToShow");
}
finally{
finally
{
Reset();
}
}
@ -44,3 +44,4 @@ namespace Microsoft.Maui.AppiumTests.Issues
}
}
}
#endif

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues;
namespace Microsoft.Maui.TestCases.Tests.Issues;
public class Issue10947 : _IssuesUITest
{
@ -26,13 +27,13 @@ public class Issue10947 : _IssuesUITest
var newHeaderEntry = App.WaitForElement(HeaderEntry);
var newHeaderLocation = headerEntry.GetRect();
Assert.AreEqual(headerLocation, newHeaderLocation);
ClassicAssert.AreEqual(headerLocation, newHeaderLocation);
App.Tap(FooterEntry);
var newFooterEntry = App.WaitForElement(FooterEntry);
var newFooterLocation = headerEntry.GetRect();
Assert.AreEqual(footerLocation, newFooterLocation);
ClassicAssert.AreEqual(footerLocation, newFooterLocation);
}
}

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
#if ANDROID || IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue11501 : _IssuesUITest
{
@ -18,8 +19,6 @@ namespace Microsoft.Maui.AppiumTests.Issues
[TestCase("RemoveAddTabs")]
public void MakingFragmentRelatedChangesWhileAppIsBackgroundedFails(string scenario)
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows });
try
{
App.WaitForElement(scenario);
@ -43,3 +42,4 @@ namespace Microsoft.Maui.AppiumTests.Issues
}
}
}
#endif

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue12211 : _IssuesUITest
{
@ -24,9 +25,9 @@ namespace Microsoft.Maui.AppiumTests.Issues
var secondOpacity = ChangeOpacityAndGetCurrentStatus();
var thirdOpacity = ChangeOpacityAndGetCurrentStatus();
Assert.AreEqual(GetExpectedCurrentOpacityStatus(0.7), initialOpacity);
Assert.AreEqual(GetExpectedCurrentOpacityStatus(1), secondOpacity);
Assert.AreEqual(GetExpectedCurrentOpacityStatus(0), thirdOpacity);
ClassicAssert.AreEqual(GetExpectedCurrentOpacityStatus(0.7), initialOpacity);
ClassicAssert.AreEqual(GetExpectedCurrentOpacityStatus(1), secondOpacity);
ClassicAssert.AreEqual(GetExpectedCurrentOpacityStatus(0), thirdOpacity);
}
string? ChangeOpacityAndGetCurrentStatus()

Просмотреть файл

@ -2,7 +2,7 @@
//using NUnit.Framework;
//using Xamarin.UITest.Queries;
//namespace Microsoft.Maui.AppiumTests.Issues
//namespace Microsoft.Maui.TestCases.Tests.Issues
//{
// public class Issue12567 : _IssuesUITest
// {
@ -13,7 +13,7 @@
// [Test]
// public void WhenQueryingCarouselItemsInViewThenSingleItemIsRetrieved()
// {
// // TODO: Investigate and remove the need for this. Currently all platforms fail the "Assert.AreEqual(10, itemNumber)",
// // TODO: Investigate and remove the need for this. Currently all platforms fail the "ClassicAssert.AreEqual(10, itemNumber)",
// // though failures are a bit different on different platforms.
// Assert.Ignore("WhenQueryingCarouselItemsInViewThenSingleItemIsRetrieved is newly added but fails; need to investigate and fix");
@ -28,7 +28,7 @@
// var itemNumber = GetCurrentItemNumber();
// Assert.AreEqual(10, itemNumber);
// ClassicAssert.AreEqual(10, itemNumber);
// }
// int GetCurrentItemNumber()
@ -43,10 +43,10 @@
// // Get the visible labels in the carousel (should be one if everything is OK)
// var labels = App.FindElement(element => element.Marked("NameLabel")).Where(IsActiveCarouselItem);
// Assert.NotNull(labels);
// ClassicAssert.NotNull(labels);
// Assert.IsNotEmpty(labels);
// //Only one item should be visible at a time in the carousel
// Assert.AreEqual(1, labels.Count());
// ClassicAssert.AreEqual(1, labels.Count());
// }
// //Only the active item in the window should have a size greater than zero

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue14257 : _IssuesUITest
{
@ -26,7 +27,7 @@ namespace Microsoft.Maui.AppiumTests.Issues
App.Tap("Test");
// If we can successfully tap the button, the Success label will be displayed
Assert.IsTrue(App.WaitForTextToBePresentInElement("Result", "Success"));
ClassicAssert.IsTrue(App.WaitForTextToBePresentInElement("Result", "Success"));
}
}
}

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
class Issue14557 : _IssuesUITest
{
@ -18,8 +19,8 @@ namespace Microsoft.Maui.AppiumTests.Issues
var headerText = App.FindElement("headerLabel").GetText();
var footerText = App.FindElement("footerLabel").GetText();
Assert.IsNotEmpty(headerText);
Assert.IsNotEmpty(footerText);
ClassicAssert.IsNotEmpty(headerText);
ClassicAssert.IsNotEmpty(footerText);
}
}
}

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
#if WINDOWS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue14829 : _IssuesUITest
{
@ -16,8 +17,6 @@ namespace Microsoft.Maui.AppiumTests.Issues
[Category(UITestCategories.ActionSheet)]
public void DisplayActionSheetStillNotWorkingOnWindows()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.iOS }, "Only affects Windows.");
App.WaitForElement("DisplayActionSheetButton", timeout: TimeSpan.FromSeconds(4)).Click();
App.WaitForElement("ActionSheetTitle", timeout: TimeSpan.FromSeconds(4));
@ -25,3 +24,4 @@ namespace Microsoft.Maui.AppiumTests.Issues
}
}
}
#endif

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
#if !IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue15330 : _IssuesUITest
{
@ -16,11 +17,11 @@ namespace Microsoft.Maui.AppiumTests.Issues
[Category(UITestCategories.Layout)]
public void Issue15330Test()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS },
"Currently fails on iOS; see https://github.com/dotnet/maui/issues/17125");
// Currently fails on iOS; see https://github.com/dotnet/maui/issues/17125
App.WaitForElement("WaitForStubControl");
VerifyScreenshot();
}
}
}
#endif

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue15357 : _IssuesUITest
{
@ -26,9 +27,9 @@ namespace Microsoft.Maui.AppiumTests.Issues
var thirdStatus = TapButtonAndGetStatus();
await Task.Delay(500);
Assert.AreEqual(GetExpectedButtonStatus(isVisible: true), initialStatus);
Assert.AreEqual(GetExpectedButtonStatus(isVisible: false), secondStatus);
Assert.AreEqual(GetExpectedButtonStatus(isVisible: true), thirdStatus);
ClassicAssert.AreEqual(GetExpectedButtonStatus(isVisible: true), initialStatus);
ClassicAssert.AreEqual(GetExpectedButtonStatus(isVisible: false), secondStatus);
ClassicAssert.AreEqual(GetExpectedButtonStatus(isVisible: true), thirdStatus);
}
string? TapButtonAndGetStatus()

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues;
namespace Microsoft.Maui.TestCases.Tests.Issues;
public class Issue15815 : _IssuesUITest
{
@ -16,6 +17,6 @@ public class Issue15815 : _IssuesUITest
public void LastItemIsVisilbe()
{
var lastItem = App.WaitForElement("id-2");
Assert.AreEqual("Item 2", lastItem.GetText());
ClassicAssert.AreEqual("Item 2", lastItem.GetText());
}
}

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue15826 : _IssuesUITest
{
@ -26,9 +27,9 @@ namespace Microsoft.Maui.AppiumTests.Issues
var thirdStatus = TapButtonAndGetStatus();
await Task.Delay(500);
Assert.AreEqual(GetExpectedListsStatus("List 1"), initialStatus);
Assert.AreEqual(GetExpectedListsStatus("List 2"), secondStatus);
Assert.AreEqual(GetExpectedListsStatus("List 1"), thirdStatus);
ClassicAssert.AreEqual(GetExpectedListsStatus("List 1"), initialStatus);
ClassicAssert.AreEqual(GetExpectedListsStatus("List 2"), secondStatus);
ClassicAssert.AreEqual(GetExpectedListsStatus("List 1"), thirdStatus);
}
string? TapButtonAndGetStatus()

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
#if !MACCATALYST
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16094 : _IssuesUITest
{
@ -16,8 +17,6 @@ namespace Microsoft.Maui.AppiumTests.Issues
[Category(UITestCategories.Editor)]
public void ShadowsDontRespectControlShape()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac });
App.WaitForElement("TestScrollView");
App.ScrollDown("TestScrollView", ScrollStrategy.Gesture);
App.WaitForElement("EditorControl");
@ -25,3 +24,4 @@ namespace Microsoft.Maui.AppiumTests.Issues
}
}
}
#endif

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16320 : _IssuesUITest
{
@ -26,7 +27,7 @@ namespace Microsoft.Maui.AppiumTests.Issues
App.Tap("Add");
Assert.NotNull(App.WaitForElement("item: 1"));
ClassicAssert.NotNull(App.WaitForElement("item: 1"));
}
}
}

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
#if IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16321 : _IssuesUITest
{
@ -18,13 +19,9 @@ namespace Microsoft.Maui.AppiumTests.Issues
[Category(UITestCategories.DisplayAlert)]
public void OpenAlertWithModals(string testCase)
{
this.IgnoreIfPlatforms(new[]
{
TestDevice.Mac, TestDevice.Windows, TestDevice.Android
});
App.WaitForElement(testCase).Tap();
App.WaitForElement("Cancel").Tap();
}
}
}
}
#endif

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
#if ANDROID
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16386 : _IssuesUITest
{
@ -16,12 +17,6 @@ namespace Microsoft.Maui.AppiumTests.Issues
[Category(UITestCategories.Entry)]
public void HittingEnterKeySendsDone()
{
this.IgnoreIfPlatforms(new[]
{
TestDevice.Mac,
TestDevice.Windows
});
App.WaitForElement("HardwareEnterKeyEntry");
App.Tap("HardwareEnterKeyEntry");
App.PressEnter();
@ -29,3 +24,4 @@ namespace Microsoft.Maui.AppiumTests.Issues
}
}
}
#endif

Просмотреть файл

@ -2,7 +2,7 @@
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16499 : _IssuesUITest
{

Просмотреть файл

@ -1,5 +1,6 @@
using System.Drawing;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.iOS;
using OpenQA.Selenium.Appium.Windows;
@ -8,7 +9,7 @@ using UITest.Appium;
using UITest.Core;
using PointerInputDevice = OpenQA.Selenium.Appium.Interactions.PointerInputDevice;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16561 : _IssuesUITest
{
@ -126,8 +127,8 @@ namespace Microsoft.Maui.AppiumTests.Issues
// Turn the text values into numbers so we can compare with a tolerance
(var tapX, var tapY) = ParseCoordinates(tapData);
Assert.AreEqual((double)expectedX, tapX, 1.5, $"{which} tap has unexpected X value");
Assert.AreEqual((double)expectedY, tapY, 1.5, $"{which} tap has unexpected Y value");
ClassicAssert.AreEqual((double)expectedX, tapX, 1.5, $"{which} tap has unexpected X value");
ClassicAssert.AreEqual((double)expectedY, tapY, 1.5, $"{which} tap has unexpected Y value");
}
static (double, double) ParseCoordinates(string text)

Просмотреть файл

@ -1,8 +1,9 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16787 : _IssuesUITest
{
@ -16,7 +17,7 @@ namespace Microsoft.Maui.AppiumTests.Issues
[Category(UITestCategories.CollectionView)]
public void CollectionViewBindingContextOnlyChangesOnce()
{
Assert.AreEqual("1", App.WaitForElement("LabelBindingCount").GetText());
ClassicAssert.AreEqual("1", App.WaitForElement("LabelBindingCount").GetText());
}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше