Compare

The Compare assertion interface is as follows:

A Compare assertion is used for comparing 2 values. In the Expected value type field you should specify the type of values you want to compare (strings, numbers or JSON objects).

A set of available operations that you can select in the Operator field depends on the type you chose. For strings and numbers, you can use the following operators:

  • equal - checks if the values are equal

  • not equal - checks if the values are not equal

  • greater - checks if one value is greater than another one

  • greater or equal - checks if one value is greater than another or equal to it

  • less - checks if one value is less than another one

  • less or equal - checks if one value is less than another or equal to it

The following operators are available for comparing objects:

  • equal - checks if two object structures are equal

  • not equal - checks if the object structures are different

  • is subset of - checks if one structure is a subset of another structure

  • is superset of - checks if one structure is a superset of another structure

Error Fixing

The error fixing algorithm depends on the comparator type.

  • equal - the current value is assigned to the expected one

  • not equal - the comparator type changes to equal

  • greater - the comparator type changes to greater or equal and the current value is assigned to the expected one

  • greater or equal - the current value is assigned to the expected one

  • less - the comparator type changes to less or equal and the current value is assigned to the expected one

  • less or equal - the current value is assigned to the expected one

File Representation

The Assertion is of the compare type in the file. The type description can be found in the Assertion file representation documentation in the #/definitions/CompareAssertion definition.

Last updated

Was this helpful?