Atata 1.2.0 is Released

June 13, 2019 by Yevgeniy Shunevych


Atata 1.2.0 is released with several new features.

Changelog

New Features

  • major #271 Add PageObjectVerificationProvider<TPageObject> for PageObject<TOwner>
  • minor #272 Add FindItemByRelativeElementContentAttribute
  • minor #273 Add FindItemByParentContentAttribute
  • minor #274 Add FindItemByFollowingSiblingContentAttribute
  • minor #275 Add FindItemByPrecedingSiblingContentAttribute
  • major #276 Add ContainSingle(TData expected) verification extension methods
  • major #277 Add ContainSingle() verification extension method
  • major #278 Add ContainSingle(Expression<Func<TItem, bool>> predicateExpression) verification extension method
  • minor #279 Add VerificationUtils static class

Changes and Enhancements

  • minor #280 Update Contain(Expression<Func<TControl, bool>> predicateExpression) verification extension method
  • Fixes

  • fix #286 Fix IUIComponentVerificationProviderExtensions.Exist method to throw AssertionException instead of NoSuchElementException

New Collection Verification Methods

  • ContainSingle()
  • ContainSingle(TData expected)
  • ContainSingle(Expression<Func<TItem, bool>> predicateExpression)

New Attributes for RadioButtonList and CheckBoxList

  • FindItemByRelativeElementContentAttribute
  • FindItemByParentContentAttribute
  • FindItemByFollowingSiblingContentAttribute
  • FindItemByPrecedingSiblingContentAttribute

Improvements for Custom Verification Methods

Page Object Custom Verification Methods

public static class IPageObjectVerificationProviderExtensions
{
    // For generic page object.
    public static TPageObject BeOnEditPage<TPageObject>(this IPageObjectVerificationProvider<TPageObject> should)
        where TPageObject : PageObject<TPageObject>
    {
        return should.Component.PageUrl.Should.WithSettings(should).Contain("/Edit.aspx");
    }

    // For specific page object.
    public static SomePage HaveSomething(this IPageObjectVerificationProvider<SomePage> should)
    {
        return should.Component.SomeProperty.Should.WithSettings(should).Equal("...");
    }
}

Using of extension methods:

Go.To<SomePage>().
    Should.BeOnEditPage().
    Should.HaveSomething();

Data Custom Verification Methods

With VerificationUtils.ToString method it became a bit easier to write expected data (object, enumerable, etc.) into verification message.

public static class IDataVerificationProviderExtensions
{
    public static TOwner ContainSingle<TItem, TOwner>(this IDataVerificationProvider<IEnumerable<TItem>, TOwner> should, TItem expected)
        where TOwner : PageObject<TOwner>
    {
        return should.Satisfy(
            actual => actual != null && actual.Count(x => Equals(x, expected)) == 1,
            $"contain single {VerificationUtils.ToString(expected)}");
    }
}