News for hackers. Stuff that matters.
Re:What Is Proper Continuous Integration? by lucaspiller on Friday March 03, 2017 @10:09AM (#13783314)
For those using Selenium or something similar, do you have any tips for making test suites fast? Usually I just test the main flows with Selenium, then go more indepth with unit-tests where parts of the application are mocked out - but it's a trade off between accuracy and speed.
Re:What Is Proper Continuous Integration? by cstejerean on Friday March 03, 2017 @10:39AM (#13783550)
That's a good trade off though, and not just for speed. Selenium tests are more difficult to write and take more effort to maintain. You should definitely test as much of your application as you can with unit tests and integration tests. The end to end tests with something like Selenium should then focus on the type of bugs that you couldn't catch with the lower level tests.

I've seen situations where people had Selenium tests for every possible validation error on a form. A lower level test would have been sufficient to test all validation permutations and making sure they return the right error message, and then a single high level test can ensure that when an error message is returned it is properly rendered on the screen.

Re:What Is Proper Continuous Integration? by blktiger on Friday March 03, 2017 @11:39AM (#13784032)
If you haven't encountered the concept before, I recommend looking at the testing pyramid[1]. Basically the idea is that UI/Functional tests take a long time to run so you want just enough to test the main, important flow in the application while you want a ton of unit tests because they run quickly and give you very targeted feedback about what might be broken.

[1] https://martinfowler.com/bliki/TestPyramid.html

Re:What Is Proper Continuous Integration? by markoa on Friday March 03, 2017 @10:42AM (#13783580)
I'd advise definitely covering all usage scenarios with Selenium. And then parallelize.

Overall unit tests should greatly outnumber UI/integration/acceptance tests. And when you catch a bug with Selenium test, replicate it at the right place with a unit test. Look up "test pyramid" if you're perhaps not familiar with it.

Re:What Is Proper Continuous Integration? by dhpe on Friday March 03, 2017 @11:31AM (#13783954)
- Test cases should be designed to allow parallel execution (they should not interfere with each other)

- Do not use sleep() for synchronisation - use explicit waits (e.g. wait until element is visible, then proceed immediately)

Re:What Is Proper Continuous Integration? by vojant on Friday March 03, 2017 @10:29AM (#13783469)
Run tests in parallel, only way too make it fast.