Atata 0.17.0 has been released with various features and enhancements. Check the changelog.
Changelog
New Features
- minor #140 Add access chain cache for UI component scope
- minor
#149 Add
FrameSetPage<TOwner>base page object class - major
#153
WaitingTimeoutandWaitingRetryInterval - major
#155
ElementFindTimeoutandElementFindRetryInterval - major
#156
VerificationTimeoutandVerificationRetryInterval - major
#159 Add
ClickAndGomethod toControl<TOwner> - major
#160 Add
DoubleClickAndGomethod toControl<TOwner> - major
#161 Add
WaitForScriptAttributebase trigger - minor
#168 Add
SetRandom(Action<T> callback)method toEditableField<T, TOwner> - minor
#169 Add
ContainingClassesproperty toScopeDefinitionAttribute - minor
#170 Add
OnBuildingandOnBuiltmethods toAtataContextBuilder - minor
#171 Add
OnDriverCreatedmethods toAtataContextBuilder - minor
#175 Add
WithHostNamemethod toDriverAtataContextBuilder`3 - major
#177 Add
ActiveControlproperty toPageObject<TOwner> - major
#178 Add
PerformActionsmethod toPageObject<TOwner>
Changes and Enhancements
- minor
#144 Inherit
CultureAttributefromMulticastAttribute - minor
#145 Inherit
FormatAttributefromMulticastAttributeand makeFormatSettingsAttributeobsolete - minor
#146 Add more specific exceptions to
AtataMapper - minor
#148 Add
<frame>element support toFrame<TOwner>control in addition to<iframe> - minor
#151 Set default format for path variables of
DateTimetype forFileScreenshotConsumer - minor
#152 Add support of inner format of string path variables for
FileScreenshotConsumer - major
#154
BaseRetryTimeoutandBaseRetryInterval - minor
#162 Inherit
WaitForAngularJSAjaxAttributefromWaitForScriptAttribute - minor
#163 Inherit
WaitForJQueryAjaxAttributefromWaitForScriptAttribute - minor
#164 Inherit
WaitForDocumentReadyStateAttributefromWaitForScriptAttribute - major
#165 Use
Selenium.WebDriverpackage v3.12.1 - major
#166 Use
Atata.WebDriverExtraspackage v1.0.0 - minor
#172 Set
"*"as defaultscopeXPathofScopeDefinitionAttribute - minor
#176 Update
WithFixOfCommandExecutionDelaymethod ofDriverAtataContextBuilder`3to invokeWithHostNamemethod
Fixes
- fix #150
FileScreenshotConsumerdoesn’t handle path variables - fix #157
NoSuchElementExceptioncan be thrown during verification before timeout - fix #167 Fails to work with
NLogv4.5.0
Timeouts and Intervals
Previously there was ability to set common retry timeout and interval values. Now it is possible to set specific parameters for operations of different kind.
New methods of AtataContextBuilder:
UseBaseRetryTimeoutandUseBaseRetryInterval- base values.UseElementFindTimeoutandUseElementFindRetryInterval- used in the process of element finding.UseWaitingTimeoutandUseWaitingRetryInterval- used by waiting operations.UseVerificationTimeoutandUseVerificationRetryInterval- used by verification operations likeShould.Contain("some text").
Usage
AtataContext.Configure().
UseBaseRetryTimeout(TimeSpan.FromSeconds(5)).
UseBaseRetryInterval(TimeSpan.FromSeconds(0.5)).
UseWaitingTimeout(TimeSpan.FromSeconds(30)).
UseVerificationTimeout(TimeSpan.FromSeconds(10)).
Build();
Generic ClickAndGo and DoubleClickAndGo methods
2 generic methods were added to Control<TOwner>:
public TNavigateTo ClickAndGo<TNavigateTo>(TNavigateTo navigateToPageObject = null, bool? temporarily = null)
where TNavigateTo : PageObject<TNavigateTo>;
public TNavigateTo DoubleClickAndGo<TNavigateTo>(TNavigateTo navigateToPageObject = null, bool? temporarily = null)
where TNavigateTo : PageObject<TNavigateTo>;
They allow to navigate to different target page objects.
Usage
Go.To<SomePage>().
SomeButton.ClickAndGo<AnotherPage>();
Go.To<SomePage>().
SomeButton.ClickAndGo(new AnotherPage("some parameter"));
WaitForScriptAttribute
New base trigger attribute for a waiting for script to be executed was added.
An inherited class should override BuildScript method and optionally BuildReportMessage.
Example
public class WaitForJQueryAjaxAttribute : WaitForScriptAttribute
{
public WaitForJQueryAjaxAttribute(TriggerEvents on = TriggerEvents.AfterClick, TriggerPriority priority = TriggerPriority.Medium)
: base(on, priority)
{
}
protected override string BuildReportMessage<TOwner>(TriggerContext<TOwner> context)
=> "Wait for jQuery AJAX execution";
protected override string BuildScript<TOwner>(TriggerContext<TOwner> context)
=> "return jQuery.active == 0";
}
PerformActions method
New method of PageObject<TOwner>:
public TOwner PerformActions(Func<Actions, Actions> actionsBuilder);
Performs the specified set of WebDriver actions. Can be used for any complex actions, for example pressing a combination of keys.
Usage
Go.To<SomePage>().
PerformActions(x => x.KeyDown(Keys.Control).SendKeys("a").KeyUp(Keys.Control));