-
Notifications
You must be signed in to change notification settings - Fork 51
[Feature]: Enable PowerApps MDA Media Controls Video, Audio, Microphone for Custom Pages #595
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
Open
v-nabalasubr
wants to merge
10
commits into
main
Choose a base branch
from
user/v-nabalasubr/Mda_MediaControls2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b93068a
Test Cases for Video, Audio and Microphone controls
v-nabalasubr 284ae69
Update image URLs and command-line options for provider arguement
v-nabalasubr b2545a9
updated url for Audio control
v-nabalasubr cd8da53
Merge branch 'main' into user/v-nabalasubr/Mda_MediaControls2
v-nabalasubr a16fc7c
Merge branch 'main' into user/v-nabalasubr/Mda_MediaControls2
snamilikonda b796a0b
Merge branch 'main' into user/v-nabalasubr/Mda_MediaControls2
snamilikonda 04759ac
Merge branch 'main' into user/v-nabalasubr/Mda_MediaControls2
v-nabalasubr 8c381ac
Merge branch 'main' into user/v-nabalasubr/Mda_MediaControls2
snamilikonda 8838217
Removing parameter from command
v-nabalasubr 5cc5a5a
Merge branch 'main' into user/v-nabalasubr/Mda_MediaControls2
snamilikonda 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
Binary file not shown.
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,33 @@ | ||
| # Overview | ||
|
|
||
| This Power Apps Test Engine example shows how to validate and manipulate the values of Media controls such as Video, Audio, and Microphone within 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 testPlan.fx.yaml** | ||
| Update the YAML file to assert expected values of the Video, Audio, and Microphone controls. | ||
|
|
||
| > [!NOTE] The controls are referenced using the [logical name](https://learn.microsoft.com/power-apps/developer/data-platform/entity-metadata#table-names). | ||
| 4. **Update the Domain URL for Your Model-Driven Application** | ||
|
|
||
| | URL Part | Description | | ||
| |----------|-------------| | ||
| | `appid=a1234567-cccc-44444-9999-a123456789123` | The unique identifier of your model-driven application. | | ||
| | `etn=` | 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. | | ||
| | `UserAuth=storagestate` | The type of user authentication to use. | | ||
| | `UseStaticContext=True` | The Flag to represent usage of Static context. | | ||
|
|
||
| 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\mda_imagecontrol\testPlan.fx.yaml -e 00000000-0000-0000-0000-11112223333 -t 11112222-3333-4444-5555-666677778888 -u storagestate -c True --provider mda -d "https://contoso.crm4.dynamics.com/main.aspx?appid=d67b4662-12fb-ef11-bae2-00224823607e&pagetype=custom&name=cr693_mdamediacontrols_f20f0" | ||
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,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 |
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,172 @@ | ||
| testSuite: | ||
| testSuiteName: MDA Custom Page tests - Media Control | ||
| testSuiteDescription: Verify test cases for Media Control | ||
| persona: User1 | ||
| appLogicalName: NotNeeded | ||
|
|
||
| testCases: | ||
| # Video Control Test Cases | ||
|
|
||
| - testCaseName: Test Video Control - Start Time Property | ||
| testCaseDescription: Verify that the Start Time property starts video from the given time. | ||
| testSteps: | | ||
| SetProperty(Video1.StartTime, 0); | ||
| Assert(Video1.StartTime = 0, "Checking if video Started from given time"); | ||
|
|
||
| - testCaseName: Test Video Control - AutoStart Property | ||
| testCaseDescription: Verify that the AutoStart property starts video playback automatically when enabled. | ||
| testSteps: | | ||
| SetProperty(Video1.AutoStart, true); | ||
| Wait(lblVideo, "Text", "Video Playback has started"); | ||
| Assert(Video1.AutoStart = true, "Checking if video AutoStart is enabled"); | ||
|
|
||
| - testCaseName: Test Video Control - Start Property | ||
| testCaseDescription: Verify that the Start property correctly sets the start position of the video. | ||
| testSteps: | | ||
| SetProperty(Video1.Start, true); | ||
| Wait(lblVideo, "Text", "Video Playback has started"); | ||
| Assert(Video1.Start = true, "Checking the Start position"); | ||
|
|
||
| - testCaseName: Test Video Control - Paused Property | ||
| testCaseDescription: Verify that the Paused property reflects the correct state of video playback. | ||
| testSteps: | | ||
| SetProperty(Video1.Paused, true); | ||
| Assert(Video1.Paused = true, "Checking if video is paused"); | ||
| SetProperty(Video1.Paused, false); | ||
| Assert(Video1.Paused = false, "Checking if video is playing"); | ||
|
|
||
| - testCaseName: Test Video Control - ShowControls Property | ||
| testCaseDescription: Verify that the Video control's ShowControls property can be enabled and disabled. | ||
| testSteps: | | ||
| SetProperty(Video1.ShowControls, false); | ||
| Assert(Video1.ShowControls = false, "Checking if ShowControls is disabled"); | ||
| SetProperty(Video1.ShowControls, true); | ||
| Assert(Video1.ShowControls = true, "Checking if ShowControls is enabled"); | ||
|
|
||
|
|
||
| - testCaseName: Test Video Control - Image Property | ||
| testCaseDescription: Verify that the Video control's Image property is set correctly as a placeholder. | ||
| testSteps: | | ||
| SetProperty(Video1.Image, "https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png"); | ||
| Assert(Video1.Image = "https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png", "Checking the Image source value"); | ||
|
|
||
| - testCaseName: Test Video Control - Loop Property | ||
| testCaseDescription: Verify that the Loop property enables looping of the video. | ||
| testSteps: | | ||
| SetProperty(Video1.Loop, true); | ||
| Wait(lblVideo, "Text", "Video Playback has started"); | ||
| Assert(Video1.Loop = true, "Checking if video is looping"); | ||
|
|
||
| - testCaseName: Test Video Control - Media Property | ||
| testCaseDescription: Verify that the Video control can set and retrieve the media source correctly. | ||
| testSteps: | | ||
| SetProperty(Video1.Media, "https://www.youtube.com/watch?v=668nUCeBHyY"); | ||
| Wait(Video1, "Media", "https://www.youtube.com/watch?v=668nUCeBHyY"); | ||
| Assert(Video1.Media = "https://www.youtube.com/watch?v=668nUCeBHyY", "Checking the Media source value"); | ||
|
|
||
|
|
||
| # Audio Control Test Cases | ||
|
|
||
| - testCaseName: Test Audio Control - Start Time Property | ||
| testCaseDescription: Verify that the Start Time property starts audio from the given time. | ||
| testSteps: | | ||
| SetProperty(Audio1.StartTime, 0); | ||
| Assert(Audio1.StartTime = 0, "Checking if audio Started from given time"); | ||
|
|
||
| - testCaseName: Test Audio Control - AutoStart Property | ||
| testCaseDescription: Verify that the AutoStart property starts audio playback automatically when enabled. | ||
| testSteps: | | ||
| SetProperty(Audio1.AutoStart, true); | ||
| Wait(lblAudio, "Text", "Audio Playback has started"); | ||
| Assert(Audio1.AutoStart = true, "Checking if audio AutoStart is enabled"); | ||
|
|
||
| - testCaseName: Test Audio Control - Start Property | ||
| testCaseDescription: Verify that the Start property correctly sets the start position of the audio. | ||
| testSteps: | | ||
| SetProperty(Audio1.Start, true); | ||
| Wait(lblAudio, "Text", "Audio Playback has started"); | ||
| Assert(Audio1.Start = true, "Checking the Start position"); | ||
|
|
||
| - testCaseName: Test Audio Control - Paused Property | ||
| testCaseDescription: Verify that the Paused property reflects the correct state of audio playback. | ||
| testSteps: | | ||
| SetProperty(Audio1.Paused, true); | ||
| Assert(Audio1.Paused = true, "Checking if audio is paused"); | ||
| SetProperty(Audio1.Paused, false); | ||
| Assert(Audio1.Paused = false, "Checking if audio is playing"); | ||
|
|
||
| - testCaseName: Test Audio Control - ShowControls Property | ||
| testCaseDescription: Verify that the Audio control's ShowControls property can be enabled and disabled. | ||
| testSteps: | | ||
| SetProperty(Audio1.ShowControls, false); | ||
| Assert(Audio1.ShowControls = false, "Checking if ShowControls is disabled"); | ||
| SetProperty(Audio1.ShowControls, true); | ||
| Assert(Audio1.ShowControls = true, "Checking if ShowControls is enabled"); | ||
|
|
||
| - testCaseName: Test Audio Control - Image Property | ||
| testCaseDescription: Verify that the Audio control's Image property is set correctly as a placeholder. | ||
| testSteps: | | ||
| SetProperty(Audio1.Image, "https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png"); | ||
| Assert(Audio1.Image = "https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png", "Checking the Image source value"); | ||
|
|
||
| - testCaseName: Test Audio Control - Loop Property | ||
| testCaseDescription: Verify that the Loop property enables looping of the audio. | ||
| testSteps: | | ||
| SetProperty(Audio1.Loop, true); | ||
| Wait(lblAudio, "Text", "Audio Playback has started"); | ||
| Assert(Audio1.Loop = true, "Checking if audio is looping"); | ||
|
|
||
| - testCaseName: Test Audio Control - Media Property | ||
| testCaseDescription: Verify that the Audio control can set and retrieve the media source correctly. | ||
| testSteps: | | ||
| SetProperty(Audio1.Media, "https://www.youtube.com/watch?v=mDQQFjM5Bfg&list=RDmDQQFjM5Bfg&start_radio=1"); | ||
| Wait(Audio1, "Media", "https://www.youtube.com/watch?v=mDQQFjM5Bfg&list=RDmDQQFjM5Bfg&start_radio=1"); | ||
| Assert(Audio1.Media = "https://www.youtube.com/watch?v=mDQQFjM5Bfg&list=RDmDQQFjM5Bfg&start_radio=1", "Checking the Media source value"); | ||
|
|
||
| # Micrphone Control Test Cases | ||
|
|
||
| - testCaseName: Test Microphone Control - Mic Property | ||
| testCaseDescription: Verify that the Mic property set to 1. | ||
| testSteps: | | ||
| SetProperty(Microphone1.Mic, 1); | ||
| Assert(Microphone1.Mic = 1, "Checking if microphone mic property set to 1"); | ||
|
|
||
| - testCaseName: Test Microphone Control - Mic Property | ||
| testCaseDescription: Verify that the Mic property starts and stops the microphone recording. | ||
| testSteps: | | ||
| Select(Microphone1); | ||
| Wait(lblMicrophone, "Text", "Recording has Started"); | ||
| Assert(lblMicrophone.Text = "Recording has Started", "Checking if microphone recording has started"); | ||
| Select(Microphone1); | ||
| Wait(lblMicrophone, "Text", "Recording has Stopped"); | ||
| Assert(lblMicrophone.Text = "Recording has Stopped", "Checking if microphone recording has stopped"); | ||
|
|
||
| - testCaseName: Test Microphone Control - Image Property | ||
| testCaseDescription: Verify that the Microphone control's Image property is set correctly as a placeholder. | ||
| testSteps: | | ||
| SetProperty(Microphone1.Image, "https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png"); | ||
| Assert(Microphone1.Image = "https://uhf.microsoft.com/images/microsoft/RE1Mu3b.png", "Checking the Image source value"); | ||
|
|
||
| - testCaseName: Test Microphone Control - Audio Property | ||
| testCaseDescription: Verify that the Microphone control can set and retrieve the audio source correctly. | ||
| testSteps: | | ||
| SetProperty(Audio2.Media, Microphone1.Audio); | ||
| Wait(Audio2, "Media", Microphone1.Audio); | ||
| SetProperty(Audio2.Start, true); | ||
| Assert(Audio2.Start = true, "Checking the Audio source value"); | ||
|
|
||
| testSettings: | ||
| headless: false | ||
| locale: "en-US" | ||
| recordVideo: true | ||
| extensionModules: | ||
| enable: true | ||
| browserConfigurations: | ||
| - browser: Chromium | ||
| channel: msedge | ||
|
|
||
| environmentVariables: | ||
| users: | ||
| - personaName: User1 | ||
| emailKey: user1Email | ||
| passwordKey: NotNeeded |
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
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
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.