Add a screenshot capture item and use it to test rendering
AbandonedPublic

Authored by ahiemstra on Mar 3 2020, 2:35 PM.

Details

Reviewers
None
Summary

This adds the ItemCapture item to the test runner, which can be
used to capture images of items and compare them to a previous
version. It also updates the three chart tests to make use of
this and adds the images for these tests.

Test Plan

Autotests still pass.

Diff Detail

Repository
R1049 KQuickCharts
Branch
screenshot_autotest
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 23190
Build 23208: arc lint + arc unit
ahiemstra created this revision.Mar 3 2020, 2:35 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 3 2020, 2:35 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ahiemstra requested review of this revision.Mar 3 2020, 2:35 PM

I love the direction. +++++

autotests/ItemCapture.cpp
59

I don't like how we're saving files into the user's source directory directly.

I'm sure we'll get lots of people forgetting to add the files and claiming it works because make test works the second time.

And we'll get other people committing lots of _new.png files committed accidentally.


I think a new temp dir would be best, alternatively we check some env variable/arg that a user can set to specify they want to generate a baseline

81

Why are we replacing the image if it's slightly different?

autotests/ItemCapture.h
61

specify if 1% is

0.01 or 1 ?

autotests/qmltest.cpp
22

I don't know what QUICK_TEXT_MAIN does, but we probably want to make sure we have:

QGuiApplication::setAttribute(AA_DisableHighDpiScaling, true);
QGuiApplication::setDesktopSettingsAware(false);

QQuickWindow::setTextRenderType(the qt rendering)

that should help generating the same thing across machines

ahiemstra abandoned this revision.May 19 2020, 10:11 AM

Will continue this on Gitlab.