clean the environement after each spec with e2e

25 views
Skip to first unread message

Guirec Corbel

unread,
Jan 3, 2015, 7:01:00 AM1/3/15
to ang...@googlegroups.com
Hi,

I'm a Ruby/Rails programmer and I usually do acceptance specs with Capybara and DatabaseCleaner. After each spec, the database is deleted and clean again. I'm looking to do the same think with Angular. Is it possible to have something like that with e2e tests? Is it preferable to mock the server? What can I do?

Thanks for your help!

Mohan Radhakrishnan

unread,
Jan 3, 2015, 11:58:07 PM1/3/15
to ang...@googlegroups.com
Actually I have similar questions. I would like to separate test data, HTTP mocks(Restangular) and Angular UI tests into separate suites.
The Jasmine code that I have inherited looks scary now. Can I test HTML 5 UI to check if Angular model is accessible ?

What is a good resource for Angular mocks dealing with a e2e setup like this ?

Thanks,
Mohan

Anton Trapp

unread,
Jan 4, 2015, 12:30:30 AM1/4/15
to ang...@googlegroups.com
After a lot of problems I am using rspec/capybara (and database cleaner) for the Angular e2e tests. So I can use FactoryGirl for my test data, authentication helpers, ... - and everything is working perfect without any troubles. I don't like testing only two different things (API and frontend only with mocked API) seperate - always missing some bugs in such scenarios. Can use this for load tests too. So why don't you use Capybara only because you are using a different frontend framework?

Guirec Corbel

unread,
Jan 4, 2015, 4:46:20 AM1/4/15
to ang...@googlegroups.com
I don't like to use Rails because I think the frontend and the backend should be independent. My angular app have to consume a Rest API but I don't care where the data come from. Furthermore, I have to have an open-source application. I don't want to force the contributor to install Rails to develop a JS app.
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/i_RFooLy7E4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Anton Trapp

unread,
Jan 4, 2015, 4:52:45 AM1/4/15
to ang...@googlegroups.com
You don't have to use anything from the frontend part ;)
Rails is great for constructing the REST API. At one of my projects I have the backend (Rails) even in it's own repository. So the frontend guys just check it out and run the tests. With rspec even non ruby developers where able to write the tests within minutes. But you can try to clean the database in a generic solution for any backend. If you find any useful sulution please tell me ;)
Reply all
Reply to author
Forward
0 new messages