diff --git a/samples/mdastreamcontrol/MDAStreamControl_testPlan.fx.yaml b/samples/mdastreamcontrol/MDAStreamControl_testPlan.fx.yaml new file mode 100644 index 000000000..18b0a7c6c --- /dev/null +++ b/samples/mdastreamcontrol/MDAStreamControl_testPlan.fx.yaml @@ -0,0 +1,108 @@ +testSuite: + testSuiteName: Stream Control Tests + testSuiteDescription: Verify stream control functionality in PowerApps + persona: User1 + appLogicalName: NotNeeded + + testCases: + - testCaseName: Verify StreamUrl Property + testCaseDescription: Verify that the StreamUrl property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.StreamUrl, "URL"); + Assert(StreamVideo1.StreamUrl = "URL"); + + - testCaseName: Verify Autoplay Property + testCaseDescription: Verify that the Autoplay property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.Autoplay, true); + Assert(StreamVideo1.Autoplay = true, "Expected StreamVideo1.Autoplay to be true"); + + - testCaseName: Verify ShowTitle Property + testCaseDescription: Verify that the ShowTitle property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.ShowTitle, false); + Assert(StreamVideo1.ShowTitle = false, "Expected StreamVideo1.ShowTitle to be false"); + + - testCaseName: Verify StartTime Property + testCaseDescription: Verify that the StartTime property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.StartTime, 10); + Assert(StreamVideo1.StartTime = 10, "Expected StreamVideo1.StartTime to be 10"); + + - testCaseName: Verify ContentLanguage Property + testCaseDescription: Verify that the ContentLanguage property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.ContentLanguage, "en-US"); + Assert(StreamVideo1.ContentLanguage = "en-US", "Expected StreamVideo1.ContentLanguage to be 'en-US'"); + + - testCaseName: Verify TabIndex Property + testCaseDescription: Verify that the TabIndex property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.TabIndex, 1); + Assert(StreamVideo1.TabIndex = 1, "Expected StreamVideo1.TabIndex to be 1"); + + - testCaseName: Verify Tooltip Property + testCaseDescription: Verify that the Tooltip property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.Tooltip, "Stream Video Tooltip"); + Assert(StreamVideo1.Tooltip = "Stream Video Tooltip", "Expected StreamVideo1.Tooltip to be 'Stream Video Tooltip'"); + + - testCaseName: Verify DisplayMode Property + testCaseDescription: Verify that the DisplayMode property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.DisplayMode, "Edit"); + Assert(StreamVideo1.DisplayMode = "Edit", "Expected StreamVideo1.DisplayMode to be 'Edit'"); + + - testCaseName: Verify X Position Property + testCaseDescription: Verify that the X position is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.X, 100); + Assert(StreamVideo1.X = 100, "Expected StreamVideo1.X to be 100"); + + - testCaseName: Verify Y Position Property + testCaseDescription: Verify that the Y position is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.Y, 200); + Assert(StreamVideo1.Y = 200, "Expected StreamVideo1.Y to be 200"); + + - testCaseName: Verify Width Property + testCaseDescription: Verify that the Width property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.Width, 1280); + Assert(StreamVideo1.Width = 1280, "Expected StreamVideo1.Width to be 1280"); + + - testCaseName: Verify Height Property + testCaseDescription: Verify that the Height property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.Height, 720); + Assert(StreamVideo1.Height = 720, "Expected StreamVideo1.Height to be 720"); + + - testCaseName: Verify Visible Property + testCaseDescription: Verify that the Visible property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.Visible, true); + Assert(StreamVideo1.Visible = true, "Expected StreamVideo1.Visible to be true"); + + - testCaseName: Verify ZIndex Property + testCaseDescription: Verify that the ZIndex property is set and retrieved correctly. + testSteps: | + SetProperty(StreamVideo1.ZIndex, 5); + Assert(StreamVideo1.ZIndex = 5, "Expected StreamVideo1.ZIndex to be 5"); + +testSettings: + headless: false + locale: "en-US" + recordVideo: true + extensionModules: + enable: true + browserConfigurations: + - browser: Chromium + channel: msedge + timeout: 600000 + +environmentVariables: + users: + - personaName: User1 + emailKey: user1Email + passwordKey: NotNeeded + diff --git a/samples/mdastreamcontrol/MDA_StreamCotrol_Solution_1_0_0_2.zip b/samples/mdastreamcontrol/MDA_StreamCotrol_Solution_1_0_0_2.zip new file mode 100644 index 000000000..a29899af5 Binary files /dev/null and b/samples/mdastreamcontrol/MDA_StreamCotrol_Solution_1_0_0_2.zip differ diff --git a/samples/mdastreamcontrol/README.md b/samples/mdastreamcontrol/README.md new file mode 100644 index 000000000..3753f9941 --- /dev/null +++ b/samples/mdastreamcontrol/README.md @@ -0,0 +1,34 @@ + +# Overview + +This Power Apps Test Engine sample demonstrates how to assert and interact with the values of stream control in a model-driven application form. + +## Usage + +1. **Build the Test Engine Solution** + Ensure the Power Apps Test Engine solution is built and ready to be executed. + +2. **Get the URL of the Model-Driven Application Form** + Acquire the URL of the specific Model-Driven Application form that you want to test. + +3. **Modify the StreamControl_testPlan.fx.yaml** + Update the YAML file to assert expected values of the stream controls. + + > [!NOTE] The controls are referenced using the logical name. + +4. **Update the Domain URL for Your Model-Driven Application** + + | URL Part | Description | + |----------|-------------| + | `appid=572ada03-15cc-ef11-a72e-000d3a12b0cb` | The unique identifier of your model-driven application. | + | `etn=stream` | The name of the entity being validated. | + | `id=26bafa27-ca7d-ee11-8179-0022482a91f4` | The unique identifier of the record being edited. | + | `pagetype=custom` | The type of page to open. | + +5. **Execute the Test for Custom Page** + Change the example below to the URL of your organization: + +```pwsh +cd bin\Debug\PowerAppsEngine +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" +``` \ No newline at end of file diff --git a/samples/mdastreamcontrol/RunTests.ps1 b/samples/mdastreamcontrol/RunTests.ps1 new file mode 100644 index 000000000..222e4e758 --- /dev/null +++ b/samples/mdastreamcontrol/RunTests.ps1 @@ -0,0 +1,33 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# Get current directory so we can reset back to it after running the tests +$currentDirectory = Get-Location + +$config = Get-Content -Path .\config.json -Raw | ConvertFrom-Json +$tenantId = $config.tenantId +$environmentId = $config.environmentId +$user1Email = $config.user1Email + +if ([string]::IsNullOrEmpty($environmentId)) { + Write-Error "Environment not configured. Please update config.json" + return +} + +# Build the latest debug version of Test Engine from source +Set-Location ..\..\src +dotnet build + +if ($config.installPlaywright) { + Start-Process -FilePath "pwsh" -ArgumentList "-Command `"..\bin\Debug\PowerAppsTestEngine\playwright.ps1 install`"" -Wait +} else { + Write-Host "Skipped playwright install" +} + +Set-Location ..\bin\Debug\PowerAppsTestEngine +$env:user1Email = $user1Email +# Run the tests for each user in the configuration file. +dotnet PowerAppsTestEngine.dll -u "storagestate" --provider "mda" -a "none" -i "$currentDirectory\testPlan.fx.yaml" -t $tenantId -e $environmentId + +# Reset the location back to the original directory. +Set-Location $currentDirectory \ No newline at end of file diff --git a/src/testengine.provider.mda/ModelDrivenApplicationProvider.cs b/src/testengine.provider.mda/ModelDrivenApplicationProvider.cs index c2dbe2afb..f6586c78b 100644 --- a/src/testengine.provider.mda/ModelDrivenApplicationProvider.cs +++ b/src/testengine.provider.mda/ModelDrivenApplicationProvider.cs @@ -213,6 +213,8 @@ public string CheckTestEngineObject case "islogovisible": case "istitlevisible": case "checked": + case "autoplay": + case "showtitle": return (T)(object)("{PropertyValue: " + value.ToString().ToLower() + "}"); default: switch (value.GetType().ToString())