mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-03-13 20:53:47 +08:00
* test(e2e): phase-2 add office and zip smoke coverage * test(e2e): address copilot review for fixture stability and CI python setup * test(e2e): fix preflight fixture scope and path handling * test(e2e): harden fixture preflight and remove duplicate generation * test(e2e): remove redundant zip install and cleanup temp zip dir * test(e2e): ensure zip dependency and unify python command in docs * docs(e2e): align README with npm gen scripts and python3 usage
1.2 KiB
1.2 KiB
kkFileView E2E MVP
This folder contains a first MVP of end-to-end automated tests.
What is covered
- Basic preview smoke checks for common file types (txt/md/json/xml/csv/html/png)
- Office Phase-2 smoke checks (docx/xlsx/pptx)
- Archive smoke check (zip)
- Basic endpoint reachability
- Security regression checks for blocked internal-network hosts (
10.*) on:/onlinePreview/getCorsFile
Local run
- Build server jar:
mvn -q -pl server -DskipTests package
- Install deps + browser:
cd tests/e2e
npm install
npx playwright install --with-deps chromium
pip3 install -r requirements.txt
Prerequisite: ensure
zipcommand is available in PATH (used forsample.zipfixture generation).
- Generate fixtures and start fixture server:
cd /path/to/kkFileView
npm run gen:all
cd tests/e2e/fixtures && python3 -m http.server 18080
- Start kkFileView in another terminal:
JAR_PATH=$(ls server/target/kkFileView-*.jar | head -n 1)
KK_TRUST_HOST='*' KK_NOT_TRUST_HOST='10.*,172.16.*,192.168.*' java -jar "$JAR_PATH"
- Run tests:
cd tests/e2e
KK_BASE_URL=http://127.0.0.1:8012 FIXTURE_BASE_URL=http://127.0.0.1:18080 npm test