This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Animations
Cezary Piątek edited this page Mar 18, 2017
·
4 revisions
Sometimes animated elements may affect test stability (as also slow down test execution). You can turn off and on animations with DisableAnimations() and EnableAnimations() methods. Currently these methods can control JQuery and CSS animations.
private static void TestAnimatedPage(IBrowserAdapter browser)
{
//Turn off animations
browser.DisableAnimations()
//Perform interaction with page
//Restore animations
browser.EnableAnimations()
}
It impacts only currently opened website and stop working when you navigate (implicitly or explicitly) to another page. To disable animations globally set animationsDisabled flag in configuration
<telluriumConfiguration animationsDisabled="true" />
or explicitly when creating BrowserAdapterConfig instance
[Test]
public void sample_test()
{
var browserAdapterConfig = new BrowserAdapterConfig()
{
AnimationsDisabled = true
};
using (var browserAdapter = BrowserAdapter.Create(browserAdapterConfig))
{
//Perform test
}
}
Animations will be disabled for every explicitly loaded page. To ensure that always use the following functions:
browserAdapter.NavigateTo<HomeController>(c => c.Index());
browserAdapter.ReloadPageWith(() => browserAdapter.ClickOnElementWithText("Sign in"));