Question: I am writing unit testcases for a UI Framework using **Mocha**, **Chai** and **Karma**. I have analysed before whether to use selenium webdriver to do testing, but since most of the test cases involve working with DOMElement I have found it difficult to be working with selenium though javascript version( **WebDriverJS** ) is available.

Even when I checked other UI Frameworks like **jquery ui**, **kendo**, **semantic**, **foundation** etc.. they have used javascript frameworks like **jasmine**, **qunit** etc.. for testing rather than selenium. 

What could be the reason that UI Framework developers do not prefer Selenium?

Answer: 
Selenium is more designed for doing end-to-end testing, where it simulates actions within a browser. Jasmine and QUnit are both unit testing frameworks for testing the code. If you're looking to do end-to-end tests that are more compatible with JS, check out Protractor—it's made for AngularJS apps. Otherwise, if you're unit testing, you should avoid Selenium and use one of the unit testing frameworks.
You can use this approach - "**VISUAL REGRESSION TESTING USING JEST, CHROMELESS AND AWS LAMBDA**" <https://novemberfive.co/blog/visual-regression-testing-jest-chromeless-lambda>