Atata 1.10.0 is Released

February 18, 2021 by Yevgeniy Shunevych


Atata 1.10.0 is released with driver auto-setup, new properties of attributes, and other useful features.

Changelog

New Features

  • major #461 Add Exclude* properties to MulticastAttribute
  • major #462 Add Exclude* properties to AttributeSettingsAttribute
  • minor #466 Add verification extension methods for IDataVerificationProvider<Size, TOwner>
  • major #467 Add TagAttribute and add properties to MulticastAttribute targeting tags
  • major #469 Add Timeout and RetryInterval properties to FindAttribute and FindSettingsAttribute
  • major #470 Add Configure* driver methods to AtataContextBuilder
  • major #471 Add ContainExactly verification extension methods
  • major #473 Add functionality to mask secret string in log
  • minor #474 Add local browser usage properties to AtataBuildingContext
  • major #476 Add AutoSetUp* methods to AtataContextBuilder for driver(s) auto-setup
  • minor #477 Add extension methods for control delegates

Changes and Enhancements

  • minor #463 Remove exception catching that wraps AtataContext’s OnBuilding, OnBuilt and OnDriverCreated methods
  • minor #464 Inherit UIComponentSizeProvider<TOwner> from DataProvider<Size, TOwner>
  • minor #465 Inherit UIComponentLocationProvider<TOwner> from DataProvider<Point, TOwner>
  • minor #468 Move OnInit and OnInitCompleted methods from PageObject<TOwner> to UIComponent<TOwner>
  • minor #472 Update Stringifier.ToString<T>(IEnumerable<T>) method to support multiline values format
  • minor #475 Add fallback functionality to DriverAtataContextBuilder<TBuilder, TService, TOptions> for driver path getting from environment variables
  • minor #478 Use Atata.WebDriverExtras package v1.5.0

Driver Auto Setup

An integration with Atata.WebDriverSetup package is added via few new AtataContextBuilder methods:

  • AutoSetUpDriverToUse()
  • AutoSetUpDriverToUseAsync()
  • AutoSetUpConfiguredDrivers()
  • AutoSetUpConfiguredDriversAsync()

See #476 issue for the methods description. See also #474 and #475 for additional info.

Basically, this functionality automatically sets up required driver(s) with version corresponding to installed browser, or the latest version. So no need to use NuGet packages for driver setup and update their versions periodically.

Find out more information in atata-framework/atata-webdriversetup repository.

Usage

AtataContext.GlobalConfiguration
    .UseChrome()
    .AutoSetUpDriverToUse();

New Timeout And RetryInterval Properties in FindAttribute and FindSettingsAttribute

This gives an ability to set specific timeout values for individual controls.

Usage

// Sets 30 seconds timeout and 0.2 seconds as retry interval:
[FindById("someid", Timeout = 30, RetryInterval = 0.2)]
public Button<_> SomeButton { get; private set; }

New Exclude* Properties in MulticastAttribute

Added a set of exclude properties to MulticastAttribute for filtering out options:

public string[] ExcludeTargetNames { get; set; }

public string ExcludeTargetName { get; set; }

public Type[] ExcludeTargetTypes { get; set; }

public Type ExcludeTargetType { get; set; }

public Type[] ExcludeTargetParentTypes { get; set; }

public Type ExcludeTargetParentType { get; set; }

New Exclude* Properties in AttributeSettingsAttribute

Added a set of exclude properties to AttributeSettingsAttribute for filtering out options:

public Type[] ExcludeTargetAttributeTypes { get; set; }

public Type ExcludeTargetAttributeType { get; set; }

New TagAttribute

Added TagAttribute class:

public class TagAttribute : Attribute
{
    public TagAttribute(params string[] values);

    public ReadOnlyCollection<string> Values { get; }
}

Added properties to MulticastAttribute targeting tags:

public string[] TargetTags { get; set; }

public string TargetTag { get; set; }

public string[] ExcludeTargetTags { get; set; }

public string ExcludeTargetTag { get; set; }

Secret Strings in Log

Sometimes when running tests on specific environments there is a need to hide secret string values like password in log files.

Implementation

Added method to AtataContextBuilder:

public AtataContextBuilder AddSecretStringToMaskInLog(string value, string mask = "{*****}");

Usage

string somePassword = Environment.GetEnvironmentVariable("SomePassword");

AtataContext.GlobalConfiguration
    .AddSecretStringToMaskInLog(somePassword);

New ContainExactly Verification Extension Methods

Verifies that collection contains exact count of items that either match predicateExpression or equal to expectedValue parameter.

Usage

ListOfStrings.Should.ContainExactly(2, "Some item");

ControlList.Should.ContainExactly(2, x => x.SomeProp == "Some item");

New Configure* Driver Methods in AtataContextBuilder

In addition to Use{Driver} methods add corresponding set of Configure{Driver} methods, like ConfigureChrome. Configure method in its turn returns an existing or creates a new builder for the specific driver by the specified alias.