Skip to content

Commit 5cea37d

Browse files
authored
Add comprehensive documentation to improve developer experience (#180)
This PR addresses multiple user pain points by adding extensive documentation that covers troubleshooting, best practices, and framework-specific guides. Key Improvements: Documentation Structure: - Added TROUBLESHOOTING.md with solutions to common issues (database errors, webpack compilation, factory loading, authentication, parallel testing) - Added PLAYWRIGHT_GUIDE.md providing complete Playwright support documentation with feature parity to Cypress functionality - Added VCR_GUIDE.md covering both insert/eject and use_cassette modes with GraphQL-specific configuration examples - Added BEST_PRACTICES.md with recommended patterns for test organization, performance optimization, and security - Added DX_IMPROVEMENTS.md summarizing all developer experience enhancements Enhanced README: - Restructured with Quick Start section for new users - Added clear navigation to specialized guides - Improved visibility of key features and use cases Rake Tasks and Server Management: - Documented new rake tasks (cypress:open, cypress:run, playwright:open, playwright:run) - Added server lifecycle hooks documentation (before_server_start, after_server_start, after_transaction_start, after_state_reset, before_server_stop) - Included migration guide from manual server management to automated approach - Added cypress-rails compatibility guide Issues Addressed: Directly resolves documentation gaps for issues #175 (VCR errors), #169 (Playwright fixtures), #160 (VCR modes), #157 (environment config), #155 (database errors), #152 (server management), #146 (webpack errors), #137 (authentication), #119 (parallel testing), #118 (headless mode), #114 (transactional fixtures) Impact: For new installations: Provides clear onboarding path with quick start guide and comprehensive examples For existing installations: Offers solutions to common problems and migration guides for new features without requiring code changes Breaking Changes: None Security Implications: Adds documentation for secure command handling and authentication best practices
1 parent d26d966 commit 5cea37d

File tree

9 files changed

+2285
-9
lines changed

9 files changed

+2285
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If migrating from the `cypress-rails` gem:
5151
```ruby
5252
# Remove
5353
gem 'cypress-rails'
54-
54+
5555
# Add
5656
gem 'cypress-on-rails', '~> 1.0'
5757
```

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,28 @@ Consider first learning the basics of Playwright before attempting to integrate
4747

4848
* [Good start Here](https://playwright.dev/docs/writing-tests)
4949

50+
## Quick Start
51+
52+
```bash
53+
# 1. Add to Gemfile
54+
gem 'cypress-on-rails', '~> 1.0'
55+
56+
# 2. Install and generate
57+
bundle install
58+
bin/rails g cypress_on_rails:install
59+
60+
# 3. Run tests (new rake tasks!)
61+
bin/rails cypress:open # Open Cypress UI
62+
bin/rails cypress:run # Run headless
63+
```
64+
65+
For Playwright:
66+
```bash
67+
bin/rails g cypress_on_rails:install --framework playwright
68+
bin/rails playwright:open # Open Playwright UI
69+
bin/rails playwright:run # Run headless
70+
```
71+
5072
## Overview
5173

5274
Gem for using [cypress.io](http://github.com/cypress-io/) or [playwright.dev](https://playwright.dev/) in Rails and Ruby Rack applications to control state as mentioned in [Cypress Best Practices](https://docs.cypress.io/guides/references/best-practices.html#Organizing-Tests-Logging-In-Controlling-State).
@@ -64,7 +86,16 @@ Has examples of setting up state with:
6486
* scenarios
6587
* custom commands
6688

67-
## Resources
89+
## Documentation
90+
91+
### 📚 Essential Guides
92+
* **[Best Practices Guide](docs/BEST_PRACTICES.md)** - Recommended patterns and practices
93+
* **[Troubleshooting Guide](docs/TROUBLESHOOTING.md)** - Solutions to common issues
94+
* **[Playwright Guide](docs/PLAYWRIGHT_GUIDE.md)** - Complete Playwright documentation
95+
* **[VCR Integration Guide](docs/VCR_GUIDE.md)** - HTTP recording and mocking
96+
* **[DX Improvements](docs/DX_IMPROVEMENTS.md)** - Recent improvements based on user feedback
97+
98+
### 🎥 Resources
6899
* [Video of getting started with this gem](https://grant-ps.blog/2018/08/10/getting-started-with-cypress-io-and-ruby-on-rails/)
69100
* [Article: Introduction to Cypress on Rails](https://www.shakacode.com/blog/introduction-to-cypress-on-rails/)
70101

0 commit comments

Comments
 (0)