0

I have an automated test scenario wherein 2 excel files are getting compared. This is currently being done using ApprovalTests verify method. Excel is being converted into string and is compared.

When this test was run for the first time, it failed as it did not have any approved file. I renamed received file to approved file and executed it again. It passed.

What I am unable to understand it this test always fails while running in entire suite but always passes when run individually and locally.

Has anyone faced this problem before? Any other ways this scenario can be automated?

Thanks in advance!

1 Answers1

0

Some work was done on this a while back: https://github.com/approvals/Approvals.Net.Excel/tree/master/ApprovalTests.Excel

The issue is that excel files are actual a zip file containing lot's of stuff. The way they are zipped makes them inconsistent. You actually need to normalize the zipping.

The solution used in the above report basically unzips both files and checks the content. ignoring things like timestamps on the file creation and randomness in the zipping compression algorithm.

llewellyn falco
  • 2,281
  • 16
  • 13