You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One test case reported an unexpected difference where elements were identical but in a different order. The current code failed to determine the elements that were the same.
The current logic to compare elements is as follows:
Compare the element names.
If the element names are the same, compare the values of "id" attribute if present.
If the elements are the same and "id" is not present, compare the values of "name" attribute if present.
An order difference is detected if any of the above conditions report an unequal result. Only id and name attributes are considered keys; all other attributes are considered non-key.
In the example, the elements names were all the same but they contain neither "id" nor "name" attributes. Therefore, they are all considered equal from an ordering perspective. The "value" attribute and element text are thus reported as changes of elements that seemingly have not moved.
The text was updated successfully, but these errors were encountered:
To correct this problem, a fourth step is added to element comparison: to compare the element text. This resolves the test case. That is, cases where the element name and text are the same, but the elements lack id or name attributes. However, it has the effect of changing the analysis of another case, where the elements are the same but only the text has changed. Before, this was reported as a replace of the text. Now is is reported as an element remove + add. This is considered a beneficial trade-off. Identical elements now correctly do not report a diff, while the other case is still reported as a diff but in a different way.
One test case reported an unexpected difference where elements were identical but in a different order. The current code failed to determine the elements that were the same.
The current logic to compare elements is as follows:
An order difference is detected if any of the above conditions report an unequal result. Only id and name attributes are considered keys; all other attributes are considered non-key.
In the example, the elements names were all the same but they contain neither "id" nor "name" attributes. Therefore, they are all considered equal from an ordering perspective. The "value" attribute and element text are thus reported as changes of elements that seemingly have not moved.
The text was updated successfully, but these errors were encountered: