mixhalo-qa-tools 0.0.103
Tools for use during Mixhalo QA
Requires Python: >=3.6

# Mixhalo QA tools

## Setup

Install the `mixhalo_qa_tools` package:
```
$ pip install mixhalo_qa_tools
```

Refer to the [automated testing README.md](https://github.com/MIXhalo/QA/blob/master/automated_testing/README.md) for Appium setup instructions

## Unit tests

To run unit tests for the package:
```
$ mixhalo_run_all_qa_unit_tests
```

Note that this requires at least one physical device to be connected.

## Scale testing

Controls a testbed of devices using Appium. Can be used to connect, disconnect, play, or pause the devices with no manual intervention.

### To initiate the tests

To run scale tests and send commands to all connected devices simultaneously:
```
mixhalo_scale_test
```

### Troubleshooting

A default number of Appium servers and parallel threads is defined, but can be modified on the command line. A small number of servers (one or two) is advised; if setting up the connection fails for some devices, it is recommended to exit and restart the test. Note that setting up the connection initially can take up to a minute, but is reduced to a few seconds for future tests if the connection has been previously established.

If you consistently have issues connecting to a device:

1. Confirm that you have trusted the device and machine

    - Connect the device to your machine

    - Select the device in Finder under “Locations”

    - Select “Trust” in Finder and on the device.

2. Update the Web Driver Agent (used to communicate between the client and server) “Signing and Capabilities”

    - Open the Web Driver Agent XCode project (this should be at `/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj`; if it is not, refer to the Appium logs)

    - Update the “Signing and Capabilities” to use the “Mixhalo Corp.” team and a signing certificate of “Development” for all build targets (tvOS targets can be ignored)

3. Ensure the device is registered in the Mixhalo development account

    - Open the Web Driver Agent XCode project (this should be at `/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj`; if it is not, refer to the Appium logs)

    - Select the device from the drop-down as though you were going to compile and run on it

    - On the the “Signing and Capabilities" page, if there is an error that states that the device is not registered, register it

4. Ensure the device is registered **and enabled** in the Mixhalo development account

    - Login to your [Apple Developer account](developer.apple.com/account)

    - Navigate to "Certificates, IDs & Profiles", then select "Devices"

    - Search for the device's UDID in the list (can be obtained from Finder by clicking under the device name). If the device is greyed out, it needs to be enabled before it can be used (click on the device and select "Enable")

5. If still seeing issues, manually deploy the "WebDriverAgentRunner" target to the device

    - Open the Web Driver Agent XCode project (this should be at `/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj`; if it is not, refer to the Appium logs)

    - Select the "WebDriverAgentRunner" target and the problem device

    - Build and run the target

    - If this doesn't succeed, good luck (probably a cert issue, but you're on your own)