testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

Add global validation for actions options

Open Artem-Babich opened this issue 2 years ago • 0 comments

[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

Artem-Babich avatar Sep 07 '22 16:09 Artem-Babich