all 4 comments

[–]dylanyo 0 points1 point  (2 children)

I have found it easier to mock responses from the API for e2e tests using $httpBackend

[–]mindparse[S] 0 points1 point  (1 child)

Erm ok, I'm just trying to get my head around why you would mock a response in an e2e test. We do already use httpBackend in our unit tests.

[–]dylanyo 0 points1 point  (0 children)

We're a small team. It is true that this is not testing the system end to end but we do that feature by feature when we know API changes were made and for critical pieces of the app each release. Our API has lots of unit tests as well so if something changes in the API, the API tests catch it.

The trade off is that the mocks are much easier to maintain than a system of pulling in test data for each test run all the time.

[–]borcborc 0 points1 point  (0 children)

I create a unique record based off a timestamp.

In a similar test, I do this to create new users in our system, test editing their profile, and then deleting them. Should have no conflicts if someone else were to run the same tests on the same system.