How to modify the response based on POST body params #15633
              
                Unanswered
              
          
                  
                    
                      pstephenwille
                    
                  
                
                  asked this question in
                Component Testing
              
            Replies: 1 comment
-
| Unfortunately not at the moment, see #9302 It however is highly desirable, and PRs are out to make this so: #14543 | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a shared setup file that defines the intercepted routes. The default response for those routes is provided by JSON-server. In the individual test files, I override the route and response data that's specific to the test. This allows me to have a centrally defined route for most cases and only override certain ones needed to test a code path. The problem I'm having now is, I can't change the response data once the route is
interceptedin the shared file.I have a shared default route defined like so:
And I'd like to override it in the test like so
Is this even possible?
Perhaps I could only define the route in the tests that use it but that is now how our tests are structured.
Or perhaps a
cy.intercept(url).clearto allow us to remock the routeBeta Was this translation helpful? Give feedback.
All reactions