Here goes the featured image. I managed to upload the featured image. When I click on Add Media, nothing happend. Chrome dev tools Javascript console reports an exception. This is not consistent with WordPress history, user desire, claims, comparable product, simmilar product feature, feature purpose. Enough to be sure that this is a bug [source].
TL;DR
Sometimes in automated check, you need to compare actual with the expected array. We explain heuristic that we use for reporting errors on array difference.
A heuristic is simple. Do not fail on the first difference. Instead, catch RSpec diff exception and add exception message, that has details about element difference, to an array of differences. Here is the code example:
diff = [] actual.each_with_index { |actual,index| begin expect(actual[:nodename]).to eq(expected[index][:nodename]) expect(actual[:type]).to eq(expected[index][:type]) expect(actual[:softwarerelease]).to eq(expected[index][:softwarerelease]) rescue Exception => e diff << e.message end } puts diff
The actual is computed array and expected is oracle array. each_with_index is a Ruby array method that enumerates through array elements calculating at the same time index position in the array.