There are two types of tests for excercising the wrapper library.
First, unit tests built against mock responses should be run before every Pull Request. Use Run All via the Test Explorer in Visual Studio prior to submitting any Pull Requests. You can also configure Visual Studio to automatically run the tests after each build of the solution via Test Settings in the Test menu.
Second, manual or semi-automated tests can also be run on a per-device basis via the device specific test apps. See the following for information on running these test apps:
For Xbox One: [Using the Xbox Test App.](https://github.com/Microsoft/WindowsDevicePortalWrapper/blob/master/XboxWDPDriver.md)
# Writing Tests
Windows Device Portal Wrapper (WDPW) tests are run against mock data so that a windows device is not required to run the tests.
@@ -98,7 +111,7 @@ MockDataGenerator.exe, from the MockDataGenerator project, is used to target a W
# Using XboxWDPDriver.exe for testing or production management
XboxWDPDriver.exe, from the TestAppXbox project, is used to target WDP on Xbox One to assist in automated testing as well as being useful for production development scenarios.
The app has built in help for most of its operations which can be accessed with the /? flag.
Scripts or other executables could be written to interface with XboxWDPDriver.exe to make simpler command line calls, and can mimic things like the Xb*.exe command line tools that may be familiar to some Xbox developers. An example of such a script is provided in the Tools directory when building the TestAppXbox project (XbUser.cmd).
| /ip | The system IP address for the Xbox One console (required if no default console is set). |
| /User | WDP username (if required, will be stored after the first connection starting with Windows 8). |
| /Pwd | WDP password (if required, will be stored after the first connection starting with Windows 8). |
| /Op | The operation to run. Run XboxWDPDriver without this parameter to get a list of all available operations. |
Supported operations are the following:
* connect
* info
* xbluser
* install
* reboot
* processes
* systemPerf
* config
* file
### The connect operation
The ip parameter is required if no default console is configured. You can set a default console or list the current default console by using the 'connect' operation.
Examples:
```shell
XboxWDPDriver.exe /ip:10.0.0.1 /op:connect
```
or
```shell
XboxWDPDriver.exe /op:connect
```
### The info operation
Lists some basic information about the operating system and device name of this Xbox One console.
Example:
```shell
XboxWDPDriver.exe /op:info
```
### The xbluser operation
Controls listing and managing users on the console.
Usage:
```shell
/subop:list
Lists all Xbox Live Users on the console
/subop:signin <user identifier (/msa:<msa> or /id:<id>)>[/msapwd:<password>]
Signs in the given user, adding them to the console if necessary
/subop:signout <user identifier (/msa:<msa> or /id:<id>)>
Signs the given user out of the console
/subop:addsponsored
Adds a sponsored user to the console
/subop:autosignin <user identifier (/msa:<msa> or /id:<id>)> <state (/on or /off)>
Turns autosignin on or off for a given user
/subop:delete <user identifier (/msa:<msa> or /id:<id>)>
Allows file operations on some known folders on the console (application specific storage via LocalAppData and development files via DevelopmentFiles).
LocalAppData operations require the package full name be provided.
Usage:
```shell
/subop:knownfolders
Lists all available known folder ids on the console
Lists the directory contents at the given knownfoldid and optionally subpath.
/subop:download /knownfolderid:<knownfolderid> /filename:<name of the file to download> /destination:<filepath for storing the file> [/subpath:<subpath>] [/packagefullname:<packageFullName>]
Downloads the requested file to the desired destination.
/subop:upload /knownfolderid:<knownfolderid> /filepath:<filepath of the file to upload> [/subpath:<subpath>] [/packagefullname:<packageFullName>]
Uploads a file to the requested folder.
/subop:rename /knownfolderid:<knownfolderid> /filename:<name of the file to rename> /newfilename:<new filename> [/subpath:<subpath>] [/packagefullname:<packageFullName>]
Renames a given file.
/subop:delete /knownfolderid:<knownfolderid> /filename:<name of the file to delete> [/subpath:<subpath>] [/packagefullname:<packageFullName>]