diff --git a/samples/mdacontrols/MDAControls_1_0_0_4.zip b/samples/mdacontrols/MDAControls_1_0_0_4.zip new file mode 100644 index 000000000..9bdcefbe9 Binary files /dev/null and b/samples/mdacontrols/MDAControls_1_0_0_4.zip differ diff --git a/samples/mdacontrols/README.md b/samples/mdacontrols/README.md new file mode 100644 index 000000000..5c52cf9e2 --- /dev/null +++ b/samples/mdacontrols/README.md @@ -0,0 +1,29 @@ +# Overview + +This sample demonstrates how to use the Power Apps Test Engine to validate the values of controls within a Model-Driven Application (MDA) form. + +## Usage + +1. **Build the Test Engine Solution** + Ensure the Power Apps Test Engine solution is built and ready to be executed. + +2. **Obtain the URL of the MDA Form** + Acquire the URL of the specific Model-Driven Application form that you want to test. + +3. **Select the Appropriate YAML File** + Choose the control's YAML file (e.g., `TextControl_testPlan.fx.yaml`) that corresponds to your application and custom page. + +4. **Update the Domain URL for Your Model-Driven Application** + + | URL Part | Description | + |----------|-------------| + | `appid=a1234567-cccc-44444-9999-a123456789123` | Unique identifier of your Model-Driven Application. | + | `etn=test` | Logical name of the entity being validated. | + | `id=26bafa27-ca7d-ee11-8179-0022482a91f4` | Unique identifier of the record being edited. | + | `pagetype=entityrecord` | Type of page to open. | + +5. **Execute the test for custom page changing the example below to the url of your organization** + +```pwsh +cd bin\Debug\PowerAppsEngine +dotnet PowerAppsTestEngine.dll -i ..\..\..\samples\mda\testPlan.fx.yaml -e 00000000-0000-0000-0000-11112223333 -t 11112222-3333-4444-5555-666677778888 -u browser -p mda -d "https://contoso.crm4.dynamics.com/main.aspx?appid=9e9c25f3-1851-ef11-bfe2-6045bd8f802c&pagetype=custom&name=sample_custom_cf8e6" \ No newline at end of file diff --git a/samples/mdacontrols/TextControl_testPlan.fx.yaml b/samples/mdacontrols/TextControl_testPlan.fx.yaml new file mode 100644 index 000000000..317b5f86b --- /dev/null +++ b/samples/mdacontrols/TextControl_testPlan.fx.yaml @@ -0,0 +1,253 @@ +testSuite: + testSuiteName: Text Control Tests + testSuiteDescription: Verify text control properties + persona: User1 + appLogicalName: NotNeeded + + testCases: + # Design Testing + - testCaseName: Test Text Property + testCaseDescription: Verify that the text can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.Text, "Sample Text"); + Assert(TextControl1.Text = "Sample Text", "Checking the sample text"); + + - testCaseName: Test Size Property + testCaseDescription: Verify that the size of the text can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.Size, 22); + Assert(TextControl1.Size = 22, "Checking the text size"); + + - testCaseName: Test Weight Property + testCaseDescription: Verify that the weight of the text can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.Weight, "Bold"); + Assert(TextControl1.Weight = "Bold", "Checking the text weight"); + + - testCaseName: Test Align Property + testCaseDescription: Verify that the alignment can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.Align, "Center"); + Assert(TextControl1.Align = "Center", "Checking the text alignment"); + + - testCaseName: Test VerticalAlign Property + testCaseDescription: Verify that the vertical alignment can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.VerticalAlign, "Middle"); + Assert(TextControl1.VerticalAlign = "Middle", "Checking the vertical alignment"); + + - testCaseName: Test Font Property + testCaseDescription: Verify that the font can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.Font, "Arial"); + Assert(TextControl1.Font = "Arial", "Checking the font type"); + + - testCaseName: Test BorderThickness Property + testCaseDescription: Verify that the border thickness can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.BorderThickness, 2); + Assert(TextControl1.BorderThickness = 2, "Checking the border thickness"); + + - testCaseName: Test BorderRadiusTopLeft Property + testCaseDescription: Verify that the top-left border radius can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.BorderRadiusTopLeft, 5); + Assert(TextControl1.BorderRadiusTopLeft = 5, "Checking the top-left border radius"); + + - testCaseName: Test BorderRadiusTopRight Property + testCaseDescription: Verify that the top-right border radius can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.BorderRadiusTopRight, 5); + Assert(TextControl1.BorderRadiusTopRight = 5, "Checking the top-right border radius"); + + - testCaseName: Test BorderRadiusBottomRight Property + testCaseDescription: Verify that the bottom-right border radius can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.BorderRadiusBottomRight, 5); + Assert(TextControl1.BorderRadiusBottomRight = 5, "Checking the bottom-right border radius"); + + - testCaseName: Test BorderRadiusBottomLeft Property + testCaseDescription: Verify that the bottom-left border radius can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.BorderRadiusBottomLeft, 5); + Assert(TextControl1.BorderRadiusBottomLeft = 5, "Checking the bottom-left border radius"); + + - testCaseName: Test PaddingTop Property + testCaseDescription: Verify that the top padding can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.PaddingTop, 10); + Assert(TextControl1.PaddingTop = 10, "Checking the top padding"); + + - testCaseName: Test PaddingRight Property + testCaseDescription: Verify that the right padding can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.PaddingRight, 10); + Assert(TextControl1.PaddingRight = 10, "Checking the right padding"); + + - testCaseName: Test PaddingBottom Property + testCaseDescription: Verify that the bottom padding can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.PaddingBottom, 10); + Assert(TextControl1.PaddingBottom = 10, "Checking the bottom padding"); + + - testCaseName: Test PaddingLeft Property + testCaseDescription: Verify that the left padding can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.PaddingLeft, 10); + Assert(TextControl1.PaddingLeft = 10, "Checking the left padding"); + + - testCaseName: Test Fill Property + testCaseDescription: Verify that the fill color can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.Fill, "#FFFFFF"); + Assert(TextControl1.Fill = "#FFFFFF", "Checking the fill color"); + + - testCaseName: Test BorderStyle Property + testCaseDescription: Verify that the border style can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.BorderStyle, "Solid"); + Assert(TextControl1.BorderStyle = "Solid", "Checking the border style"); + + - testCaseName: Test BorderColor Property + testCaseDescription: Verify that the border color can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl1.BorderColor, "#000000"); + Assert(TextControl1.BorderColor = "#000000", "Checking the border color"); + + # Functional Testing + - testCaseName: Test ContentLanguage Property + testCaseDescription: Verify that the content language can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl2.ContentLanguage, "en-US"); + Assert(TextControl2.ContentLanguage = "en-US", "Checking the content language"); + + - testCaseName: Test Height Property + testCaseDescription: Verify that the height can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl2.Height, 100); + Assert(TextControl2.Height = 100, "Checking the height"); + + - testCaseName: Test TabIndex Property + testCaseDescription: Verify that the tab index can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl2.TabIndex, 1); + Assert(TextControl2.TabIndex = 1, "Checking the tab index"); + + - testCaseName: Test Tooltip Property + testCaseDescription: Verify that the tooltip can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl3.Tooltip, "Sample Tooltip"); + Assert(TextControl3.Tooltip = "Sample Tooltip", "Checking the tooltip"); + + - testCaseName: Test PCFTeamsTheme Property + testCaseDescription: Verify that the PCF Teams Theme can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl3.PCFTeamsTheme, "Dark"); + Assert(TextControl3.PCFTeamsTheme = "Dark", "Checking the PCF Teams Theme"); + + - testCaseName: Test X Position Property + testCaseDescription: Verify that the X position can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl3.X, 50); + Assert(TextControl3.X = 50, "Checking the X position"); + + - testCaseName: Test Y Position Property + testCaseDescription: Verify that the Y position can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl3.Y, 50); + Assert(TextControl3.Y = 50, "Checking the Y position"); + + - testCaseName: Test Width Property + testCaseDescription: Verify that the width can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl4.Width, 300); + Assert(TextControl4.Width = 300, "Checking the width"); + + - testCaseName: Test Visible Property + testCaseDescription: Verify that the visibility can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl5.Visible, true); + Assert(TextControl5.Visible = true, "Checking visibility"); + + - testCaseName: Test DisplayMode Property + testCaseDescription: Verify that the display mode can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl5.DisplayMode, "Edit"); + Assert(TextControl5.DisplayMode = "Edit", "Checking the display mode"); + + - testCaseName: Test ZIndex Property + testCaseDescription: Verify that the Z-Index can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl5.ZIndex, 2); + Assert(TextControl5.ZIndex = 2, "Checking the Z-Index"); + + - testCaseName: Test AutoHeight Property + testCaseDescription: Verify that the auto height can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl5.AutoHeight, true); + Assert(TextControl5.AutoHeight = true, "Checking auto height"); + + - testCaseName: Test FontColor Property + testCaseDescription: Verify that the font color can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl6.FontColor, "#FF0000"); + Assert(TextControl6.FontColor = "#FF0000", "Checking the font color"); + + - testCaseName: Test FontItalic Property + testCaseDescription: Verify that the italic style can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl6.FontItalic, true); + Assert(TextControl6.FontItalic = true, "Checking italic style"); + + - testCaseName: Test FontStrikethrough Property + testCaseDescription: Verify that the strikethrough style can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl6.FontStrikethrough, false); + Assert(TextControl6.FontStrikethrough = false, "Checking strikethrough style"); + + - testCaseName: Test FontUnderline Property + testCaseDescription: Verify that the underline style can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl6.FontUnderline, true); + Assert(TextControl6.FontUnderline = true, "Checking underline style"); + + - testCaseName: Test Wrap Property + testCaseDescription: Verify that the wrap text property can be set and retrieved correctly. + testSteps: | + SetProperty(TextControl6.Wrap, true); + Assert(TextControl6.Wrap = true, "Checking wrap text property"); + + # Negative Testing + - testCaseName: Test Invalid FontColor Property + testCaseDescription: Verify system behavior when setting an invalid font color. + testSteps: | + SetProperty(TextControl7.FontColor, "invalid_color"); + Assert(TextControl7.FontColor != "invalid_color", "Ensuring invalid font color is not accepted"); + + - testCaseName: Test Invalid Tooltip Property + testCaseDescription: Verify system behavior when setting an invalid tooltip. + testSteps: | + SetProperty(TextControl9.Tooltip, 12345); + Assert(TextControl9.Tooltip != 12345, "Ensuring non-string values are not accepted for tooltip"); + + - testCaseName: Test Invalid Text Property + testCaseDescription: Verify system behavior when setting an invalid text value. + testSteps: | + SetProperty(TextControl10.Text, 12345); + Assert(TextControl10.Text = "", "Text property should be empty if an invalid value is provided"); + +testSettings: + headless: false + locale: "en-US" + recordVideo: true + extensionModules: + enable: true + browserConfigurations: + - browser: Chromium + channel: msedge + +environmentVariables: + users: + - personaName: User1 + emailKey: user1Email + passwordKey: NotNeeded \ No newline at end of file diff --git a/samples/mdacontrols/TextInputControl_testPlan.fx.yaml b/samples/mdacontrols/TextInputControl_testPlan.fx.yaml new file mode 100644 index 000000000..4065fea9e --- /dev/null +++ b/samples/mdacontrols/TextInputControl_testPlan.fx.yaml @@ -0,0 +1,205 @@ +testSuite: + testSuiteName: Text Input Controls Test Suite + testSuiteDescription: Verify text input controls' design, functional, and negative scenarios. + persona: User1 + appLogicalName: NotNeeded + + testCases: + # Design Testing + - testCaseName: Test Value Property for TextInput1 + testCaseDescription: Verify that the value can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.Value, "Sample Text"); + Assert(TextInput1.Value = "Sample Text", "Checking the value for TextInput1"); + + - testCaseName: Test FontSize Property for TextInput1 + testCaseDescription: Verify that the font size can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.FontSize, 22); + Assert(TextInput1.FontSize = 22, "Checking the font size for TextInput1"); + + - testCaseName: Test FontWeight Property for TextInput1 + testCaseDescription: Verify that the font weight can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.FontWeight, "Bold"); + Assert(TextInput1.FontWeight = "Bold", "Checking the font weight for TextInput1"); + + - testCaseName: Test TextAlign Property for TextInput1 + testCaseDescription: Verify that the text alignment can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.TextAlign, "Center"); + Assert(TextInput1.TextAlign = "Center", "Checking the text alignment"); + + - testCaseName: Test VerticalAlignment Property for TextInput1 + testCaseDescription: Verify that the vertical alignment can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.VerticalAlignment, "Middle"); + Assert(TextInput1.VerticalAlignment = "Middle", "Checking the vertical alignment"); + + - testCaseName: Test FontFamily Property for TextInput1 + testCaseDescription: Verify that the font family can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.FontFamily, "Arial"); + Assert(TextInput1.FontFamily = "Arial", "Checking the font family"); + + - testCaseName: Test BorderThickness Property for TextInput1 + testCaseDescription: Verify that the border thickness can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.BorderThickness, 2); + Assert(TextInput1.BorderThickness = 2, "Checking the border thickness for TextInput1"); + + - testCaseName: Test CornerRadius Properties for TextInput1 + testCaseDescription: Verify that all corner radius properties can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.CornerRadiusTopLeft, 5); + Assert(TextInput1.CornerRadiusTopLeft = 5, "Checking the top-left corner radius for TextInput1"); + SetProperty(TextInput1.CornerRadiusTopRight, 5); + Assert(TextInput1.CornerRadiusTopRight = 5, "Checking the top-right corner radius for TextInput1"); + SetProperty(TextInput1.CornerRadiusBottomRight, 5); + Assert(TextInput1.CornerRadiusBottomRight = 5, "Checking the bottom-right corner radius for TextInput1"); + SetProperty(TextInput1.CornerRadiusBottomLeft, 5); + Assert(TextInput1.CornerRadiusBottomLeft = 5, "Checking the bottom-left corner radius for TextInput1"); + + - testCaseName: Test Padding Properties for TextInput1 + testCaseDescription: Verify that all padding properties can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.PaddingTop, 10); + Assert(TextInput1.PaddingTop = 10, "Checking the top padding for TextInput1"); + SetProperty(TextInput1.PaddingRight, 10); + Assert(TextInput1.PaddingRight = 10, "Checking the right padding for TextInput1"); + SetProperty(TextInput1.PaddingBottom, 10); + Assert(TextInput1.PaddingBottom = 10, "Checking the bottom padding for TextInput1"); + SetProperty(TextInput1.PaddingLeft, 10); + Assert(TextInput1.PaddingLeft = 10, "Checking the left padding for TextInput1"); + + - testCaseName: Test BackgroundColor Property for TextInput1 + testCaseDescription: Verify that the background color can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.BackgroundColor, "#FFFFFF"); + Assert(TextInput1.BackgroundColor = "#FFFFFF", "Checking the background color for TextInput1"); + + - testCaseName: Test BorderStyle Property for TextInput1 + testCaseDescription: Verify that the border style can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.BorderStyle, "Solid"); + Assert(TextInput1.BorderStyle = "Solid", "Checking the border style for TextInput1"); + + - testCaseName: Test BorderColor Property for TextInput1 + testCaseDescription: Verify that the border color can be set and retrieved correctly for TextInput1. + testSteps: | + SetProperty(TextInput1.BorderColor, "#000000"); + Assert(TextInput1.BorderColor = "#000000", "Checking the border color for TextInput1"); + + # Functional Testing + - testCaseName: Test Height Property for TextInput2 + testCaseDescription: Verify that the height can be set and retrieved correctly for TextInput2. + testSteps: | + SetProperty(TextInput2.Height, 100); + Assert(TextInput2.Height = 100, "Checking the height for TextInput2"); + + - testCaseName: Test TabIndex Property for TextInput3 + testCaseDescription: Verify that the tab index can be set and retrieved correctly for TextInput3. + testSteps: | + SetProperty(TextInput3.TabIndex, 1); + Assert(TextInput3.TabIndex = 1, "Checking the tab index for TextInput3"); + + - testCaseName: Test Tooltip Property for TextInput4 + testCaseDescription: Verify that the tooltip can be set and retrieved correctly for TextInput4. + testSteps: | + SetProperty(TextInput4.Tooltip, "Sample Tooltip"); + Assert(TextInput4.Tooltip = "Sample Tooltip", "Checking the tooltip for TextInput4"); + + - testCaseName: Test PCFTeamsTheme Property for TextInput5 + testCaseDescription: Verify that the PCF Teams Theme can be set and retrieved correctly for TextInput5. + testSteps: | + SetProperty(TextInput5.PCFTeamsTheme, "Dark"); + Assert(TextInput5.PCFTeamsTheme = "Dark", "Checking the PCF Teams Theme for TextInput5"); + + - testCaseName: Test X Position Property for TextInput6 + testCaseDescription: Verify that the X position can be set and retrieved correctly for TextInput6. + testSteps: | + SetProperty(TextInput6.X, 50); + Assert(TextInput6.X = 50, "Checking the X position for TextInput6"); + + - testCaseName: Test Y Position Property for TextInput7 + testCaseDescription: Verify that the Y position can be set and retrieved correctly for TextInput7. + testSteps: | + SetProperty(TextInput7.Y, 50); + Assert(TextInput7.Y = 50, "Checking the Y position for TextInput7"); + + - testCaseName: Test Width Property for TextInput8 + testCaseDescription: Verify that the width can be set and retrieved correctly for TextInput8. + testSteps: | + SetProperty(TextInput8.Width, 200); + Assert(TextInput8.Width = 200, "Checking the width for TextInput8"); + + - testCaseName: Test Visible Property for TextInput9 + testCaseDescription: Verify that the visibility can be set and retrieved correctly for TextInput9. + testSteps: | + SetProperty(TextInput9.Visible, true); + Assert(TextInput9.Visible = true, "Checking the visibility for TextInput9"); + + - testCaseName: Test DisplayMode Property for TextInput10 + testCaseDescription: Verify that the display mode can be set and retrieved correctly for TextInput10. + testSteps: | + SetProperty(TextInput10.DisplayMode, "Edit"); + Assert(TextInput10.DisplayMode = "Edit", "Checking the display mode for TextInput10"); + + # Negative Testing + - testCaseName: Test Invalid Text Property for TextInput4 + testCaseDescription: Verify system behavior when setting an invalid text property for TextInput4. + testSteps: | + SetProperty(TextInput4.Text, 67890); + Assert(TextInput4.Text = "", "Ensuring invalid text values are handled correctly for TextInput4"); + + - testCaseName: Test Invalid Height Property for TextInput5 + testCaseDescription: Verify system behavior when setting an invalid height value (negative) for TextInput5. + testSteps: | + SetProperty(TextInput5.Height, -10); + Assert(TextInput5.Height = 0, "Ensuring negative height values are not accepted for TextInput5"); + + - testCaseName: Test Invalid Width Property for TextInput6 + testCaseDescription: Verify system behavior when setting an invalid width for TextInput6. + testSteps: | + SetProperty(TextInput6.Width, -20); + Assert(TextInput6.Width = 0, "Ensuring negative width values are not accepted for TextInput6"); + + - testCaseName: Test Invalid X Position Property for TextInput7 + testCaseDescription: Verify system behavior when setting an invalid X position for TextInput7. + testSteps: | + SetProperty(TextInput7.X, "10"); + Assert(TextInput7.X = 0, "Ensuring non-numeric X position values are not accepted for TextInput7"); + + - testCaseName: Test Invalid Y Position Property for TextInput8 + testCaseDescription: Verify system behavior when setting an invalid Y position for TextInput8. + testSteps: | + SetProperty(TextInput8.Y, "20"); + Assert(TextInput8.Y = 0, "Ensuring non-numeric Y position values are not accepted for TextInput8"); + + - testCaseName: Test Invalid DisplayMode Property for TextInput9 + testCaseDescription: Verify system behavior when setting an invalid display mode for TextInput9. + testSteps: | + SetProperty(TextInput9.DisplayMode, "InvalidMode"); + Assert(TextInput9.DisplayMode = "InvalidMode", "Ensuring invalid display modes are not accepted for TextInput9"); + + - testCaseName: Test Invalid Visible Property for TextInput10 + testCaseDescription: Verify system behavior when setting an invalid visible property for TextInput10. + testSteps: | + SetProperty(TextInput10.Visible, true); + Assert(TextInput10.Visible = true, "Ensuring non-boolean values are not accepted for visible property for TextInput10"); + +testSettings: + headless: false + locale: "en-US" + recordVideo: true + extensionModules: + enable: true + browserConfigurations: + - browser: Chromium + channel: msedge + +environmentVariables: + users: + - personaName: User1 + emailKey: user1Email + passwordKey: NotNeeded \ No newline at end of file