screenshot-tests-for-android icon indicating copy to clipboard operation
screenshot-tests-for-android copied to clipboard

Verification process does not account for missing screenshot

Open kylannjohnson opened this issue 8 years ago • 0 comments

When attempting a verification of screenshots, there seems to be a missing case: a missing screenshot in the run when compared to reference set

Below is the verification code in the python module. It iterates over the screenshots in the metadata.xml file and verifies against a "master" copy. However, if the metadata doesn't contain a reference to the master file, then no error will be raised.

I can see the rationale for this method if you've only run a sub-set of your tests and simply want to ensure that set is right. But what if you want to run them all (such as running a nightly build or gated checkin).

It seem that the opposite should used; reference should be the iterative case, not generated.

`def verify(self): self._output = tempfile.mkdtemp() self._record()

    root = self._get_metadata_root()
    for screenshot in root.iter("screenshot"):
        name = screenshot.find('name').text + ".png"
        actual = join(self._output, name)
        expected = join(self._realoutput, name)
        if not self._is_image_same(expected,
                                   actual):
            raise VerifyError("Image %s is not same as %s" % (actual, expected))

    shutil.rmtree(self._output)`

kylannjohnson avatar Feb 25 '16 21:02 kylannjohnson