You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project where I wanted to do the testing using Cypress: https://www.cypress.io/
It took me some time to figure out how to best integrate Cypress and ng-apimock, but this is what I ended up doing:
Assuming ng-apimock is running on port 8101. Define the following custom cypress commands in cypress/support/commands.js:
I'd love to hear if I should be doing something differently. If you agree this is the correct way of integrating ng-apimock with Cypress could you add this to the ng-apimock documentation?
It would be super awesome if there is some kind of cypress-commands.js file in the ng-apimock package which we can simply import in cypress/support/commands.js
I believe implementing that would look something like this: ng-apimock/lib/cypress/cypress-commands.js:
Nice that you are also trying to use ng-Apimock with a different framework then Protractor. I'm currently also investigating the use of ng-Apimock with Webdriver.io i.c.m. native mobile apps.
I also talked about this with @mdasberg to pull out some logic from ng-Apimock template for Protractor to a more generic api that can be used by any framework. This will definitely help in getting that done ;-)
I'm working on a project where I wanted to do the testing using Cypress: https://www.cypress.io/
It took me some time to figure out how to best integrate Cypress and ng-apimock, but this is what I ended up doing:
Assuming ng-apimock is running on port 8101. Define the following custom cypress commands in
cypress/support/commands.js
:You can then use these commands in your tests as follows:
cypress/integration/example_spec.js
:I'd love to hear if I should be doing something differently. If you agree this is the correct way of integrating ng-apimock with Cypress could you add this to the ng-apimock documentation?
It would be super awesome if there is some kind of
cypress-commands.js
file in the ng-apimock package which we can simply import incypress/support/commands.js
I believe implementing that would look something like this:
ng-apimock/lib/cypress/cypress-commands.js
:cypress/support/commands.js
:I think it would be cooler though if we don't have to pass in the host and port, because ng-apimock should already know where it is running.
The text was updated successfully, but these errors were encountered: