Question

I have written this module in node js, which is an express middleware and will enable your node app with an API for accessing cloud storage services such as dropbox.

For example this will list the available services

wget http://localhost:6805/api/v1.0/services/list/

And this will list a directory of the user Dropbox

wget http://localhost:6805/api/v1.0/dropbox/exec/ls/path/to/folder/

Of course, the user must have connected his Dropbox account to the app. To do so, your app must call this

wget http://localhost:6805/api/v1.0/dropbox/connect/

Which returns an URL, which you will open to let the user authorize the access to the service (this is an oauth2 authorization mechanism). Then call this to finish the auth process

wget http://localhost:6805/api/v1.0/dropbox/login/

My question is : how to test the API? I mean functionnal tests. I could mock each service (Dropbox for example) but it may be a lot of work don't you think?

Was it helpful?

Solution

No answer yet, so I can say that for now, the only way I have found is to use selenium to simulate a browser.

I open a test page, and type my test login/password, just like a human would.

Then I run tests normally

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top