zinserjan / wdio-visual-regression-service

Visual regression service for WebdriverIO.
MIT License
102 stars 39 forks source link

LocalCompare 'updates the reference image...' test fails #3

Closed meleyal closed 7 years ago

meleyal commented 8 years ago

I see the following error when running the unit tests:

1) LocalCompare afterScreenshot updates the reference image when changes are in tolerance:
     AssertionError: File should be modified: expected 1466169655000 to be above 1466169655000

Comparing the stat calls the files appear identical:

first run - create reference file
statsFirst { dev: 16777223,
  mode: 33188,
  nlink: 1,
  uid: 501,
  gid: 20,
  rdev: 0,
  blksize: 4096,
  ino: 30557209,
  size: 293,
  blocks: 8,
  atime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST),
  mtime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST),
  ctime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST),
  birthtime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST) }
Image is within tolerance or the same. Updating base image
statsSecond { dev: 16777223,
  mode: 33188,
  nlink: 1,
  uid: 501,
  gid: 20,
  rdev: 0,
  blksize: 4096,
  ino: 30557209,
  size: 293,
  blocks: 8,
  atime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST),
  mtime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST),
  ctime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST),
  birthtime: Fri Jun 17 2016 14:20:55 GMT+0100 (BST) }
meleyal commented 8 years ago

Could this be a bug in fs.outputFile from fs-extra? My guess is the file is not touched if it's identical:

log(`Image is within tolerance or the same. Updating base image`);
await fs.outputFile(referencePath, base64Screenshot, 'base64');
meleyal commented 8 years ago

Issue here: https://github.com/jprichardson/node-fs-extra/issues/253

zinserjan commented 8 years ago

Works for me on windows & linux. Travis works also.

Which OS are you using? Maybe it's also an issue with the file system.

meleyal commented 8 years ago

OSX 10.11.5 (El Capitan)