- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 639
 
Add Playwright E2E testing framework #1836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            justin808
  wants to merge
  2
  commits into
  master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
justin808/add-playwright
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            2 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # frozen_string_literal: true | ||
| 
     | 
||
| if defined?(CypressOnRails) | ||
| CypressOnRails.configure do |c| | ||
| c.api_prefix = "" | ||
| c.install_folder = File.expand_path("#{__dir__}/../../e2e/playwright") | ||
| # WARNING!! CypressOnRails can execute arbitrary ruby code | ||
| # please use with extra caution if enabling on hosted servers or starting your local server on 0.0.0.0 | ||
| c.use_middleware = !Rails.env.production? | ||
| # c.use_vcr_middleware = !Rails.env.production? | ||
| # # Use this if you want to use use_cassette wrapper instead of manual insert/eject | ||
| # # c.use_vcr_use_cassette_middleware = !Rails.env.production? | ||
| # # Pass custom VCR options | ||
| # c.vcr_options = { | ||
| # hook_into: :webmock, | ||
| # default_cassette_options: { record: :once }, | ||
| # cassette_library_dir: File.expand_path("#{__dir__}/../../e2e/playwright/fixtures/vcr_cassettes") | ||
| # } | ||
| c.logger = Rails.logger | ||
| 
     | 
||
| # Server configuration for rake tasks (cypress:open, cypress:run, playwright:open, playwright:run) | ||
| # c.server_host = 'localhost' # or use ENV['CYPRESS_RAILS_HOST'] | ||
| # c.server_port = 3001 # or use ENV['CYPRESS_RAILS_PORT'] | ||
| # c.transactional_server = true # Enable automatic transaction rollback between tests | ||
| 
     | 
||
| # Server lifecycle hooks for rake tasks | ||
| # c.before_server_start = -> { DatabaseCleaner.clean_with(:truncation) } | ||
| # c.after_server_start = -> { puts "Test server started on port #{CypressOnRails.configuration.server_port}" } | ||
| # c.after_transaction_start = -> { Rails.application.load_seed } | ||
| # c.after_state_reset = -> { Rails.cache.clear } | ||
| # c.before_server_stop = -> { puts "Stopping test server..." } | ||
| 
     | 
||
| # If you want to enable a before_request logic, such as authentication, logging, sending metrics, etc. | ||
| # Refer to https://www.rubydoc.info/gems/rack/Rack/Request for the `request` argument. | ||
| # Return nil to continue through the Cypress command. Return a response [status, header, body] to halt. | ||
| # c.before_request = lambda { |request| | ||
| # unless request.env['warden'].authenticate(:secret_key) | ||
| # return [403, {}, ["forbidden"]] | ||
| # end | ||
| # } | ||
| end | ||
| 
     | 
||
| # # if you compile your asssets on CI | ||
| # if ENV['CYPRESS'].present? && ENV['CI'].present? | ||
| # Rails.application.configure do | ||
| # config.assets.compile = false | ||
| # config.assets.unknown_asset_fallback = false | ||
| # end | ||
| # end | ||
| end | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Scope Playwright to the dummy app or align versions across the repo
If Playwright runs only under
spec/dummy, keeping a second copy at the repo root adds install time and invites version drift. Prefer removing the root devDependency or ensure both places use the same version.Apply if scoping to dummy app only:
- "@playwright/test": "^1.55.1",Run to compare versions (root vs dummy):
🏁 Script executed:
Length of output: 73
Align @playwright/test versions across root and dummy
@playwright/test is ^1.55.1 in package.json but ^1.41.0 in spec/dummy/package.json; update the dummy app to ^1.55.1 or remove the root entry if you intend to scope Playwright solely under spec/dummy.
🤖 Prompt for AI Agents