While developing any test automation framework we should keep in mind few key attributes as outlined below:
Separation of test script and data
There shouldn't be any need to change test script when test data needs to be changed.
Reusable
The structure of automation code should be such that most of the codes can be reused and developing new test scripts become easier. Code duplication should be minimized.
Maintainable
Test scripts should be easy to maintain. Codes written should be of the same quality as actual application code and follow good coding practices. Following patterns like Page Object, Factory, etc will ultimately help in minimizing maintenance effort.
Configurable
No hard-coding anywhere. Almost everything should be configurable - test environment information, browser(s) to run, order-of-execution, wait limits, reporting format, etc.
Better Reporting
Should support different report formats for different stakeholders. Each format should contain just enough information. Too much information will ultimately discourage the stakeholders to look into the reports.
Integration with CI/CD
Continuous integration and delivery is a must in today's software development space and test automation is a key component of CI/CD. Test automation framework should have ready integration with CI/CD ecosystem.
Exception Handling
Should support handling exception/alternate scenarios. Framework should support building scripts which can handle conditional execution.
Test Logging
Logging is now very important. Gone are the days when testers used to run automated tests staring at a screen and troubleshooting as soon as a test fail. Tests are going to run parallelly across multiple machines unattended and may be in headless mode. Unless there is excellent error logging capability it will be impossible to troubleshoot failures - especially the sporadic ones.