Skip to content

InfTester/GraphSDK_Devices

Repository files navigation

Microsoft Graph SDK Device Test Automation Execution Script

This Repository holds the PowerShell Microsoft Graph SDK Device Test Automation Execution Scripts. The scripts have been provided to test a single device, which is initially identified, by specifying the user and then the serial number of the device. The script utilises Microsoft PowerShell and the modules Microsoft Graph SDK and Pester.

The scripts held within this repository have been thourougly tested with PowerShell Version 5.1.19041.2364, Pester Version 3.4.0 and Microsoft Graph SDK version 1.19.0.

The script will run against an a pre-connected Azure Tenant. If a session is not established, the script will prompt the user to provide the Tenant details and enter their credentials. If a different Tenant is to be used, the 'Disconnect-MgGraph' cmdlet should be used, prior to executing the script.

To run this script the user will require delegated access, and will authenticate using their username and password. The user should be familiar with Microsoft Graph Scopes. When establishing a session via the script, the user wil have to have been assigned the correct access permissions to correctly execute the scripts. To validate the scope for the user, run 'Get-MgContext | Select-Object -ExpandProperty Scopes'.

Microsoft Graph Profile - Beta has been used for this script as it provides more fuctions and cmdlets than the default version. This will be automatically loaded when the script executes.

Execution Instructions

The following intstructions are run against an Andriod Device. The instructions are the same for all devices, except that you will need to change the script for the appropriate device Operating System.

1. Execute Script, as per the example within the script.

Picture1a

2. Once the script is executed accept the Usage notice.

Picture1

3. Select the user, who you would like to test their device, by copying and pasting into the Input field.

Picture2

4. Once the device details for the user are displayed, enter the device which you would like to test, by copying and pasting the device ‘Serial number’.

serial

5. Once the serial number is added, press 'Enter' to execute the Pester Tests.

Picture4

6. The Serial number of the System Under Test

System Under Test is identified prior to each area of test as well as the (b) Pester Describe blocks, (c) Blocks and (d) It statements.

a. SUT Serial Number

Picture5

b. Pester Describe Block

Picture6

c. Pester Context blocks

Picture7

d. Pester It statement

Picture8

7. The summary provided, will provied the following details:

a. Test Completion with DTG of test.
b. Time taken to execute all the tests.
c. Tests
  • Passed:
  • Failed:
  • Skipped:
  • Pending:
  • Inconclusive:

Picture9

8. A test that passes will diplay the 'It statement' in Green text. No further details will be provided.

9. All Failed tests are visible in ‘Red’ text and a description of the failure is given, with the expected and actual results.

Picture10

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published