Here's my issue, steb by step :)) I thought it reads better this way, unlike a wall of text pitifully trying to explain my very domain-specific problem.
1) We have a Angular.js app with PHP back-end backed with MongoDB storage.
2) Protractor for End-to-end tests.
3) Need to test pages which alter the database, i.e. registration scenario - I'm going through all registration steps in a test, so the db gets a new user record.
4) Predictably, test will fail after it was run, since the db has a record for the test user and no registration is needed - user is redirected to homepage instead.
I was thinking to get a mongodb package for node.js, and interact with a DB in tests.
But it just doesn't seem right: config files for DB connection are in a php files on the backend, while I'm trying to write tests for purely front-end part of our app.
Any ideas?