To replicate the test-bench, you need a PC with a monitor and a smartphone.
Tip: In order to have everything under control in just one screen, we recommend to use
tmux
.
In this approach, you can use scripts to simplify the interactions with the tools provided by the toolkit. These scripts are collected in the scripts
folder under the name scripts/test-*
.
- Move inside
scripts/test-single
- Open a terminal and configure
tmux
(or open multiple terminals) as shown in the image above (3 terminals). - In the left terminal, execute
./qrgen-terminal.sh -p left -a <app_name> -s <optional:start_position>
. - Position the smartphone so that the QR Code is fully framed by the camera.
- In the top right terminal, execute
adb devices
and take note ofdevice ID
. - In the top right terminal, execute
appium
and take note of port. - In the bottom right terminal, execute
./appium-terminal.sh -p <appium_port> -d <device_id> -a <app_name> -s <optional:start_position>
If something fails (e.g. xpath / object ID changes in the app), you will receive a prompt from the bottom right terminal to put the app in the scan page and then press any key to continue.
If the app crashes, the QRCodeFuzzer will try to recover the previous test by re-opening the app.
Tests are saved inside
tools/QRCodeFuzzer/data-tests/<app_name>
- Move inside
scripts/test-single
- Open a terminal and configure
tmux
(or open multiple terminals) as shown in the image above (4 terminals). - In the top left terminal, execute
./qrgen-terminal.sh -p left -a <app_name> -s <optional:start_position>
. - In the top right terminal, execute
./qrgen-terminal.sh -p right -a <app_name> -s <optional:start_position>
. - Position the smartphones so that the QR Code is fully framed by the cameras (one on the left, one on the right).
- In the bottom left (or right) terminal, execute
adb devices
and take note ofdevice ID
of both smartphones. - In another workspace, or in a background window, open two new terminals and execute
appium -p <port_number>
. - In the bottom left terminal, execute
./appium-terminal.sh -p <appium_port_1> -d <device_id_1> -a <app_name> -s <optional:start_position>
- In the bottom right terminal, execute
./appium-terminal.sh -p <appium_port_2> -d <device_id_2> -a <app_name> -s <optional:start_position>
If something fails (e.g. xpath / object ID changes in the app), you will receive a prompt from the bottom terminals to put the app in the scan page and then press any key to continue.
If the app crashes, the QRCodeFuzzer will try to recover the previous test by re-opening the app.
Tests are saved inside
tools/QRCodeFuzzer/data-tests/<app_name>
Sequential execution can be useful to execute multiple applications tests.
The setup is similar to single / parallel execution, with the only constraint that you can pass a <app_lists_file>
instead of <app_name>
.
Here's an example with parallel execution (single execution is straight forward):
- Move inside
scripts/test-sequential
, and create two filesapps-phone-1.txt
andapps-phone-2.txt
, each containing list of apps to test in new lines. - Open a terminal and configure
tmux
(or open multiple terminals) as shown in the image above (4 terminals). - In the top left terminal, execute
./qrgen-terminal.sh -p left -f <app_lists_file_1> -s <optional:start_position>
. - In the top right terminal, execute
./qrgen-terminal.sh -p right -f <app_lists_file_2> -s <optional:start_position>
. - Position the smartphones so that the QR Code is fully framed by the cameras (one on the left, one on the right).
- In the bottom left (or right) terminal, execute
adb devices
and take note ofdevice ID
of both smartphones. - In another workspace, or in a background window, open two new terminals and execute
appium -p <port_number>
. - In the bottom left terminal, execute
./appium-terminal.sh -p <appium_port_1> -d <device_id_1> -f <app_lists_file_1> -s <optional:start_position>
- In the bottom right terminal, execute
./appium-terminal.sh -p <appium_port_2> -d <device_id_2> -f <app_lists_file_2> -s <optional:start_position>
In this approach, you can directly employ each tool manually.
Tip: Get the
udid
(device_id
) usingadb devices
.
- Start
appium -p 4723
in terminal (even in background) - Start a bash script with
python main.py -a <app> -j <json_data_path> -p <left/right/center> -sf <optional:start_position>
in another terminal - Start a bash script with
node index.js <app> <data_path> <port> <device_id> <optional:start_position>
in a third terminal
- Start
appium -p 4723
in terminal A (even in background) - Start
appium -p 4724
in terminal B (even in background) - Start a bash script with
python main.py -a <app> -j <json_path>
for terminal 1 - Start a bash script with
python main.py -a <app> -j <json_path>
for terminal 2 - Start a bash script with
node index.js <app> <data_path> <port> <device_id>
for terminal 3 (same path as terminal 1) - Start a bash script with
node index.js <app> <data_path> <port> <device_id>
for terminal 4 (same path as terminal 2)
The Telegram notifier can be used to get notified about app status changes.
You can find installation and usage instructions in scripts/telegram-notifier folder.