-
Notifications
You must be signed in to change notification settings - Fork 15
Added a Test for Teams app testing. #68
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
WSEAutomationTests
wants to merge
5
commits into
main
Choose a base branch
from
user/jdugar/TeamsTesting
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.
+206
−7
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
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
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,93 @@ | ||
| <# | ||
| DESCRIPTION: | ||
| Starts a Microsoft Teams meeting using the given link and automates | ||
| camera, audio, and join actions. | ||
|
|
||
| INPUT PARAMETERS: | ||
| @param teamsMeetingLink [String] - Teams meeting URL. | ||
|
|
||
| RETURN TYPE: | ||
| void | ||
| #> | ||
| function Start-TeamsMeeting | ||
| { | ||
| Write-Log -Message "Entering Start-TeamsMeeting function" -IsOutput | ||
|
|
||
| # Launch the Teams app with the meeting link | ||
| Start-Process "https://teams.live.com/meet/9393388815307?p=DjwPrJ9iFrjS0pdlyT" | ||
|
|
||
| # Toggle Camera button | ||
| [System.Windows.Forms.SendKeys]::SendWait('^+o') | ||
|
|
||
| # Wait and check if Teams process is running | ||
| Start-Sleep -Seconds 5 | ||
| $Teams = Get-Process -Name "ms-teams" -ErrorAction SilentlyContinue | ||
| if (-not $Teams) { | ||
| Write-Host "Teams process not found." | ||
| return | ||
| } | ||
| $TeamsProcessIDDetails = $Teams.Id | ||
| foreach($TeamsProcessID in $TeamsProcessIDDetails) | ||
| { | ||
| $uiTeams = FindUIElementByProcessID -procID $TeamsProcessID | ||
| if ($uiTeams -ne $null) | ||
| { | ||
| # Click Join, then check camera & mic is On. | ||
| start-sleep -s 5 | ||
| FindAndClick -uiEle $uiTeams -autoID "prejoin-join-button" | ||
| Start-Sleep -s 5 | ||
| Start-Camera -uiEle $uiTeams | ||
| Start-Sleep -s 5 | ||
| Start-Audio -uiEle $uiTeams | ||
|
|
||
| # End and Close Teams after 60 secs | ||
| Start-Sleep -s 60 | ||
| [System.Windows.Forms.SendKeys]::SendWait('^+H') | ||
| Stop-Process -Name "ms-teams" | ||
| Start-Sleep -s 2 | ||
| } | ||
|
|
||
| } | ||
| } | ||
| <# | ||
| DESCRIPTION: | ||
| This function turns on the camera in the Teams app if it's not already on. | ||
| INPUT PARAMETERS: | ||
| - uiEle [object] :- The Teams UI element for camera control. | ||
| RETURN TYPE: | ||
| - void | ||
| #> | ||
|
|
||
| function Start-Camera($uiEle) | ||
| { | ||
| Write-Log -Message "Entering Start-Camera function" -IsOutput | ||
| $elemt = CheckIfElementExists -uiEle $uiEle -proptyNme "Turn camera off" | ||
| if ($elemt -ne $null){ | ||
| Write-Log -Message "Camera is already On" -IsHost -IsOutput | ||
| } | ||
| else | ||
| { | ||
| FindAndClick -uiEle $uiEle -proptyNme "Turn camera on" | ||
| } | ||
| } | ||
| <# | ||
| DESCRIPTION: | ||
| This function unmutes the microphone in the Teams app if it's muted. | ||
| INPUT PARAMETERS: | ||
| - uiEle [object] :- The Teams UI element for audio control. | ||
| RETURN TYPE: | ||
| - void | ||
| #> | ||
|
|
||
| function Start-Audio($uiEle) | ||
| { | ||
| Write-Log -Message "Entering Start-Audio function" -IsOutput | ||
| $elemt = CheckIfElementExists -uiEle $uiEle -proptyNme "Mute mic" | ||
| if ($elemt -ne $null){ | ||
| Write-Log -Message "Audio is already On" -IsHost -IsOutput | ||
| } | ||
| else | ||
| { | ||
| FindAndClick -uiEle $uiEle -proptyNme "Unmute mic" | ||
| } | ||
| } | ||
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,93 @@ | ||
| param ( | ||
| [string] $token = $null, | ||
| [string] $SPId = $null, | ||
| [string] $targetMepCameraVer = $null, | ||
| [string] $targetMepAudioVer = $null, | ||
| [string] $targetPerceptionCoreVer = $null | ||
|
|
||
| ) | ||
| # Sign In Teams with UserName: MEPTesting and check @jdugar for password. One time setup- Teams meeting link opens in browser, Select option to open in App always. | ||
|
|
||
| <# | ||
| DESCRIPTION: | ||
| This function runs an end-to-end test for the Teams application, | ||
| checking device power states, starting a Teams meeting, and capturing performance data. | ||
| INPUT PARAMETERS: | ||
| - token [string] :- Authentication token required to control the smart plug. | ||
| - SPId [string] :- Smart plug ID used to control device power states. | ||
| - targetMepCameraVer [string] :- Target version of the MEP. | ||
| - targetMepAudioVer [string] :- Target version of the MEP. | ||
| - targetPerceptionCoreVer [string] :- Target version of the Perception Core. | ||
| RETURN TYPE: | ||
| - void | ||
| #> | ||
| function Teamse2eTesting | ||
| { | ||
| Write-Log -Message "Entering Teamse2eTesting function" -IsOutput | ||
| $startTime = Get-Date | ||
| $ErrorActionPreference='Stop' | ||
| foreach($devPowStat in "Pluggedin" , "Unplugged") | ||
| { | ||
| $scenarioLogFolder = "$devPowStat\Teamse2eTesting" | ||
| $logFile = "Teamse2eTesting.txt" | ||
|
|
||
| try | ||
| { | ||
| # Create Scenario folder | ||
| CreateScenarioLogsFolder $scenarioLogFolder | ||
|
|
||
| $devState = CheckDevicePowerState $devPowStat $token $SPId | ||
| if($devState -eq $false) | ||
| { | ||
| TestOutputMessage $scenarioLogFolder "Skipped" $startTime "Token is empty" | ||
| return | ||
| } | ||
|
|
||
|
|
||
| # Toggling All effects on | ||
| Write-Output "Entering ToggleAIEffectsInSettingsApp function to toggle all effects On" | ||
| ToggleAIEffectsInSettingsApp -AFVal "On" -PLVal "On" -BBVal "On" -BSVal "False" -BPVal "True" ` | ||
| -ECVal "On" -ECSVal "False" -ECTVal "True" -VFVal "On" ` | ||
| -CF "On" -CFI "False" -CFA "False" -CFW "True" | ||
|
|
||
|
|
||
| # Checks if frame server is stopped | ||
| Write-Output "Entering CheckServiceState function" | ||
| CheckServiceState 'Windows Camera Frame Server' | ||
|
|
||
| # Starting to collect Traces | ||
| Write-Output "Entering StartTrace function" | ||
| StartTrace $scenarioLogFolder | ||
|
|
||
| # Open Task Manager | ||
| Write-output "Opening Task Manager" | ||
| $uitaskmgr = OpenApp 'Taskmgr' 'Task Manager' | ||
| Start-Sleep -s 1 | ||
| setTMUpdateSpeedLow -uiEle $uitaskmgr | ||
|
|
||
| # Start Teams Meeting | ||
| Start-sleep -s 2 | ||
| Start-TeamsMeeting | ||
|
|
||
| # Capture CPU and NPU Usage screenshot | ||
| Write-output "Entering CPUandNPU-Usage function to capture CPU and NPU usage Screenshot" | ||
| stopTaskManager -uitaskmgr $uitaskmgr -Scenario $scenarioLogFolder | ||
|
|
||
| # Verify logs and capture results. | ||
| Complete-TestRun $scenarioLogFolder $startTime $token $SPId | ||
| } | ||
| catch | ||
| { | ||
| Error-Exception -snarioName $scenarioLogFolder -strttme $startTime -rslts $Results -logFile $logFile -token $token -SPID $SPID | ||
| } | ||
| } | ||
| #For our Sanity, we make sure that we exit the test in neutral state, which is plugged in | ||
| SetSmartPlugState $token $SPId 1 | ||
| } | ||
| Add-Type -AssemblyName UIAutomationClient | ||
| Add-Type -AssemblyName UIAutomationTypes | ||
| Add-Type -AssemblyName System.Windows.Forms | ||
|
|
||
| .".\CheckInTest\Helper-library.ps1" | ||
| InitializeTest 'Teamse2eTesting' $targetMepCameraVer $targetMepAudioVer $targetPerceptionCoreVer | ||
| Teamse2eTesting | Out-File -FilePath "$pathLogsFolder\Teamse2eTesting.txt" -Append |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Teams meeting link is hardcoded. Consider making this configurable through a parameter or configuration file to improve maintainability and reusability.