Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Sample App Initial Commit #364

Open
wants to merge 7 commits into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added samples/mdacontrols/MDAControls_1_0_0_4.zip
Binary file not shown.
29 changes: 29 additions & 0 deletions samples/mdacontrols/README.md
Original file line number Diff line number Diff line change
@@ -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"
253 changes: 253 additions & 0 deletions samples/mdacontrols/TextControl_testPlan.fx.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading