Skip to content

Commit 71e06ac

Browse files
authored
[Feature]: Enable PowerApps MDA Stream Control for Custom Pages with … (#590)
* [Feature]: Enable PowerApps MDA Stream Control for Custom Pages with Test Engine Support * removed urls * changed the provider
1 parent 1e2e846 commit 71e06ac

5 files changed

Lines changed: 177 additions & 0 deletions

File tree

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
testSuite:
2+
testSuiteName: Stream Control Tests
3+
testSuiteDescription: Verify stream control functionality in PowerApps
4+
persona: User1
5+
appLogicalName: NotNeeded
6+
7+
testCases:
8+
- testCaseName: Verify StreamUrl Property
9+
testCaseDescription: Verify that the StreamUrl property is set and retrieved correctly.
10+
testSteps: |
11+
SetProperty(StreamVideo1.StreamUrl, "URL");
12+
Assert(StreamVideo1.StreamUrl = "URL");
13+
14+
- testCaseName: Verify Autoplay Property
15+
testCaseDescription: Verify that the Autoplay property is set and retrieved correctly.
16+
testSteps: |
17+
SetProperty(StreamVideo1.Autoplay, true);
18+
Assert(StreamVideo1.Autoplay = true, "Expected StreamVideo1.Autoplay to be true");
19+
20+
- testCaseName: Verify ShowTitle Property
21+
testCaseDescription: Verify that the ShowTitle property is set and retrieved correctly.
22+
testSteps: |
23+
SetProperty(StreamVideo1.ShowTitle, false);
24+
Assert(StreamVideo1.ShowTitle = false, "Expected StreamVideo1.ShowTitle to be false");
25+
26+
- testCaseName: Verify StartTime Property
27+
testCaseDescription: Verify that the StartTime property is set and retrieved correctly.
28+
testSteps: |
29+
SetProperty(StreamVideo1.StartTime, 10);
30+
Assert(StreamVideo1.StartTime = 10, "Expected StreamVideo1.StartTime to be 10");
31+
32+
- testCaseName: Verify ContentLanguage Property
33+
testCaseDescription: Verify that the ContentLanguage property is set and retrieved correctly.
34+
testSteps: |
35+
SetProperty(StreamVideo1.ContentLanguage, "en-US");
36+
Assert(StreamVideo1.ContentLanguage = "en-US", "Expected StreamVideo1.ContentLanguage to be 'en-US'");
37+
38+
- testCaseName: Verify TabIndex Property
39+
testCaseDescription: Verify that the TabIndex property is set and retrieved correctly.
40+
testSteps: |
41+
SetProperty(StreamVideo1.TabIndex, 1);
42+
Assert(StreamVideo1.TabIndex = 1, "Expected StreamVideo1.TabIndex to be 1");
43+
44+
- testCaseName: Verify Tooltip Property
45+
testCaseDescription: Verify that the Tooltip property is set and retrieved correctly.
46+
testSteps: |
47+
SetProperty(StreamVideo1.Tooltip, "Stream Video Tooltip");
48+
Assert(StreamVideo1.Tooltip = "Stream Video Tooltip", "Expected StreamVideo1.Tooltip to be 'Stream Video Tooltip'");
49+
50+
- testCaseName: Verify DisplayMode Property
51+
testCaseDescription: Verify that the DisplayMode property is set and retrieved correctly.
52+
testSteps: |
53+
SetProperty(StreamVideo1.DisplayMode, "Edit");
54+
Assert(StreamVideo1.DisplayMode = "Edit", "Expected StreamVideo1.DisplayMode to be 'Edit'");
55+
56+
- testCaseName: Verify X Position Property
57+
testCaseDescription: Verify that the X position is set and retrieved correctly.
58+
testSteps: |
59+
SetProperty(StreamVideo1.X, 100);
60+
Assert(StreamVideo1.X = 100, "Expected StreamVideo1.X to be 100");
61+
62+
- testCaseName: Verify Y Position Property
63+
testCaseDescription: Verify that the Y position is set and retrieved correctly.
64+
testSteps: |
65+
SetProperty(StreamVideo1.Y, 200);
66+
Assert(StreamVideo1.Y = 200, "Expected StreamVideo1.Y to be 200");
67+
68+
- testCaseName: Verify Width Property
69+
testCaseDescription: Verify that the Width property is set and retrieved correctly.
70+
testSteps: |
71+
SetProperty(StreamVideo1.Width, 1280);
72+
Assert(StreamVideo1.Width = 1280, "Expected StreamVideo1.Width to be 1280");
73+
74+
- testCaseName: Verify Height Property
75+
testCaseDescription: Verify that the Height property is set and retrieved correctly.
76+
testSteps: |
77+
SetProperty(StreamVideo1.Height, 720);
78+
Assert(StreamVideo1.Height = 720, "Expected StreamVideo1.Height to be 720");
79+
80+
- testCaseName: Verify Visible Property
81+
testCaseDescription: Verify that the Visible property is set and retrieved correctly.
82+
testSteps: |
83+
SetProperty(StreamVideo1.Visible, true);
84+
Assert(StreamVideo1.Visible = true, "Expected StreamVideo1.Visible to be true");
85+
86+
- testCaseName: Verify ZIndex Property
87+
testCaseDescription: Verify that the ZIndex property is set and retrieved correctly.
88+
testSteps: |
89+
SetProperty(StreamVideo1.ZIndex, 5);
90+
Assert(StreamVideo1.ZIndex = 5, "Expected StreamVideo1.ZIndex to be 5");
91+
92+
testSettings:
93+
headless: false
94+
locale: "en-US"
95+
recordVideo: true
96+
extensionModules:
97+
enable: true
98+
browserConfigurations:
99+
- browser: Chromium
100+
channel: msedge
101+
timeout: 600000
102+
103+
environmentVariables:
104+
users:
105+
- personaName: User1
106+
emailKey: user1Email
107+
passwordKey: NotNeeded
108+
57.7 KB
Binary file not shown.

samples/mdastreamcontrol/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
# Overview
3+
4+
This Power Apps Test Engine sample demonstrates how to assert and interact with the values of stream control in a model-driven application form.
5+
6+
## Usage
7+
8+
1. **Build the Test Engine Solution**
9+
Ensure the Power Apps Test Engine solution is built and ready to be executed.
10+
11+
2. **Get the URL of the Model-Driven Application Form**
12+
Acquire the URL of the specific Model-Driven Application form that you want to test.
13+
14+
3. **Modify the StreamControl_testPlan.fx.yaml**
15+
Update the YAML file to assert expected values of the stream controls.
16+
17+
> [!NOTE] The controls are referenced using the logical name.
18+
19+
4. **Update the Domain URL for Your Model-Driven Application**
20+
21+
| URL Part | Description |
22+
|----------|-------------|
23+
| `appid=572ada03-15cc-ef11-a72e-000d3a12b0cb` | The unique identifier of your model-driven application. |
24+
| `etn=stream` | The name of the entity being validated. |
25+
| `id=26bafa27-ca7d-ee11-8179-0022482a91f4` | The unique identifier of the record being edited. |
26+
| `pagetype=custom` | The type of page to open. |
27+
28+
5. **Execute the Test for Custom Page**
29+
Change the example below to the URL of your organization:
30+
31+
```pwsh
32+
cd bin\Debug\PowerAppsEngine
33+
dotnet PowerAppsTestEngine.dll -i ..\..\..\samples\mdastreamcontrols\StreamControls_testPlan.fx.yaml -e e5e36a60-11a5-e554-9d70-5f3daccad60b -t 72f988bf-86f1-41af-91ab-2d7cd011db47 -u storagestate --provider mda -d "https://orgdc37ebb8.crm.dynamics.com/main.aspx?appid=572ada03-15cc-ef11-a72e-000d3a12b0cb&pagetype=custom&name=cr693_mdastreamcontrolspage_90253"
34+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# Get current directory so we can reset back to it after running the tests
5+
$currentDirectory = Get-Location
6+
7+
$config = Get-Content -Path .\config.json -Raw | ConvertFrom-Json
8+
$tenantId = $config.tenantId
9+
$environmentId = $config.environmentId
10+
$user1Email = $config.user1Email
11+
12+
if ([string]::IsNullOrEmpty($environmentId)) {
13+
Write-Error "Environment not configured. Please update config.json"
14+
return
15+
}
16+
17+
# Build the latest debug version of Test Engine from source
18+
Set-Location ..\..\src
19+
dotnet build
20+
21+
if ($config.installPlaywright) {
22+
Start-Process -FilePath "pwsh" -ArgumentList "-Command `"..\bin\Debug\PowerAppsTestEngine\playwright.ps1 install`"" -Wait
23+
} else {
24+
Write-Host "Skipped playwright install"
25+
}
26+
27+
Set-Location ..\bin\Debug\PowerAppsTestEngine
28+
$env:user1Email = $user1Email
29+
# Run the tests for each user in the configuration file.
30+
dotnet PowerAppsTestEngine.dll -u "storagestate" --provider "mda" -a "none" -i "$currentDirectory\testPlan.fx.yaml" -t $tenantId -e $environmentId
31+
32+
# Reset the location back to the original directory.
33+
Set-Location $currentDirectory

src/testengine.provider.mda/ModelDrivenApplicationProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ public string CheckTestEngineObject
213213
case "islogovisible":
214214
case "istitlevisible":
215215
case "checked":
216+
case "autoplay":
217+
case "showtitle":
216218
return (T)(object)("{PropertyValue: " + value.ToString().ToLower() + "}");
217219
default:
218220
switch (value.GetType().ToString())

0 commit comments

Comments
 (0)