RepositoryHTMLUSHoa Kỳ
SH

shakacode/cypress-playwright-on-rails

Use Cypress or Playwright with Rails scenarios, factories, fixtures, app commands, and clean test data.

456sao
63fork
23issue
4lượt xem

🧪 Cypress + Playwright trên Rails, không còn phải chọn

Chạy Cypress hay Playwright trong Rails app, truy cập thẳng tới database, factory_bot, fixtures và dọn dẹp dữ liệu sau mỗi test.

cypress-playwright-on-rails (tên gem thực tế: cypress-on-rails) là một Ruby gem giúp tích hợp Cypress hay Playwright vào ứng dụng Ruby on Rails. Thay vì phải mock API hay dựng server riêng, gem này cho phép chạy code Ruby trong bối cảnh test — truy cập trực tiếp tới database, factory_bot, fixtures, và các lệnh tùy chỉnh.

Được phát triển bởi ShakaCode, cùng tác giả nổi tiếng với React on Rails Gem.

✨ Điểm nổi bật

  • Hỗ trợ cả Cypress và Playwright: Chọn framework tùy ý khi cài đặt bằng flag --framework.
  • Tích hợp sâu với Rails: Dùng database_cleaner, factory_bot, fixtures, scenarios ngay trong test.
  • Tự động sinh lệnh rake: cypress:open, cypress:run, playwright:open, playwright:run.
  • Dọn dẹp dữ liệu tự động: Tránh ô dữ liệu rác giữa các test nhờ database_cleaner.
  • Cấu hình linh hoạt: Hỗ trợ custom install folder, API prefix, cài đặt qua npm.
  • Tài liệu đầy đủ: Có hướng dẫn Best Practices, Troubleshooting, Playwright Guide, VCR Integration.

💡 Vì sao đáng chú ý

Thay vì cách truyền thống phải mock toàn bộ backend hoặc dựng một server test riêng, gem này cho phép test chạm trực tiếp vào logic Ruby — giúp test nhanh hơn, ít giả lập hơn. Đặc biệt hữu ích với các dự án Rails lớn cần kiểm thử UI phức tạp nhưng vẫn muốn giữ logic test trong môi trường Rails thực.


#Cypress #Playwright #RubyOnRails #E2ETesting #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.

RepositoryTypeScript
e2e-inc/e2e

Next generation e2e testing framework for web and mobile apps.

14.5k
Nov 30, 2026
RepositoryRuby
activerecord-hackery/ransack

Search everywhere and in a hurry!

5.9k
Nov 22, 2026
RepositoryHTML
dmtrKovalenko/cypress-real-events

Fire native system events from Cypress.

840
Nov 13, 2026
RepositoryHTML
wlsf82/cypress-do-zero-a-nuvem

Repositório do curso "Cypress, do Zero à Nuvem" da Escola Talking About Testing.

192
Jul 13, 2024
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026
RepositoryTypeScript
cypress-io/cypress

Fast, easy and reliable testing for anything that runs in a browser.

51.0k
Nov 27, 2026
RepositoryJavaScript
DevExpress/testcafe

A Node.js tool to automate end-to-end web testing.

9.9k
Nov 26, 2026
RepositoryTypeScript
cypress-io/cypress-realworld-app

A payment application to demonstrate real-world usage of Cypress testing methods, patterns, and workflows.

5.9k
Nov 25, 2026