How to upgrade to Atata 3 considering breaking changes.
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.
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 AtataContext
s.
Check the list of related issues for details:
TimeZone
instance property of AtataContext
to AtataContext.GlobalProperties
BuildStart
and BuildStartUtc
static properties of AtataContext
to AtataContext.GlobalProperties
ModeOfCurrent
static property of AtataContext
to AtataContext.GlobalProperties
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("...")
.
AtataContextBuilder
’s ScreenshotConsumers
property is removed together with all the other code related to it."screenshots"
/"fileNameTemplate"
JSON property to configure screenshot file path.IScreenshotConsumer
and implementation classes are removed.NLogFileConsumer
with single WithFileNameTemplate
methodAdded 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:
DirectoryPathBuilder
FileNameBuilder
FilePathBuilder
Added LogConsumerAtataContextBuilder<NLogFileConsumer>
configuration extension method:
public static LogConsumerAtataContextBuilder<NLogFileConsumer> WithFileNameTemplate(
this LogConsumerAtataContextBuilder<NLogFileConsumer> builder,
string fileNameTemplate)
Removed LogConsumerAtataContextBuilder<NLogFileConsumer>
configuration extension methods:
WithArtifactsDirectoryPath
WithDirectoryPath
WithFilePath
WithFileName
[FindByAlt]
attribute is set as default for Image<TOwner>
controlSets the default search strategy by alt
attribute.
Before, by default [FindFirst]
was applied.
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
UIComponent
AtataContextBuilder
methodsAtataContext
membersTimeZone
instance property of AtataContext
to AtataContext.GlobalProperties
BuildStart
and BuildStartUtc
static properties of AtataContext
to AtataContext.GlobalProperties
ModeOfCurrent
static property of AtataContext
to AtataContext.GlobalProperties
NLogFileConsumer
with single WithFileNameTemplate
methodTestInfo
properties NameSanitized
and SuiteNameSanitized
[FindByAlt]
attribute to Image<TOwner>
controlFeel free to use any contact channel if you have problems with migration.