Report Localization

Switching Languages

As described at the beginning, reports can be generated not only in the default language – English. Let’s see how you can generate a report in Russian.

To do this, you need to open the allurium.properties file and find or add the parameter localization with the value ru or russian.
For example:


localization=ru
step.detailing=2
highlighter.start=<
highlighter.end=> 
retry.amount=30
retry.interval.ms=1000
      

Now, run one of our previous examples. For example, the form filling test:


@Test
@Feature("Form")
@DisplayName("Filling the example form")
public void fillTheForm() {
    URL imageUrl = this.getClass().getClassLoader().getResource("img/testicon.png");
    UiSteps.openBrowser(formPageUrl);
    formPage.fieldLogin().assertVisible();
    formPage.fieldLogin().write("John");
    formPage.fieldLogin().assertHasCssClass("form-control");
    formPage.fieldLogin().assertCurrentValue("John");
    formPage.fieldEmail().clearAndWrite("john.doe@gmail.com");
    formPage.fieldEmail().assertCurrentValue("john.doe@gmail.com");
    formPage.fieldPassword().write("Password12345!");
    formPage.fieldRank().write("10");
    formPage.fieldDate().clearAndWrite("11.11.2011");
    formPage.fieldTelephone().write("199887688");
    formPage.btnAnnualIncomeIncrement().clickAndHold(5000);
    formPage.uploadAvatar().uploadFile(new File(imageUrl.getFile()));
    formPage.radioBtnMale().click();
    formPage.radioBtnMale().assertEnabled();
    formPage.radioBtnFemale().assertDisabled();
    formPage.ckbMorning().check();
    formPage.ckbMorning().assertChecked();
    formPage.ckbEvening().assertUnchecked();
    formPage.ddExperience().select("2 years");
    formPage.ddExperience().assertCurrentValue("2");
    formPage.selectWorkingDays().select("Monday");
    formPage.selectWorkingDays().select("Friday");
}
      

After running the test, you will see that all steps in the report (except for names set via @Name) are displayed in Russian. Of course, full localization can be achieved by specifying the values in @Name in the desired language.

Report in Russian

Due to language peculiarities (e.g., the rich set of prefixes, suffixes, and endings), the descriptions may not sound perfect, but in most cases they remain acceptable.

At present, the general steps in the classes "UiSteps" and "BrowserSteps" are not translated and will remain in English. This may be improved in the future.