mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-03 21:54:21 +01:00
feat(e2e): enhance end-to-end testing setup with new scripts and capture cases
- Updated package.json to include new E2E scripts for execution and snapshot capturing. - Added new capture cases for the "new-project-modal" and "start-new-chat" functionalities in the E2E tests. - Increased wait times in session detail captures to ensure elements are fully loaded before interactions. - Introduced new shell scripts for starting the server and capturing snapshots, improving the E2E testing workflow. - Updated NewChatModal and SessionsTab components to include data-testid attributes for better test targeting.
This commit is contained in:
7
scripts/e2e/capture_snapshots.sh
Executable file
7
scripts/e2e/capture_snapshots.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
export GLOBAL_CLAUDE_DIR=$(git rev-parse --show-toplevel)/mock-global-claude-dir
|
||||
|
||||
pnpx tsx ./e2e/captureSnapshot/index.ts
|
||||
33
scripts/e2e/exec_e2e.sh
Executable file
33
scripts/e2e/exec_e2e.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
kill_process_group() {
|
||||
local pid=$1
|
||||
local sig=${2:-TERM}
|
||||
|
||||
local children=$(pgrep -P $pid 2>/dev/null || true)
|
||||
for child in $children; do
|
||||
kill_process_group $child $sig
|
||||
done
|
||||
|
||||
kill -$sig $pid 2>/dev/null || true
|
||||
}
|
||||
|
||||
# cleanup関数を定義してtrapで確実に実行
|
||||
cleanup() {
|
||||
if [ -n "${SERVER_PID:-}" ]; then
|
||||
echo "Killing server (PID: $SERVER_PID) and its process tree..."
|
||||
kill_process_group $SERVER_PID KILL
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
./scripts/e2e/start_server.sh & SERVER_PID=$!
|
||||
echo "Server started. pid=$SERVER_PID"
|
||||
|
||||
sleep 5 # 即時起動するが、一応少し待っておく
|
||||
|
||||
./scripts/e2e/capture_snapshots.sh
|
||||
echo "Completed capturing screenshots. Killing server..."
|
||||
11
scripts/e2e/start_server.sh
Executable file
11
scripts/e2e/start_server.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
export PORT=4000
|
||||
export GLOBAL_CLAUDE_DIR=$(git rev-parse --show-toplevel)/mock-global-claude-dir
|
||||
|
||||
echo "Check directory structure in $GLOBAL_CLAUDE_DIR:"
|
||||
ls -l $GLOBAL_CLAUDE_DIR
|
||||
|
||||
node ./dist/index.js
|
||||
Reference in New Issue
Block a user