Skip to content

Commit d9c4d9b

Browse files
red-avtovoSrinivasanTarget
authored andcommitted
capabilities - applicationName (#63)
* reduced docker image layers added Android Platform to docker image * provided serial number of device as applicationName of the node instance * fixed default grid configuration test * added debug file printing * Revert "added debug file printing" This reverts commit 6e5201e
1 parent a544687 commit d9c4d9b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Appium/generate_config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ function create_capabilities() {
5353
capabilities=""
5454
for name in ${devices[@]}; do
5555
os_version="$(adb -s $name shell getprop ro.build.version.release | tr -d '\r')"
56+
serial_number="$(adb -s $name shell getprop ro.serialno | tr -d '\r')"
5657
capabilities+=$(cat <<_EOF
5758
{
5859
"platform": "$PLATFORM_NAME",
5960
"platformName": "$PLATFORM_NAME",
6061
"version": "$os_version",
6162
"browserName": "$BROWSER_NAME",
6263
"deviceName": "$name",
63-
"maxInstances": 1
64+
"maxInstances": 1,
65+
"applicationName": "$serial_number"
6466
}
6567
_EOF
6668
)

Appium/tests/grid.bats

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ default_node_config=\
1010
"version": "7.1.1",
1111
"browserName": "android",
1212
"deviceName": "73QDU16916010699",
13-
"maxInstances": 1
13+
"maxInstances": 1,
14+
"applicationName": "73QDU16916010699"
1415
}, {
1516
"platform": "Android",
1617
"platformName": "Android",
1718
"version": "5.1.1",
1819
"browserName": "android",
1920
"deviceName": "4b13354b80b36200",
20-
"maxInstances": 1
21+
"maxInstances": 1,
22+
"applicationName": "4b13354b80b36200"
2123
}],
2224
"configuration": {
2325
"cleanUpCycle": 2000,
@@ -38,9 +40,11 @@ adb_devices_output='73QDU16916010699 device 4b13354b80b36200 device'
3840

3941
@test 'Verify selenium grid config is created' {
4042
stub adb \
41-
"devices : echo $adb_devices_output" \
42-
"-s 73QDU16916010699 shell getprop ro.build.version.release : echo 7.1.1" \
43-
"-s 4b13354b80b36200 shell getprop ro.build.version.release : echo 5.1.1"
43+
"devices : echo $adb_devices_output" \
44+
"-s 73QDU16916010699 shell getprop ro.build.version.release : echo 7.1.1" \
45+
"-s 73QDU16916010699 shell getprop ro.serialno : echo 73QDU16916010699" \
46+
"-s 4b13354b80b36200 shell getprop ro.build.version.release : echo 5.1.1" \
47+
"-s 4b13354b80b36200 shell getprop ro.serialno : echo 4b13354b80b36200"
4448

4549
run /root/generate_config.sh $node_config_json
4650
[ "$(cat $node_config_json)" == "$default_node_config" ]

0 commit comments

Comments
 (0)