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
WaitingTimeout
andWaitingRetryInterval
- major
#155
ElementFindTimeout
andElementFindRetryInterval
- major
#156
VerificationTimeout
andVerificationRetryInterval
- major
#159 Add
ClickAndGo
method toControl<TOwner>
- major
#160 Add
DoubleClickAndGo
method toControl<TOwner>
- major
#161 Add
WaitForScriptAttribute
base trigger - minor
#168 Add
SetRandom(Action<T> callback)
method toEditableField<T, TOwner>
- minor
#169 Add
ContainingClasses
property toScopeDefinitionAttribute
- minor
#170 Add
OnBuilding
andOnBuilt
methods toAtataContextBuilder
- minor
#171 Add
OnDriverCreated
methods toAtataContextBuilder
- minor
#175 Add
WithHostName
method toDriverAtataContextBuilder`3
- major
#177 Add
ActiveControl
property toPageObject<TOwner>
- major
#178 Add
PerformActions
method toPageObject<TOwner>
Changes and Enhancements
- minor
#144 Inherit
CultureAttribute
fromMulticastAttribute
- minor
#145 Inherit
FormatAttribute
fromMulticastAttribute
and makeFormatSettingsAttribute
obsolete - 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
DateTime
type forFileScreenshotConsumer
- minor
#152 Add support of inner format of string path variables for
FileScreenshotConsumer
- major
#154
BaseRetryTimeout
andBaseRetryInterval
- minor
#162 Inherit
WaitForAngularJSAjaxAttribute
fromWaitForScriptAttribute
- minor
#163 Inherit
WaitForJQueryAjaxAttribute
fromWaitForScriptAttribute
- minor
#164 Inherit
WaitForDocumentReadyStateAttribute
fromWaitForScriptAttribute
- major
#165 Use
Selenium.WebDriver
package v3.12.1 - major
#166 Use
Atata.WebDriverExtras
package v1.0.0 - minor
#172 Set
"*"
as defaultscopeXPath
ofScopeDefinitionAttribute
- minor
#176 Update
WithFixOfCommandExecutionDelay
method ofDriverAtataContextBuilder`3
to invokeWithHostName
method
Fixes
- fix #150
FileScreenshotConsumer
doesn’t handle path variables - fix #157
NoSuchElementException
can be thrown during verification before timeout - fix #167 Fails to work with
NLog
v4.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
:
UseBaseRetryTimeout
andUseBaseRetryInterval
- base values.UseElementFindTimeout
andUseElementFindRetryInterval
- used in the process of element finding.UseWaitingTimeout
andUseWaitingRetryInterval
- used by waiting operations.UseVerificationTimeout
andUseVerificationRetryInterval
- 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));