Skip to content

[Sessions] Restore the main window settings of the user after a run of UI tests - #137

Merged
Nice3point merged 2 commits into
developfrom
sessions/135-restore-window-settings
Nov 1, 2026
Merged

Nice3point merged 2 commits into
developfrom
sessions/135-restore-window-settings

Conversation

@Nice3point

Copy link
Copy Markdown
Owner

Summary of the Pull Request

What is this about:

After a run of RevitApiUiTest tests, Revit opens its window at the position, the size, and the maximized state it had before the run.

Description:

What changed

  • The Revit dependencies move to the *.1.10 and 2027.0.10 patch versions.
    The 2027.0.10 release restores the window settings of the user once the hidden Revit of a UI test session exits.
  • CHANGELOG.md lists the fix under 2027.0.9.
  • ApplicationTests and ApplicationUiTests drop ActiveAddInId_DeclaredClient_ReturnsTheDeclaredAddIn.
    The dependency that resolves the RevitClient attribute tests the declared add-in in both modes.
    The base classes add no code to that path.

How verified

  • Build: Release.R21, Release.R24, and Release.R27, zero warnings, zero errors.
  • Tests, Release.R27: full suite, 125 passed, 3 skipped, zero failed.
  • The registry value windowPlacement and [Windows] Maximized of Revit.ini are unchanged after the full suite.
  • With 300,200,1200,800 and Maximized=1 stored before the run, ApplicationUiTests passes.
    Both values are unchanged after the run.
  • Not covered: Revit 2021 to 2026 at run time.

Quality Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@Nice3point Nice3point added external ⤴️ Caused by or blocked on a third party feature request 📬 A request for new changes to improve functionality labels Nov 1, 2026
@Nice3point Nice3point linked an issue Nov 1, 2026 that may be closed by this pull request
@Nice3point
Nice3point marked this pull request as ready for review November 1, 2026 13:14
Copilot AI balanced review requested due to automatic review settings November 1, 2026 13:14
@Nice3point
Nice3point merged commit 5f1d54c into develop Nov 1, 2026
2 checks passed
@Nice3point
Nice3point deleted the sessions/135-restore-window-settings branch November 1, 2026 13:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The window-settings fix changes persistent user settings through Injector dependencies outside the diff, and runtime verification covers only Revit 2027, leaving restoration on Revit 2021–2026 requiring maintainer validation.

No open issues 🎉

What changed in this PR

This PR updates the Revit Injector dependency to restore the user’s window position, size, and maximized state after UI test sessions.

Changes:

  • Upgrades Revit Injector patch versions for Revit 2021–2027.
  • Documents the window-restoration fix under release 2027.0.9.
  • Removes declared add-in identity tests from both application test classes because that behavior is covered by the dependency.
File Description
tests/​Nice3point.TUnit.Revit.Tests/​ApplicationUiTests.cs Removes the declared add-in identity test for UI mode.
tests/​Nice3point.TUnit.Revit.Tests/​ApplicationTests.cs Removes the declared add-in identity test for non-UI mode.
Directory.Packages.props Updates Revit Injector to *.1.10 and 2027.0.10.
CHANGELOG.md Records the window-restoration fix and links issue #135.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external ⤴️ Caused by or blocked on a third party feature request 📬 A request for new changes to improve functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Force to Maximized berore ExitRevit

2 participants