From what I have read about functional programming, it is considered to be more concise, more testable, and have fewer side effects. Would it be good to use for UI test automation?
Context: I am working in protractor with JavaScript and JavaScript supports functional programming concepts to an good extent. So I explored and experimented with concepts like higher order functions,immutability,pure functions,no side effects and functors like map, reduce, and filter, but I could not get it to a meaningful state in the context of UI automation. Does anyone have experience using it with Protractor/nightwatch or another javascript based UI test automation framework who could share some insights on using a more functional approach opposed to Object oriented or procedural approach.
Expectation: It would be great if someone can share some code examples with a few typical automation use cases to explain it in the automation context, as opposed to generic programming scenarios. Also some insights on how it can improve the code for test automation; my primary design goals are maintainability, reusability and readability.
Example: To give an concrete typical scenario, in UI automation we need to interact with UI Grid and verify the content from an specific row and column based on some condition, and verify it with some expected values.