定向班第一期_兼容性测试_20199125

兼容问题介绍

测试环境

  • 4.4~9.0
  • 华为、小米、oppo、vivo、魅族、三星、联想、nexus、pix
  • 子品牌
  • 硬件差异
  • 屏幕分辨率可以通过模拟器测试

数据来源

STF设备结合Jenkins


#!/usr/bin/env bash



set -euxo pipefail


DEVICE_SERIAL=$device
STF_URL=http://192.168.0.102:7100
STF_TOKEN=09f2f7cfffbc4617ab9bce7313c9949e7fd1819628be48de99dab71ac3e88d46


if [ "$DEVICE_SERIAL" == "" ]; then
    echo "Please specify device serial using ENV['DEVICE_SERIAL']"
    exit 1
fi

if [ "$STF_URL" == "" ]; then
    echo "Please specify stf url using ENV['STF_URL']"
    exit 1
fi

if [ "$STF_TOKEN" == "" ]; then
    echo "Please specify stf token using using ENV['STF_TOKEN']"
    exit 1
fi

function add_device
{
    response=$(curl -X POST -H "Content-Type: application/json" \\
                 -H "Authorization: Bearer $STF_TOKEN" \\
                 --data "{\\"serial\\": \\"$DEVICE_SERIAL\\"}" $STF_URL/api/v1/user/devices)

    success=$(echo "$response" | jq .success | tr -d '"')
    description=$(echo "$response" | jq .description | tr -d '"')

    if [ "$success" != "true" ]; then
        echo "Failed because $description"
        return
    fi

    echo "Device $DEVICE_SERIAL added successfully"
}

function remote_connect
{
    response=$(curl -X POST \\
                 -H "Authorization: Bearer $STF_TOKEN" \\
                $STF_URL/api/v1/user/devices/$DEVICE_SERIAL/remoteConnect)

    success=$(echo "$response" | jq .success | tr -d '"')
    description=$(echo "$response" | jq .description | tr -d '"')

    if [ "$success" != "true" ]; then
        echo "Failed because $description"
        exit 1
    fi
    remote_connect_url=$(echo "$response" | jq .remoteConnectUrl | tr -d '"')

    adb connect $remote_connect_url

    echo "Device $DEVICE_SERIAL remote connected successfully"
}

function remove_device
{
    response=$(curl -X DELETE \\
                 -H "Authorization: Bearer $STF_TOKEN" \\
                $STF_URL/api/v1/user/devices/$DEVICE_SERIAL)

    success=$(echo "$response" | jq .success | tr -d '"')
    description=$(echo "$response" | jq .description | tr -d '"')

    if [ "$success" != "true" ]; then
        echo "Failed because $description"
        return
    fi

    echo "Device $DEVICE_SERIAL removed successfully"
}


adb disconnect ||:
remove_device ||:
add_device
remote_connect
echo "connect"
adb devices
#adb shell am start -W -n com.xueqiu.android/.view.WelcomeActivityAlias
#adb shell monkey -p com.xueqiu.android 200
sleep 2
adb shell monkey -vvv -p com.android.calculator2 200
adb disconnect
echo "disconnect"
remove_device
adb devices



多设备调用

minicap

./run.sh autosize & 
adb forward tcp:1717 localabstract:minicap
cd example
PORT=9002 node app.js

关闭