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: 
The reason is quick feedback. unit tests run much faster and selenium/protractor being e2e solutions runs slower. There is a clear separation between unit test and end to end testing. 

Please let us know in specific what you need to understand.
You can use this approach - "**VISUAL REGRESSION TESTING USING JEST, CHROMELESS AND AWS LAMBDA**" <https://novemberfive.co/blog/visual-regression-testing-jest-chromeless-lambda>