Skip to content

Added GUI basic testing implementation#1768

Open
laim2003 wants to merge 19 commits intodevonfw:mainfrom
laim2003:GUI-testing-implementation
Open

Added GUI basic testing implementation#1768
laim2003 wants to merge 19 commits intodevonfw:mainfrom
laim2003:GUI-testing-implementation

Conversation

@laim2003
Copy link
Contributor

@laim2003 laim2003 commented Mar 24, 2026

This PR adds a basic UI test for ide-gui

Implemented changes:

  • Added AppBaseTest
  • Refactored MainController.java to support Dependency Injection
  • Fixed issues with headless testing

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal

@laim2003 laim2003 self-assigned this Mar 24, 2026
@laim2003 laim2003 added test related to testing and QA GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx internal Nothing to be added to CHANGELOG, only internal story labels Mar 24, 2026
@laim2003 laim2003 moved this from 🆕 New to 🏗 In progress in IDEasy board Mar 24, 2026
@laim2003
Copy link
Contributor Author

laim2003 commented Mar 25, 2026

Seems like the tests fail because a System environment variable is null in the GitHub Actions context, that points to the Project directory (IdeVariables.IDE_ROOT)

Current idea is to refactor MainController to allow Dependency Injection, and then supply the controller with a temporary mock project directory that we create in the test, instead of the directory from the System environment variable.

- AppBaseTest.java now generates mock project directory (in order for the test to work on the CI)
@laim2003
Copy link
Contributor Author

Seems like increasing the timeout limits did the trick!

@laim2003 laim2003 marked this pull request as ready for review March 25, 2026 16:35
@coveralls
Copy link
Collaborator

coveralls commented Mar 25, 2026

Pull Request Test Coverage Report for Build 23589507101

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 21 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.2%) to 70.636%

Files with Coverage Reduction New Missed Lines %
com/devonfw/ide/gui/App.java 9 0.0%
com/devonfw/ide/gui/MainController.java 12 66.67%
Totals Coverage Status
Change from base Build 23586480762: 0.2%
Covered Lines: 10827
Relevant Lines: 14711

💛 - Coveralls

Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

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

@laim2003 thanks for your PR and doing the ground-work for automated GUI testing. Great job 👍
BTW: Actually you revealed a bug in the GUI code that if IDE_ROOT is undefined we end up with a NullPointerException. The entire GUI is still in prototype state and needs rework.
But there is already #1295 open with some remaining sub-tasks addressing this.
Therefore, we can easily ignore this here and cleanup later in upcoming PRs.

Ready for merge.

@github-project-automation github-project-automation bot moved this from 🏗 In progress to 👀 In review in IDEasy board Mar 26, 2026
@hohwille hohwille added this to the release:2026.04.001 milestone Mar 26, 2026
@hohwille
Copy link
Member

For the record: The general infrastructure code for GUI tests like the static initializer block need to be moved to an abstract base class for GUI tests since this will not remain to be the only GUI test we ever have in the near future. We then want to reuse instead of doing copy&paste.

@laim2003
Copy link
Contributor Author

For the record: The general infrastructure code for GUI tests like the static initializer block need to be moved to an abstract base class for GUI tests since this will not remain to be the only GUI test we ever have in the near future. We then want to reuse instead of doing copy&paste.

Good point. I believe opening a seperate Issue would be a bit over the top. Maybe I can push this change today and include it in this PR

@laim2003 laim2003 marked this pull request as draft March 26, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx internal Nothing to be added to CHANGELOG, only internal story test related to testing and QA

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants