Accelerate Test Creation
To speed up the CI process, we developed a group of features that support every phаse of the process, from test creation to execution. Let’s take a look how BELLATRIX can speed up your test creation by providing element snippets, handy elements locators, smart wait for the elements, more than 150 additional elements actions, ready-to-go templates and much more.
Speed Test Writing with Element Snippets
By giving you a corresponding snippet for more than 18 Android elements out of the box, BELLATRIX will dramatically speed up your test writing.
Code snippets are small blocks of reusable code that can be inserted in a code file using a context menu command or a combination of hotkeys. In Visual Studio there are expansion snippets, which are added at a specified insertion point and may replace a snippet shortcut.
For example, to generate a TextField property, you need to type somewhere in you class atextfield and press Tab.
public TextField UserName => Element.CreateByIdContaining<TextField>("edit");
On the first press of tab, the above code is generated. The first placeholder that is selected is the name of the property. Once you change it, you can press Tab. Then, the second placeholder is chosen- the By locator’s type, by default, it is set to Id, press Tab again and change the actual locator.
API Usability- Locate Elements
Additional methods and ability to add custom locators.
For example, in WebDriver to find an element, we use the FindElement method while specifying the locator through By class.
IWebElement agreeCheckBox = driver.FindElement(By.Id("agreeChB")); agreeCheckBox.Click();
However, this syntax requires additional effort. It is not fluent since you had to begin a new “chain” using the By static class. Also, it is not extendable if you want to add custom locators.
var textField = App.ElementCreateService.CreateByIdContaining<TextField>("edit");
BELLATRIX provides you with a CreateBy method for each locator. Everything follows the natural writing flow, leveraging to the maximal degree on IntelliSense. If you add your custom locator, your method will appear as well.
One of the coolest things that the BELLATRIX element includes, is the By property (knowing how it was located).
API Usability- Wait for Elements
Smart wait for elements that will solve 80% of all use cases.
All elements are internally waited to exist before usage. This solves 80% of all use cases. After that as part of the CreateBy API, we added additional ToBe methods which you can chain. Which means you can specify an unlimited number of conditions for each element that needs to be fulfilled before the element is returned.
var button = App.ElementCreateService.CreateByIdContaining<Button>("button").ToBeClickable().ToBeVisible(); button.Click();
BELLATRIX comes with 7 default ToBe methods.
Moreover, it is relatively easy to add your custom ToBe methods if needed.
150+ Additional Elements Actions
BELLATRIX saves you a lot of effort and code with extended elements and services APIs.
BELLATRIX exposes 18+ Android controls. Each of them includes only the actions that you should be able to do with the specific control and nothing more.
var button = App.ElementCreateService.CreateByName<Button>("button"); button.Click(); var calendar = App.ElementCreateService.CreateByAutomationId<Calendar>("calendar"); Assert.AreEqual(false, calendar.IsDisabled); var checkBox = App.ElementCreateService.CreateByName<CheckBox>("checkBox"); checkBox.Check(); Assert.IsTrue(checkBox.IsChecked); var password = App.ElementCreateService.CreateByAutomationId<Password>("passwordBox"); password.SetPassword("topsecret");
The most important attributes of each Android control are included, as well as their assertion alternatives.
var label = App.ElementCreateService.CreateByName<Label>("Result Label"); Assert.IsTrue(label.IsPresent); Assert.AreEqual("Meissa Is Beautiful!", textField.InnerText);
Ready-To-Go Project Templates
BELLATRIX comes with preconfigured (ready-to-go) project templates.
You can directly start to write automated tests without bothering with tedious project configurations, installing packages, etc.