Behaviour Driven Development BDD Logging

Learn the BELLATRIX Behaviour Driven Development BDD Logging works and how to use it.

Example

@Test
public void commonAssertionsAndroidControls() {
    var button = app().create().byIdContaining(Button.class, "button");

    button.validateNotDisabled();

    var checkBox = app().create().byIdContaining(CheckBox.class, "check1");

    checkBox.check();

    checkBox.validateIsChecked();

    var comboBox = app().create().byIdContaining(ComboBox.class, "spinner1");

    comboBox.selectByText("Jupiter");

    comboBox.validateTextIs("Jupiter");

    var label = app().create().byText(Label.class, "textColorPrimary");

    label.validateIsVisible();
}

Explanations

There cases when you need to show your colleagues or managers what tests do you have. Sometimes you may have manual test cases, but their maintenance and up-to-date state are questionable. Also, many times you need additional work to associate the tests with the test cases. Some frameworks give you a way to write human readable tests through the Gherkin language. The main idea is non-technical people to write these tests. However, we believe this approach is doomed. Or it is doable only for simple tests. This is why in BELLATRIX we built a feature that generates the test cases after the tests execution. After each action or assertion, a new entry is logged.

After the test is executed the following log is created:

Start Test
Class = BDDLoggingTests Name = CommonAssertionsAndroidControls
validating Button (id containing button) not disabled
checking CheckBox (id containing check1)
validating CheckBox (id containing check1) is checked
selecting 'Jupiter' from Select (id containing spinner1)
clicking RadioButton (text containing Jupiter)
validating ComboBox (id containing spinner1) text is 'Jupiter'
validating Label (text containing textColorPrimary) is visible