From b41b73fb49d02753de62d7a0048c1efc8ffcc4e3 Mon Sep 17 00:00:00 2001 From: kulikov0 <19497634+kulikov0@users.noreply.github.com> Date: Wed, 21 Oct 2026 11:55:08 +0200 Subject: [PATCH] e2e tests for blink --- headless/tests/.env.example | 1 + headless/tests/README.md | 17 +++++++++++++++-- headless/tests/platforms.sh | 12 ++++++++++++ headless/tests/run.sh | 4 ++-- headless/tests/scenarios.sh | 8 ++++++++ headless/tests/stand/netns-run.sh | 4 ++-- headless/tests/stand/stand.sh | 6 ++++-- 7 files changed, 44 insertions(+), 8 deletions(-) diff --git a/headless/tests/.env.example b/headless/tests/.env.example index 8055010..e1a3544 100644 --- a/headless/tests/.env.example +++ b/headless/tests/.env.example @@ -7,5 +7,6 @@ ROOM_TELEMOST="" ROOM_WBSTREAM="" ROOM_DION="" ROOM_BITRIX="" +ROOM_BLINK="" ALLOW_NEW_ROOMS=0 diff --git a/headless/tests/README.md b/headless/tests/README.md index bdde2aa..44b542c 100644 --- a/headless/tests/README.md +++ b/headless/tests/README.md @@ -12,8 +12,9 @@ No external network is used. ## Platforms and scenarios -Platforms: telemost, wbstream, dion, bitrix, vk. A platform skips the scenarios it -does not support: dion supports only connect and kick, vk only connect and dc. +Platforms: telemost, wbstream, dion, bitrix, blink, vk. A platform skips the scenarios it +does not support: dion supports only connect and kick, vk only connect and dc, blink +everything except kick. `vk` runs only when named, needs `relay/relay` from `./build-go.sh`, and opens the VK captcha in your browser. @@ -40,6 +41,18 @@ Each platform reads `cookies-.json` from the repository root. Export these from the desktop creator app. If a cookie file is missing, the harness skips that platform. +## Blink + +Blink has no guest access, so the creator and the joiner each need their own login. +Both can be the same account, but every login must be a separate QR scan. Create the +two files from the repository root, scanning each QR with the Blink app: + + ./headless/blink/headless-blink-creator --login --cookies cookies-blink.json + ./headless/blink/headless-blink-creator --login --cookies cookies-blink-joiner.json + +`ROOM_BLINK` is a chat id. The creator joins the call in that chat, and starts one if +the chat has no active call. The joiner's account must be a member of the chat. + ## Run in Docker The creator and joiner run in separate network namespaces so their WebRTC ICE does diff --git a/headless/tests/platforms.sh b/headless/tests/platforms.sh index 3822cbb..d97bde9 100644 --- a/headless/tests/platforms.sh +++ b/headless/tests/platforms.sh @@ -8,6 +8,8 @@ cookies_path() { wbstream) _f="cookies-wbstream.json" ;; dion) _f="cookies-dion.json" ;; bitrix) _f="cookies-bitrix.json" ;; + blink) _f="cookies-blink.json" ;; + blink_joiner) _f="cookies-blink-joiner.json" ;; *) _f="cookies-$_p.json" ;; esac _envname=$(printf 'COOKIES_%s' "$(echo "$_p" | tr 'a-z' 'A-Z')") @@ -28,6 +30,7 @@ room_value() { pf_select() { PF_NAME="$1" PF_JOINER_MODE="" + PF_JOINER_COOKIES="" case "$1" in vk) PF_CREATOR="$HEADLESS/vk/headless-vk-creator" @@ -69,6 +72,15 @@ pf_select() { PF_READY_RE="pub PC state: connected" PF_CAPS="connect dc kcp dual kick" ;; + blink) + PF_CREATOR="$HEADLESS/blink/headless-blink-creator" + PF_JOINER="$HEADLESS/blink-joiner/headless-blink-joiner" + PF_JOINER_COOKIES=$(cookies_path blink_joiner) + PF_LINK_FLAG="--room" + PF_CREATOR_ROOM_FLAG="--room" + PF_READY_RE="pub PC state: connected" + PF_CAPS="connect dc kcp dual" + ;; *) die "unknown platform: $1" ;; diff --git a/headless/tests/run.sh b/headless/tests/run.sh index f15f7ee..b26a5cd 100755 --- a/headless/tests/run.sh +++ b/headless/tests/run.sh @@ -16,7 +16,7 @@ CONNECT_TIMEOUT="${CONNECT_TIMEOUT:-45}" PROBE_TIMEOUT="${PROBE_TIMEOUT:-20}" KICK_TIMEOUT="${KICK_TIMEOUT:-30}" -ALL_PLATFORMS="telemost wbstream dion bitrix" +ALL_PLATFORMS="telemost wbstream dion bitrix blink" ALL_SCENARIOS="connect dc kcp dual kick" usage() { @@ -41,7 +41,7 @@ for _arg in "$@"; do usage exit 0 ;; - vk | telemost | wbstream | dion | bitrix) + vk | telemost | wbstream | dion | bitrix | blink) RUN_PLATFORMS="$RUN_PLATFORMS $_arg" ;; connect | dc | kcp | dual | kick) diff --git a/headless/tests/scenarios.sh b/headless/tests/scenarios.sh index 1e4c8ec..0ac9dd7 100644 --- a/headless/tests/scenarios.sh +++ b/headless/tests/scenarios.sh @@ -13,6 +13,11 @@ run_platform() { record SKIP "$1 (cookies missing)" return fi + if [ -n "$PF_JOINER_COOKIES" ] && [ ! -f "$PF_JOINER_COOKIES" ]; then + log "=== $1 SKIP (joiner cookies not found at $PF_JOINER_COOKIES) ===" + record SKIP "$1 (joiner cookies missing)" + return + fi if [ -z "$PF_ROOM" ] && [ "${ALLOW_NEW_ROOMS:-0}" != "1" ]; then log "=== $1 SKIP (no ROOM_$(echo "$1" | tr 'a-z' 'A-Z') set; refusing to create a new room. Set it in .env or pass ALLOW_NEW_ROOMS=1) ===" record SKIP "$1 (no room)" @@ -108,6 +113,9 @@ start_joiner() { return fi _flags=$(pf_variant_flags "$_variant") + if [ -n "$PF_JOINER_COOKIES" ]; then + _flags="$_flags --cookies $PF_JOINER_COOKIES" + fi $JOINER_WRAP "$PF_JOINER" "$PF_LINK_FLAG" "$JOIN_LINK" --socks-host "$JOINER_SOCKS_HOST" --socks-port "$JOINER_PORT" $_flags >"$JOINER_LOG" 2>&1 & JOINER_PID=$! track_pid "$JOINER_PID" diff --git a/headless/tests/stand/netns-run.sh b/headless/tests/stand/netns-run.sh index d273d1a..068906b 100755 --- a/headless/tests/stand/netns-run.sh +++ b/headless/tests/stand/netns-run.sh @@ -18,14 +18,14 @@ CONNECT_TIMEOUT="${CONNECT_TIMEOUT:-45}" PROBE_TIMEOUT="${PROBE_TIMEOUT:-25}" KICK_TIMEOUT="${KICK_TIMEOUT:-30}" -ALL_PLATFORMS="telemost wbstream dion bitrix" +ALL_PLATFORMS="telemost wbstream dion bitrix blink" ALL_SCENARIOS="connect dc kcp dual kick" RUN_PLATFORMS="" RUN_SCENARIOS="" for _arg in "$@"; do case "$_arg" in - vk | telemost | wbstream | dion | bitrix) RUN_PLATFORMS="$RUN_PLATFORMS $_arg" ;; + vk | telemost | wbstream | dion | bitrix | blink) RUN_PLATFORMS="$RUN_PLATFORMS $_arg" ;; connect | dc | kcp | dual | kick) RUN_SCENARIOS="$RUN_SCENARIOS $_arg" ;; *) log "unknown argument: $_arg" diff --git a/headless/tests/stand/stand.sh b/headless/tests/stand/stand.sh index c119f0f..78fd9d3 100755 --- a/headless/tests/stand/stand.sh +++ b/headless/tests/stand/stand.sh @@ -13,10 +13,12 @@ telemost/headless-telemost-creator \ wbstream/headless-wbstream-creator \ dion/headless-dion-creator \ bitrix/headless-bitrix-creator \ +blink/headless-blink-creator \ telemost-joiner/headless-telemost-joiner \ wbstream-joiner/headless-wbstream-joiner \ dion-joiner/headless-dion-joiner \ -bitrix-joiner/headless-bitrix-joiner" +bitrix-joiner/headless-bitrix-joiner \ +blink-joiner/headless-blink-joiner" usage() { cat >&2 <