telekom / testerra

Testerra is an integrated framework for automating tests for (web) applications.
https://docs.testerra.io/
Apache License 2.0
27 stars 15 forks source link

Fix/collected assertion layout check #432

Closed TobiasAdler closed 4 months ago

TobiasAdler commented 5 months ago

Description

The images of a layout check (actual, difference and expected) were wrongly assigned when one or multiple layout checks were performed in one testcase using CONTROL.collectAssertions with the LayoutCheck methods assertScreenshot or assertImage. The wrong linking of the layoutCheckContext and the errorContext could even happen if the layout check itself was passed.

Example:

@Test
public void test_layoutCheck() {
    CONTROL.collectAssertions(() -> {
                LayoutCheck.assertImage(absoluteFile1, "image1", 1.0f);
                LayoutCheck.assertImage(absoluteFile2, "image2", 1.0f);
                LayoutCheck.assertImage(absoluteFile3, "image3", 1.0f);
            }
    );
}

Report:

first assertion: no images
second assertion: images of the first assertion
third assertion: images of the second assertion

Type of change

Checklist: