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 first classhigher order functions and iterators,immutability,pure functions,no side effects and functonsfunctors 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 comparedopposed to OOP (as page objects pattern in selenium world)Object oriented or a procedural approach.
Expectation: IIt would likebe 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. I would also like an explanation of Also some insights on how it can improve the code for test automation; my primary design goals are maintainability, code reuse, modifiability, flexibility,reusability and faster executionreadability.
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.