Atata 0.14.0 has been released.
Check the changelog and major features.
Release mostly contains a set of configuration enhancements including the changes for upcoming Atata.Configuration.Json
package.
Changelog
Breaking Changes
- break #67 Remove obsolete screenshot consumer extension methods
New Features
- minor #58 Resolve log consumer by type name or alias
- minor
#60 Add
AtataMapper
class - minor #62 Resolve screenshot consumer by type name or alias
- major
#64 Add
RemoteDriverAtataContextBuilder
- major #72 Multi-driver configuration
- major
#74
AtataContext
global configuration - minor
#76 Add
Clear
method toAtataContextBuilder
- minor
#78
AtataContext
static mode - major
#79 Add
ScrollTo
method toControl<TOwner>
Changes and Enhancements
- minor
#57 Add
LoggerName
property toNLogConsumer
- minor
#59 Add
WithProperties
method toAtataContextBuilder<TContext>
- minor
#61 Enhance
FileScreenshotConsumer
- minor
#63 Enhance
AtataContext
driver builders - minor #65 Test name configuration enhancement
- minor
#66 Move screenshot consumer extension methods from
AtataContextBuilderExtensions
- minor
#68 Move log consumer extension methods from
AtataContextBuilderExtensions
- minor
#69 Move NUnit related extension methods from
AtataContextBuilderExtensions
- minor
#70 Add
WithLoggerName
extension method forAtataContextBuilder<NLogConsumer>
- minor
#71 Move driver extension methods from
AtataContextBuilderExtensions
- minor
#73 Rename
Build
method ofAtataContext
toConfigure
- minor
#75 Rename
SetUp
method ofAtataContextBuilder
toBuild
- minor
#80 Add
DriverAlias
property toLogEventInfo
- minor
#81 Add “driver-alias” NLog event property in
NLogConsumer
- minor
#82 Use
Atata.WebDriverExtras
package v0.12.0 - major
#83 Use
Selenium.WebDriver
andSelenium.Support
packages v3.5.2 - major #84 Set default retry timeout to 5 seconds
Remote Driver Configuration
Added enhancement for RemoteWebDriver
configuraton.
Example
AtataContext.Configure().
UseRemoteDriver().
WithRemoteAddress("http://127.0.0.1:4444/wd/hub").
WithOptions(new ChromeOptions()).
// Other configuration.
Build();
Check
#64 Add RemoteDriverAtataContextBuilder
for more configuration options.
Global Configuration
Added property to AtataContext
class:
public static AtataContextBuilder GlobalConfiguration { get; }
Global configuration is static and applied as a base configuration settings to all other test-specific configurations. When AtataContext.Configure()
method is invoked, BuildingContext
of GlobalConfiguration
is copied to new AtataContextBuilder
instance. It is good to set up common AtataContext
settings as a global configuration once in one-time set-up method.
Example
[OneTimeSetUp]
public void GlobalSetUp()
{
AtataContext.GlobalConfiguration.
AddNUnitTestContextLogging().
UseNUnitTestName();
}
[SetUp]
public void SetUp()
{
AtataContext.Configure().
UseChrome().
Build();
}
Multi-Driver Configuration
Added ability to set multiple driver builders using AtataContextBuilder
. Each driver configuration can have an alias. Also added method to specify (choose) which driver configuration to use.
Example #1
[OneTimeSetUp]
public void GlobalSetUp()
{
AtataContext.GlobalConfiguration.
UseChrome().
WithArguments("disable-extensions", "no-sandbox", "start-maximized").
UseInternetExplorer().
WithOptions(x => x.EnableNativeEvents = true).
UseRemoteDriver().
WithAlias("chrome_remote").
WithRemoteAddress("http://127.0.0.1:4444/wd/hub").
WithOptions(new ChromeOptions());
}
[SetUp]
public void SetUp()
{
AtataContext.Configure().
UseDriver(DriverAliases.Chrome).
// Or UseDriver("chrome_remote").
Build();
}
Example #2
For multi-browser testing you can specify driver aliases using fixture arguments.
[TestFixture(DriverAliases.Chrome)]
[TestFixture(DriverAliases.InternetExplorer)]
public class MultiDriverTests
{
private readonly string driverAlias;
public MultiDriverTests(string driverAlias)
{
this.driverAlias = driverAlias;
}
[SetUp]
public void SetUp()
{
AtataContext.Configure().
UseDriver(driverAlias).
UseTestName(() => $"[{driverAlias}]{TestContext.CurrentContext.Test.Name}").
Build();
}
[TearDown]
public void TearDown()
{
AtataContext.Current.CleanUp();
}
}
Check #72 Multi-driver configuration for more information.
Scrolling to Control
Added ScrollTo
method which scrolls to the control. By default uses ScrollUsingMoveToElementAttribute
behavior. Also executes new TriggerEvents.BeforeScroll
and TriggerEvents.AfterScroll
triggers.
Usage
page.SomeControl.ScrollTo();
Behaviors
ScrollBehaviorAttribute
(base) - can be inherited for custom scrolling behavior.ScrollUsingMoveToElementAttribute
(used by default) - performsActions.MoveToElement(IWebElement)
action.ScrollUsingScrollIntoViewAttribute
- performs JavaScriptelement.scrollIntoView(true)
function.
[ScrollUsingScrollIntoView]
public TextInput<_> SomeInput { get; private set; }