RepositoryJavaScriptUSHoa Kỳ
BA

bahmutov/cypress-failed-log

Saves the Cypress test command log as a JSON file if a test fails

195sao
32fork
23issue
2lượt xem

🛠️ Log lệnh thất bại từ Cypress ra JSON để debug nhanh

Tự động lưu toàn bộ log lệnh khi một test Cypress thất bại.

cypress-failed-log là một plugin nhỏ cho Cypress.io, giúp bạn không bỏ sót bất kỳ lệnh nào dẫn đến lỗi. Khi test thất bại, plugin sẽ ghi lại toàn bộ dãy lệnh đã thực hiện cùng thông tin chi tiết vào file JSON trong thư mục cypress/logs/.

✨ Điểm nổi bật

  • Cài đặt nhanh: chỉ cần npm install --save-dev cypress-failed-log và thêm require('cypress-failed-log') vào cypress/support/e2e.js.
  • Hỗ trợ Cypress 10: cấu hình qua cypress.config.js bằng require('cypress-failed-log/on')(on).
  • Log ra terminal: hiển thị các lệnh bao gồm cả lệnh gây lỗi trực tiếp trong terminal khi chạy test.
  • Lưu JSON chi tiết: gồm tên spec, tiêu đề test, tên suite, lỗi test và danh sách lệnh theo thứ tự thực thi.
  • Dễ tích hợp CI: file JSON có thể được dùng để phân tích lỗi tự động trong pipeline.
  • Hỗ trợ debug: bật thông điệp debug qua localStorage.debug = 'cypress-failed-log' trong DevTools.

💡 Vì sao đáng chú ý

Không giống như cách thủ công phải mở Cypress UI để xem log lệnh, cypress-failed-log tự động thu thập và lưu trữ chúng ngay lúc test chạy. Điều này đặc biệt hữu ích khi chạy test trên môi trường CI nơi không thể truy cập giao diện Cypress. Plugin giúp giảm thời gian debug đáng kể bằng cách cung cấp bản ghi chính xác từng bước dẫn đến lỗi.


#Cypress #Testing #JavaScript #OpenSource #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryJavaScript
meinaart/cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io

493
Sep 16, 2026
RepositoryJavaScript
abramenal/cypress-file-upload

File upload testing made easy

493
May 30, 2023
RepositoryJavaScript
cypress-io/github-action

GitHub Action for running Cypress end-to-end & component tests

1.5k
Nov 25, 2026
RepositoryJavaScript
LironEr/cypress-mochawesome-reporter

Zero config Mochawesome reporter for Cypress with screenshots and videos

185
Oct 2, 2026
RepositoryJavaScript
Shelex/cypress-allure-plugin

cypress plugin to use allure reporter api in tests

170
May 17, 2025
RepositoryJavaScript
cypress-io/cypress-xpath

Adds XPath command to Cypress test runner

145
Oct 13, 2022
RepositoryJavaScript
bahmutov/add-typescript-to-cypress

Quickly adds TypeScript spec support to Cypress

107
Nov 16, 2026
RepositoryJavaScript
elaichenkov/cy-verify-downloads

Cypress custom command to wait and verify that file has been downloaded

71
Jan 26, 2026
RepositoryJavaScript
bahmutov/cypress-watch-and-reload

Reloads Cypress when one of the watched files changes

57
Nov 16, 2026