RepositoryJavaScriptNLHà Lan
AB

abramenal/cypress-file-upload

File upload testing made easy

493sao
90fork
32issue
0lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: cypress

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: cypress-file-upload

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: cypress-io

#1 Repository của tháng

🚀 cypress-file-upload — Test upload file trong Cypress chuẩn chỉnh

Plugin giúp test upload file trở nên đơn giản và ổn định trong Cypress.

cypress-file-upload là một plugin cho Cypress, thêm lệnh tùy chỉnh .attachFile() giúp bạn test việc tải lên file thông qua các thành phần HTML như <input type="file">, kéo thả (drag-n-drop), hoặc cấu hình nâcao khác. Thay vì viết mã giả lập sự kiện thủ công, bạn chỉ cần gán file và tập trung vào kiểm thử logic người dùng.

✨ Điểm nổi bật

  • Cài đặt nhanh: Hỗ trợ npm, TypeScript và tích hợp vào cypress/support/commands.js
  • HTML5 file input: Gán file vào input bằng tên fixture hoặc đường dẫn
  • Hỗ trợ drag-n-drop: Dùng { subjectType: 'drag-n-drop' } để test kéo thả
  • Gửi nhiều file: Dùng mảng để gửi đồng thời nhiều file
  • Mã hóa tùy chỉnh: Hỗ trợ encoding cho file không phải JSON
  • Nội dung thô: Truyền trực tiếp nội dung file đã xử lý
  • Đổi tên file: Ghi đè tên file khi tải lên
  • File rỗng: Cho phép test với file trống bằng allowEmpty: true

💡 Vì sao đáng chú ý

Không cần viết mã giả lập sự kiện phứ tạp hay dùng cách tiếp cận không ổn định, plugin này cung cấp một API nhất quán để kiểm thử mọi loại hình upload file. Đặc biệt hữu ích khi test các tính năng liên quan đến hình ảnh, tài liệu, hoặc dữ liệu người dùng.


#Cypress #FileUpload #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
bahmutov/cypress-failed-log

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

195
Jun 6, 2026
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
scottschafer/cypressautomocker

cypress-based library for capturing APIs and replaying them as mocks

130
Dec 10, 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