diff --git a/build/ios-uitest-run.sh b/build/ios-uitest-run.sh index 6bb53b2c4a41..8b5549551e95 100755 --- a/build/ios-uitest-run.sh +++ b/build/ios-uitest-run.sh @@ -45,7 +45,7 @@ else namespace = 'SamplesApp.UITests.Windows_UI_Xaml_Controls.PivotTests' or \ namespace = 'SamplesApp.UITests.Windows_UI_Xaml_Controls.CommandBarTests' or \ namespace = 'SamplesApp.UITests.Windows_UI_Xaml_Controls.ComboBoxTests' or \ - namespace = 'SamplesApp.UITests.Windows_UI_Xaml_Media_Animation.DoubleAnimation_Tests' or \ + namespace = 'SamplesApp.UITests.Windows_UI_Xaml_Media_Animation' or \ namespace = 'SamplesApp.UITests.Windows_UI_Xaml_Controls.BorderTests' " fi diff --git a/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Media_Animation/ColorAnimation_Tests.cs b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Media_Animation/ColorAnimation_Tests.cs new file mode 100644 index 000000000000..8ca605430875 --- /dev/null +++ b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Media_Animation/ColorAnimation_Tests.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; +using SamplesApp.UITests.TestFramework; +using Uno.UITest.Helpers.Queries; + +namespace SamplesApp.UITests.Windows_UI_Xaml_Media_Animation +{ + [TestFixture] + public class ColorAnimation_Tests : SampleControlUITestBase + { + [Test] + [AutoRetry] + [ActivePlatforms(Platform.Android, Platform.Browser)] // Disabled for iOS because HasColor() behaves strangely: https://github.com/unoplatform/uno/issues/1955 + public void When_Border_Background_Animated() + { + Run("UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background"); + + _app.WaitForElement("PlayColorAnimation"); + + _app.FastTap("BrushEqualityButton"); + + _app.WaitForText("BrushEqualityText", "true"); + + _app.FastTap("PlayColorAnimation"); + + _app.WaitForText("StatusText", "Completed"); + + _app.FastTap("BrushEqualityButton"); + + _app.WaitForText("BrushEqualityText", "false"); + + var targetRect = _app.GetRect("TargetBorder"); + + var indepRect = _app.GetRect("IndependentBorder"); + + var bmp = _app.Screenshot("Completed"); + + ImageAssert.HasColorAt(bmp, targetRect.CenterX, targetRect.CenterY, Color.Red); + + ImageAssert.HasColorAt(bmp, indepRect.CenterX, indepRect.CenterY, Color.Blue); //Shared resource shouldn't be modified + } + + [Test] + [AutoRetry] + [ActivePlatforms(Platform.Android, Platform.Browser)] // Disabled for iOS because HasColor() behaves strangely: https://github.com/unoplatform/uno/issues/1955 + public void When_Rectangle_Fill_Animated() + { + Run("UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Fill"); + + _app.WaitForElement("PlayColorAnimation"); + + _app.FastTap("PlayColorAnimation"); + + _app.WaitForText("StatusText", "Completed"); + + var targetRect = _app.GetRect("TargetRectangle"); + + var bmp = _app.Screenshot("Completed"); + + ImageAssert.HasColorAt(bmp, targetRect.CenterX, targetRect.CenterY, Color.Brown); + } + } +} diff --git a/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Media_Animation/DoubleAnimation_Tests.FinalState_Opacity.cs b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Media_Animation/DoubleAnimation_Tests.FinalState_Opacity.cs index 621b41dfa40e..d0fc58c4d192 100644 --- a/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Media_Animation/DoubleAnimation_Tests.FinalState_Opacity.cs +++ b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Media_Animation/DoubleAnimation_Tests.FinalState_Opacity.cs @@ -14,6 +14,7 @@ namespace SamplesApp.UITests.Windows_UI_Xaml_Media_Animation { [TestFixture] + [ActivePlatforms(Platform.Android, Platform.Browser)] // Disabled for iOS: https://github.com/unoplatform/uno/issues/1955 public partial class DoubleAnimation_Tests : SampleControlUITestBase { private const string _finalStateOpacityTestControl = "UITests.Windows_UI_Xaml_Media_Animation.DoubleAnimation_FinalState_Opacity"; diff --git a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems index 37407f43ff8e..12ea99ffd0a2 100644 --- a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems +++ b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems @@ -2573,6 +2573,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -4436,6 +4444,12 @@ RoutedEvent_TappedControl.xaml + + ColorAnimation_Background.xaml + + + ColorAnimation_Fill.xaml + DoubleAnimation_FinalState_Opacity.xaml diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media_Animation/ColorAnimation_Background.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media_Animation/ColorAnimation_Background.xaml new file mode 100644 index 000000000000..b37721dd2851 --- /dev/null +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media_Animation/ColorAnimation_Background.xaml @@ -0,0 +1,48 @@ + + + + + + + + + +