Measure Response Times
Learn how to measure text execution times using BELLATRIX web module.
Example
using Bellatrix.TestExecutionExtensions.Common.ExecutionTime;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Bellatrix.Web.GettingStarted
{
[TestFixture]
[ExecutionTimeUnder(2000, TimeUnit.Milliseconds)]
public class MeasureTestExecutionTests : WebTest
{
[Test]
public void PromotionsPageOpened_When_PromotionsButtonClicked()
{
App.Navigation.Navigate("http://demos.bellatrix.solutions/");
var promotionsLink = App.Components.CreateByLinkText<Anchor>("promo");
promotionsLink.Click();
}
}
}
Explanations
[TestFixture]
[ExecutionTimeUnder(2000, TimeUnit.Milliseconds)]
public class MeasureTestExecutionTests : WebTest
Sometimes it is useful to use your functional tests to measure performance or just to make sure that your app is not slow. To do that BELLATRIX libraries offer the ExecutionTimeUnder attribute. You specify a timeout and if the test is executed over it the test will fail.
using Bellatrix.TestExecutionExtensions.Common.ExecutionTime;
You need to add the NuGet package- Bellatrix.TestExecutionExtensions.Common. After that you need to add a using statement to Bellatrix.TestExecutionExtensions.Common.ExecutionTime