Skip to content

Releases: Lombiq/UI-Testing-Toolbox

v12.0.0

05 Dec 11:38
Compare
Choose a tag to compare

Breaking changes in logging during UI tests

One of the implicit assertions that the UI Testing Toolbox does automatically is checking the Orchard Core application logs for any errors. By default, any error fails the test.

Previously, this relied on the tested web app using NLog for logging, and it parsed NLog log files. This not only required the app to use NLog over Serilog (that Orchard also supports out of the box) or any other logging framework, but it also depended on the structure of an otherwise freely configurable textual log format.

Now, the UI Testing Toolbox configures the app to use FakeLogger in addition to any logging framework it has set up, and uses it for assertions. FakeLogger not only doesn't need anything specific in the app, but it also lets you access and assert on log entries in a structured, statically typed way.

Using NLog is still support, and log files will be included in the test dump. Any other logging framework is also supported, your app doesn't need to do anything special.

What changed

  • All log management methods are now async.
  • Log assertions now don't happen on a string representing the whole log, but rather on IApplicationLog and IApplicationLogEntry instances.
  • The LogsShouldBeEmptyAsync and GetLogOutputAsync methods have changed, see the diff.
  • CreateAppLogAssertionForSecurityScan and CreateAppLogAssertionForSecurityScan work the same but were moved into the Lombiq.Tests.UI.SecurityScanning namespace.
  • A new OrchardCoreConfiguration.AfterFakeLoggingConfiguration event handler is exposed to change the default configuration of FakeLogger.
  • OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainWarningsAsync and OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainWarningsAndCacheFolderErrorsAsync are no longer available.

How to adapt

  • Use OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainCacheFolderErrorsAsync instead of OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainWarningsAndCacheFolderErrorsAsync .
  • OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainWarningsAsync is not needed, since the new behavior is to not log warnings in the first place.
  • The examples are updated in Lombiq.Tests.UI.Samples.UITestBase, see the diff. Check them out if you have custom app log assertion code.

What's Changed

Full Changelog: v11.1.0...v12.0.0

v11.1.0

31 Oct 14:48
7c3b888
Compare
Choose a tag to compare

What's Changed

Full Changelog: v11.0.0...v11.1.0

v11.0.0

25 Sep 15:29
Compare
Choose a tag to compare

What's Changed

Full Changelog: v10.0.1...v11.0.0

v10.0.1

21 May 18:54
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v9.1.1...v10.0.1

v10.0.0

15 May 17:39
Compare
Choose a tag to compare

Breaking changes

While the impact should be low for most projects, this version does introduce some breaking changes:

  • Atata was updated to v3.1.0 from v2.9.0. Atata v3 brought breaking changes as well. So, if you integrated with some Atata features directly, you may need to adapt your code, see the migration guide. If you only used the higher-level APIs provided by the UI Testing Toolbox, then nothing to do (any problems will be apparent as build errors).
  • The TestBasicOrchardFeatures* extension methods are now in their own namespace. You'll need to thus add using Lombiq.Tests.UI.BasicOrchardFeaturesTesting; to files using them. Everything works otherwise the same.

What's Changed

New Contributors

Full Changelog: v9.1.1...v10.0.0

v9.1.1

01 May 19:33
Compare
Choose a tag to compare

This release is only to fix a NuGet publishing issue that you can read about here. There are no other changes, but the packages now don't mistakenly define the NuGetBuild MSBuild property.

Full Changelog: v9.1.0...v9.1.1

v9.1.0

30 Apr 16:32
938c867
Compare
Choose a tag to compare

What's Changed

Full Changelog: v9.0.0...v9.1.0

v9.0.0

21 Feb 16:43
Compare
Choose a tag to compare

Default browser configuration

The UI Testing Toolbox now offers a default for the browser being used. The endless [Theory, Chrome] attributes and passing the browser down the call chain are now while still supported, unnecessary, unless you want to use a different or multiple browsers.

Everything should keep on working, but it's still nicer to remove the now unnecessary code. So, in all projects, please do this:

  1. Update to the latest UI Testing Toolbox. Then code cleanup time! Warning: UITestBase classes should usually remain so check and revert them if they change after the below steps!
  2. Do a Find and Replace in the UI test projects with the following will cover most cases: [Theory, Chrome][Fact], (Browser browser) =>() =>, , browser););.
  3. Run the following with "Use regular expressions" checked: ,\r\n.*browser\););, ,\r\n.*browser,,.
  4. Do a Find and Replace of (Browser browser)().
  5. Do a reference lookup for Browser.Chrome (Shift+F12) to find any missed cases.
  6. Finally, you'll need to check the formatting of all tests, because e.g. you may be able to make methods a lot more compact with fewer line breaks. All tests will have now unused references too, but if you have cleanup on save configured in VS, then just saving them will get rid of that.

All other changes

New Contributors

Full Changelog: v8.2.0...v9.0.0

v8.2.0

16 Oct 09:37
e9b8d15
Compare
Choose a tag to compare

What's Changed

Full Changelog: v8.0.2...v8.2.0

v8.0.2

26 Sep 17:04
9f6a73c
Compare
Choose a tag to compare

What's Changed

Full Changelog: v8.0.1...v8.0.2