Skip to content

Conversation

@koppor
Copy link
Member

@koppor koppor commented Mar 10, 2020

Working on creating automated screenshots to builds/screenshots.

@JabRef JabRef deleted a comment from codecov bot Mar 10, 2020
@JabRef JabRef deleted a comment from codecov bot Mar 10, 2020
@JabRef JabRef deleted a comment from codecov bot Mar 10, 2020
@Start
public void onStart(Stage stage) throws JabRefException {
final JabRefPreferences preferences = JabRefPreferences.getInstance();
Globals.prefs = preferences;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary to overwrite the Globals.prefs ?

The current code also writes to the active preferences, which means that normal JabRef installations are affected as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overwriting: This basically is

Globals.prefs = preferences;
. - I tried to start a full JabRef as the screenshots will show a complete JabRef and not some mocked part.

Next step is to mock the preferences. Did not find out to do it in my JabRef timeslot (especially

prefs = Preferences.userNodeForPackage(PREFS_BASE_CLASS);
caused me headaches. Why is it in the constructor?). (Refs #2768.) I think, whole JabRef has to be rewritten to rely on
public interface PreferencesService {
. Maybe, that is too much and I just have to mock JabRefPreferences.

Thus, I went for the quick way to show an end-to-end way to get screenshots. In case I cannot do that "in time", I would suggest to split up the PR: A) work on having a clean way for the preferences B) finish the basis for others to add new screenshots.

JabRefGUI.getMainFrame().getOpenDatabaseAction().openFile(jabrefAuthorsBib, true);
// give database some time load
robot.interrupt(100);
DebugUtils.saveScreenshot(() -> ROOT.resolve("opened-database-dark-theme.png"), "").apply(stringBuilder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The saveScreenshot​(javafx.stage.Screen screen, ...) method should be more appropriate as you then capture only the JabRef window (instead of the complete screen).

@koppor koppor changed the title Add automated screenshots [WIP] Add automated screenshots Mar 11, 2020
@JabRef JabRef deleted a comment from codecov bot Mar 22, 2020
@codecov
Copy link

codecov bot commented Mar 25, 2020

Codecov Report

Merging #6089 into master will decrease coverage by 0.23%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6089      +/-   ##
============================================
- Coverage     41.52%   41.29%   -0.24%     
+ Complexity     6873     6842      -31     
============================================
  Files          1092     1092              
  Lines         46342    46337       -5     
  Branches       5563     5563              
============================================
- Hits          19245    19133     -112     
- Misses        25650    25758     +108     
+ Partials       1447     1446       -1
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/jabref/gui/JabRefFrame.java 0.17% <ø> (ø) 1 <0> (ø) ⬇️
src/main/java/org/jabref/JabRefMain.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ava/org/jabref/gui/util/JabRefResourceLocator.java 0% <0%> (-100%) 0% <0%> (-3%)
...org/jabref/gui/edit/ManageKeywordsDisplayType.java 0% <0%> (-100%) 0% <0%> (-1%)
.../main/java/org/jabref/gui/icon/JabRefIconView.java 0% <0%> (-73.34%) 0% <0%> (-4%)
...a/org/jabref/gui/fieldeditors/EditorTextField.java 0% <0%> (-53.34%) 0% <0%> (-2%)
.../logic/importer/fetcher/IsbnViaEbookDeFetcher.java 58.33% <0%> (-41.67%) 3% <0%> (-2%)
...org/jabref/logic/importer/fetcher/IsbnFetcher.java 52.63% <0%> (-36.85%) 7% <0%> (-1%)
...va/org/jabref/gui/fieldeditors/EditorTextArea.java 0% <0%> (-36.37%) 0% <0%> (-2%)
...ref/gui/util/component/TemporalAccessorPicker.java 0% <0%> (-21.96%) 0% <0%> (-2%)
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5ee20b...3dc2dd9. Read the comment docs.

@tobiasdiez
Copy link
Member

The following needs to be done:

@koppor
Copy link
Member Author

koppor commented Mar 29, 2020

One more link for the ADR regarding the service loader: https://stackoverflow.com/q/16104786/873282

@koppor koppor changed the title [WIP] Add automated screenshots Add automated screenshots Apr 23, 2020
@koppor koppor self-assigned this Apr 23, 2020
@koppor
Copy link
Member Author

koppor commented Jul 27, 2020

I think, #6089 (comment) was a show-stopper for me. Thus, no automated screenshots in 2020

@koppor koppor closed this Jul 27, 2020
@koppor koppor deleted the add-screenshots branch July 27, 2020 22:10
@koppor koppor added the status: freeze Issues posponed to a (much) later future label Jan 18, 2021
koppor pushed a commit that referenced this pull request Jul 1, 2022
3d3573c Update centre-de-recherche-sur-les-civilisations-de-l-asie-orientale.csl (#5988)
5de0fbe Update society-of-biblical-literature-fullnote-bibliography.csl (#5913)
04b6c7a Create revue-internationale-durbanisme.csl (#5974)
4a5bfe2 Update biological-reviews.csl (#6116)
957b2bc Update harvard-cite-them-right-no-et-al.csl (#6115)
e836a6c Update harvard-university-of-bath.csl (#6011)
b4a8dd7 Update and rename harvard-cite-them-right.csl to harvard-cite-them-ri… (#6113)
a198884 Update twentieth-century-music.csl (#6110)
81c1619 Update archaeonautica.csl (#5928)
fc46f1d Bump actions/cache from 2 to 3 (#6112)
fab57ed Bump actions/checkout from 2 to 3 (#6111)
519d594 [don't merge] chore: Included githubactions in the dependabot config (#6109)
a8aa898 Update universidade-estadual-de-alagoas-uneal-abnt.csl (#5915)
6191640 Update isnad-dipnotlu.csl (#5909)
d65a6ac Update isnad-metinici.csl (#5910)
830d337 Update technische-universitat-dresden-linguistik.csl (#6097)
81adc43 Update american-society-for-horticultural-science.csl (#6089)
b767623 Create south-african-law-journal.csl (#6092)
215e1e9 Create journal-of-lithic-studies.csl (#6080)
0740f8c Create eunomia-revista-en-cultura-de-la-legalidad.csl (#6095)
f93c809 Create endocrine-journal.csl (#6086)
3fdeb51 Revert "chore: Set permissions for GitHub actions (#6096)" (#6108)
35ebd1e chore: Set permissions for GitHub actions (#6096)
1cb8758 Create journal-fur-medienlinguistik (#6100)
f4b5f7f Update unified-style-sheet-for-linguistics.csl (#6098)
c3f856a Update advanced-materials.csl (#6103)
d1e7576 Bump diffy from 3.4.0 to 3.4.2 (#6107)
9e5e7ab Fix Dev Dynamics (#6099)
7234520 Add CSL style for the journal Developmental Dynamics (#6093)
ba8db05 Create independent style for vox-sanguinis.csl (#6085)
845dee0 Create meta.csl (#6088)
684bc3a Update universite-du-quebec-a-montreal.csl (#6087)
3602c18 Up-date & re-title pour-reussir/dionne (#6043)
0cc6e82 Fix Mainz Geography
cfc4cec Add DOI and fix printing author names in Population and Économie et statistique (#6079)
14e8b1d Update journal-of-neuroimaging.csl (#6084)
2c0e1f1 Update isnad-dipnotlu.csl (#6081)
02fdb9b Merge pull request #6082 from denismaier/patch-ube-muwi-note
9309378 removes default-locale

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 3d3573c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: freeze Issues posponed to a (much) later future

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants