test(demo): check mobile h5 shell
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="icon" href="/h5/static/mentor.png" />
|
<link rel="icon" href="/static/mentor.png" />
|
||||||
<title>银城员工端</title>
|
<title>银城员工端</title>
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
|
|||||||
@@ -31,6 +31,21 @@ check_url() {
|
|||||||
echo "OK: $name"
|
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() {
|
pilot_sql_scalar() {
|
||||||
docker exec wygj-mysql mysql -uroot -proot --default-character-set=utf8mb4 -N -B -D ry-vue -e "$1" 2>/dev/null
|
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 "frontend" "$FRONTEND_URL/"
|
||||||
check_url "mobile-uni" "$MOBILE_URL/h5/"
|
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="$(curl -k -fsS "$FRONTEND_URL/dev-api/auth/tenant/list")"
|
||||||
[[ "$tenant_payload" == *'"tenantId":"000000"'* ]] || fail "tenant list missing tenant 000000"
|
[[ "$tenant_payload" == *'"tenantId":"000000"'* ]] || fail "tenant list missing tenant 000000"
|
||||||
|
|||||||
Reference in New Issue
Block a user