Upgrade to Atata 3

How to upgrade to Atata 3 considering breaking changes.

First steps

The first migration step is to ensure or upgrade your Atata to v2.14.1. Then fix all Atata warnings telling that some class/member is obsolete, as those items should be removed in v3.

You can also take a look at Atata Framework 3 is Released blog post to find out what’s new in v3.

New AtataContext.GlobalProperties

Some of the AtataContext properties and AtataContextBuilder methods were moved to the new AtataContext.GlobalProperties static property. Global properties can be set once before any AtataContext creation (in global setup method), and those properties spread all over the AtataContexts.

Check the list of related issues for details:

Screenshot consumers functionality is removed

Screenshots functionality is simplified and now its configuration is similar to the configuration of page snapshots. Basically, you no longer need to call ScreenshotConsumers.AddFile() to enable screenshots saving, it is enabled by default. To change the default screenshot file path template use Screenshots.UseFileNameTemplate("...").

Removed

Replaced file path configuration of NLogFileConsumer with single WithFileNameTemplate method

Added NLogFileConsumer property:

/// <summary>
/// Gets or sets the file name template.
/// The default value is <c>"Trace.log"</c>.
/// </summary>
public string FileNameTemplate { get; set; }

Removed NLogFileConsumer properties:

Added LogConsumerAtataContextBuilder<NLogFileConsumer> configuration extension method:

public static LogConsumerAtataContextBuilder<NLogFileConsumer> WithFileNameTemplate(
    this LogConsumerAtataContextBuilder<NLogFileConsumer> builder,
    string fileNameTemplate)

Removed LogConsumerAtataContextBuilder<NLogFileConsumer> configuration extension methods:

[FindByAlt] attribute is set as default for Image<TOwner> control

Sets the default search strategy by alt attribute. Before, by default [FindFirst] was applied.

Update sanitization approach of TestInfo properties NameSanitized and SuiteNameSanitized

Before v3, invalid characters were just removed from a string. Now they are replaced with underscore symbol, similarly to sanitization of screenshot and snapshot file names. This mainly affects the test folder names in Artifacts directory path.

For example:
Test("2/1") as Name becomes
Test(_2_1_) as NameSanitized

All breaking changes

Feedback

Feel free to use any contact channel if you have problems with migration.