testcafe
testcafe copied to clipboard
Add global validation for actions options
[closes #7293]
Purpose
If you pass an invalid option to any action, this option will be removed from the object, but you won't know about it. This can be misleading. Also, some actions can accept objects of different types with different properties. As a result, you will get unexpected behavior when mixing properties of different objects.
Approach
Add options validation in a base Assignable class. Refactor existing code, remove complex properties declaration(prop.subProp) and add separate options classes.
Pre-Merge TODO
- [x] Write tests for your proposed changes
- [x] Make sure that existing tests do not fail