-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Implemented Material3 support for Image #33661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6a15a0c
Implemented material3 support for image control
Dhivya-SF4094 115dfd2
Updated MaterialImageHandler.cs
Dhivya-SF4094 8e383b2
Refactored file names and optimized implementation
Dhivya-SF4094 b6627d5
Addressed the review concern
Dhivya-SF4094 59e3e1e
Added test case and snapshots
Dhivya-SF4094 92403df
Merge branch 'inflight/current' into material_Image
kubaflo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+263 KB
...Tests/snapshots/android-notch-36/VerifyMaterial3FontImageWithFontColorGreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.1 KB
...droid.Tests/snapshots/android-notch-36/VerifyMaterial3FontImageWithFontSize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+521 KB
...pshots/android-notch-36/VerifyMaterial3ImageAspect_AspectFillWithFileSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+226 KB
...s/android-notch-36/VerifyMaterial3ImageAspect_AspectFillWithFontImageSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.1 KB
...hots/android-notch-36/VerifyMaterial3ImageAspect_AspectFillWithStreamSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.88 MB
...apshots/android-notch-36/VerifyMaterial3ImageAspect_AspectFillWithUriSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+413 KB
...apshots/android-notch-36/VerifyMaterial3ImageAspect_AspectFitWithFileSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+201 KB
...ts/android-notch-36/VerifyMaterial3ImageAspect_AspectFitWithFontImageSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.9 KB
...shots/android-notch-36/VerifyMaterial3ImageAspect_AspectFitWithStreamSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.02 MB
...napshots/android-notch-36/VerifyMaterial3ImageAspect_AspectFitWithUriSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+156 KB
.../snapshots/android-notch-36/VerifyMaterial3ImageAspect_CenterWithFileSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.8 KB
...shots/android-notch-36/VerifyMaterial3ImageAspect_CenterWithFontImageSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.1 KB
...napshots/android-notch-36/VerifyMaterial3ImageAspect_CenterWithStreamSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.88 MB
...s/snapshots/android-notch-36/VerifyMaterial3ImageAspect_CenterWithUriSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+523 KB
...ts/snapshots/android-notch-36/VerifyMaterial3ImageAspect_FillWithFileSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+243 KB
...apshots/android-notch-36/VerifyMaterial3ImageAspect_FillWithFontImageSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.4 KB
.../snapshots/android-notch-36/VerifyMaterial3ImageAspect_FillWithStreamSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.31 MB
...sts/snapshots/android-notch-36/VerifyMaterial3ImageAspect_FillWithUriSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+413 KB
...droid.Tests/snapshots/android-notch-36/VerifyMaterial3ImageFlowDirectionRTL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+417 KB
...ses.Android.Tests/snapshots/android-notch-36/VerifyMaterial3ImageWithShadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
356 changes: 356 additions & 0 deletions
356
src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/Material3ImageFeatureTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,356 @@ | ||
| #if ANDROID | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests; | ||
|
|
||
| public class Material3ImageFeatureTests : _GalleryUITest | ||
| { | ||
| public const string ImageFeatureMatrix = "Image Feature Matrix"; | ||
| public const string Options = "Options"; | ||
| public const string Apply = "Apply"; | ||
| public const string ImageAspectFit = "ImageAspectFit"; | ||
| public const string ImageAspectFill = "ImageAspectFill"; | ||
| public const string ImageFill = "ImageFill"; | ||
| public const string ImageCenter = "ImageCenter"; | ||
| public const string SourceTypeFile = "SourceTypeFile"; | ||
| public const string SourceTypeFontImage = "SourceTypeFontImage"; | ||
| public const string SourceTypeStream = "SourceTypeStream"; | ||
| public const string SourceTypeUri = "SourceTypeUri"; | ||
| public const string IsVisibleFalseRadio = "IsVisibleFalseRadio"; | ||
| public const string FlowDirectionRTL = "FlowDirectionRTL"; | ||
| public const string ShadowCheckBox = "ShadowCheckBox"; | ||
| public const string IsAnimationTrue = "IsAnimationTrue"; | ||
| public const string IsAnimationFalse = "IsAnimationFalse"; | ||
|
|
||
| public override string GalleryPageName => ImageFeatureMatrix; | ||
|
|
||
| public Material3ImageFeatureTests(TestDevice device) | ||
| : base(device) | ||
| { | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFitWithFileSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFit); | ||
| App.Tap(ImageAspectFit); | ||
| App.WaitForElement(SourceTypeFile); | ||
| App.Tap(SourceTypeFile); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFitWithUriSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFit); | ||
| App.Tap(ImageAspectFit); | ||
| App.WaitForElement(SourceTypeUri); | ||
| App.Tap(SourceTypeUri); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFitWithStreamSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFit); | ||
| App.Tap(ImageAspectFit); | ||
| App.WaitForElement(SourceTypeStream); | ||
| App.Tap(SourceTypeStream); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFitWithFontImageSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFit); | ||
| App.Tap(ImageAspectFit); | ||
| App.WaitForElement(SourceTypeFontImage); | ||
| App.Tap(SourceTypeFontImage); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFillWithFileSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFill); | ||
| App.Tap(ImageAspectFill); | ||
| App.WaitForElement(SourceTypeFile); | ||
| App.Tap(SourceTypeFile); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFillWithUriSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFill); | ||
| App.Tap(ImageAspectFill); | ||
| App.WaitForElement(SourceTypeUri); | ||
| App.Tap(SourceTypeUri); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFillWithStreamSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFill); | ||
| App.Tap(ImageAspectFill); | ||
| App.WaitForElement(SourceTypeStream); | ||
| App.Tap(SourceTypeStream); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_AspectFillWithFontImageSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageAspectFill); | ||
| App.Tap(ImageAspectFill); | ||
| App.WaitForElement(SourceTypeFontImage); | ||
| App.Tap(SourceTypeFontImage); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_FillWithFileSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageFill); | ||
| App.Tap(ImageFill); | ||
| App.WaitForElement(SourceTypeFile); | ||
| App.Tap(SourceTypeFile); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_FillWithUriSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageFill); | ||
| App.Tap(ImageFill); | ||
| App.WaitForElement(SourceTypeUri); | ||
| App.Tap(SourceTypeUri); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_FillWithStreamSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageFill); | ||
| App.Tap(ImageFill); | ||
| App.WaitForElement(SourceTypeStream); | ||
| App.Tap(SourceTypeStream); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_FillWithFontImageSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageFill); | ||
| App.Tap(ImageFill); | ||
| App.WaitForElement(SourceTypeFontImage); | ||
| App.Tap(SourceTypeFontImage); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_CenterWithFileSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageCenter); | ||
| App.Tap(ImageCenter); | ||
| App.WaitForElement(SourceTypeFile); | ||
| App.Tap(SourceTypeFile); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_CenterWithUriSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageCenter); | ||
| App.Tap(ImageCenter); | ||
| App.WaitForElement(SourceTypeUri); | ||
| App.Tap(SourceTypeUri); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl", timeout: TimeSpan.FromSeconds(3)); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_CenterWithStreamSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageCenter); | ||
| App.Tap(ImageCenter); | ||
| App.WaitForElement(SourceTypeStream); | ||
| App.Tap(SourceTypeStream); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageAspect_CenterWithFontImageSource() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(ImageCenter); | ||
| App.Tap(ImageCenter); | ||
| App.WaitForElement(SourceTypeFontImage); | ||
| App.Tap(SourceTypeFontImage); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3FontImageWithFontColorGreen() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(SourceTypeFontImage); | ||
| App.Tap(SourceTypeFontImage); | ||
| App.WaitForElement("FontColorGreen"); | ||
| App.Tap("FontColorGreen"); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3FontImageWithFontSize() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(SourceTypeFontImage); | ||
| App.Tap(SourceTypeFontImage); | ||
| App.WaitForElement("EntryFontSize"); | ||
| App.ClearText("EntryFontSize"); | ||
| App.Tap("EntryFontSize"); | ||
| App.EnterText("EntryFontSize", "100"); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageWithShadow() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(SourceTypeFile); | ||
| App.Tap(SourceTypeFile); | ||
| App.WaitForElement(ShadowCheckBox); | ||
| App.Tap(ShadowCheckBox); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Material3)] | ||
| public void VerifyMaterial3ImageFlowDirectionRTL() | ||
| { | ||
| App.WaitForElement(Options); | ||
| App.Tap(Options); | ||
| App.WaitForElement(SourceTypeFile); | ||
| App.Tap(SourceTypeFile); | ||
| App.WaitForElement(FlowDirectionRTL); | ||
| App.Tap(FlowDirectionRTL); | ||
| App.WaitForElement(Apply); | ||
| App.Tap(Apply); | ||
| App.WaitForElement("ImageControl"); | ||
| VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)); | ||
| } | ||
| } | ||
| #endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.