test(demo): check mobile h5 shell
This commit is contained in:
@@ -31,6 +31,21 @@ check_url() {
|
||||
echo "OK: $name"
|
||||
}
|
||||
|
||||
check_mobile_h5_shell() {
|
||||
local html href icon_url code
|
||||
html="$(curl -k -fsS "$MOBILE_URL/h5/")"
|
||||
[[ "$html" != *"tongji-collector"* && "$html" != *"WebTrack.gif"* && "$html" != *"uni-stat"* ]] || fail "mobile H5 includes uni statistics runtime"
|
||||
[[ "$html" != *"/h5/h5/"* ]] || fail "mobile H5 has duplicated /h5 base path"
|
||||
href="$(printf '%s' "$html" | sed -nE 's/.*<link rel="icon" href="([^"]+)".*/\1/p' | head -n 1)"
|
||||
[[ -n "$href" ]] || fail "mobile H5 missing favicon link"
|
||||
[[ "$href" == /* ]] || fail "mobile H5 favicon must use an absolute path"
|
||||
icon_url="${MOBILE_URL%/}${href}"
|
||||
code="$(curl -k -sS -o /tmp/wygj-demo-check.favicon -w '%{http_code}' "$icon_url")"
|
||||
[[ "$code" == "200" ]] || fail "mobile H5 favicon returned HTTP $code: $icon_url"
|
||||
contains mobile-uni/src/manifest.json '"enable": false'
|
||||
echo "OK: mobile H5 shell"
|
||||
}
|
||||
|
||||
pilot_sql_scalar() {
|
||||
docker exec wygj-mysql mysql -uroot -proot --default-character-set=utf8mb4 -N -B -D ry-vue -e "$1" 2>/dev/null
|
||||
}
|
||||
@@ -77,6 +92,7 @@ need curl
|
||||
|
||||
check_url "frontend" "$FRONTEND_URL/"
|
||||
check_url "mobile-uni" "$MOBILE_URL/h5/"
|
||||
check_mobile_h5_shell
|
||||
|
||||
tenant_payload="$(curl -k -fsS "$FRONTEND_URL/dev-api/auth/tenant/list")"
|
||||
[[ "$tenant_payload" == *'"tenantId":"000000"'* ]] || fail "tenant list missing tenant 000000"
|
||||
|
||||
Reference in New Issue
Block a user