Source:
<code>public void workingWithEnvVariables() { dashboardWorkspace.selectTabInWorspaceMenu(TabNames.ENV_VARIABLES); dashboardWorkspace.selectMachine("Environment variables", "dev-machine"); dashboardWorkspace.clickOnAddEnvVariableButton(); dashboardWorkspace.checkAddNewEnvVarialbleDialogIsOpen(); <START> dashboardWorkspace.addNewEnvironmentVariable("logi", "qaadmin"); <END> dashboardWorkspace.clickOnAddDialogButton(); dashboardWorkspace.checkEnvVariableExists("logi"); dashboardWorkspace.checkValue("logi", "qaadmin"); dashboardWorkspace.clickOnEditEnvVariableButton("logi"); dashboardWorkspace.enterEnvVariableName("login"); dashboardWorkspace.clickOnUpdateDialogButton(); dashboardWorkspace.checkValue("login", "qaadmin"); dashboardWorkspace.clickOnEnvVariableCheckbox("login"); dashboardWorkspace.clickOnDeleteBtn(); dashboardWorkspace.clickOnDeleteDialogButton(); clickOnSaveButton(); dashboardWorkspace.selectMachine("Environment variables", "db"); for (String name : VariablesList) { loader.waitOnClosed(); dashboardWorkspace.clickOnDeleteEnvVariableButton(name); dashboardWorkspace.clickOnDeleteDialogButton(); } clickOnSaveButton(); for (int i = 0; i < VariablesList.size(); i++) { loader.waitOnClosed(); dashboardWorkspace.clickOnAddEnvVariableButton(); dashboardWorkspace.checkAddNewEnvVarialbleDialogIsOpen(); dashboardWorkspace.addNewEnvironmentVariable(VariablesList.get(i), ValuesList.get(i)); dashboardWorkspace.clickOnAddDialogButton(); dashboardWorkspace.checkEnvVariableExists(VariablesList.get(i)); dashboardWorkspace.checkValue(VariablesList.get(i), ValuesList.get(i)); } clickOnSaveButton(); }</code><technical_language>**qaadmin** is name staging. avoid usage of in tests security reasons</technical_language>

Target:
public void workingWithEnvVariables() { dashboardWorkspace.selectTabInWorspaceMenu(TabNames.ENV_VARIABLES); dashboardWorkspace.selectMachine("Environment variables", "dev-machine"); dashboardWorkspace.clickOnAddEnvVariableButton(); dashboardWorkspace.checkAddNewEnvVarialbleDialogIsOpen(); dashboardWorkspace.addNewEnvironmentVariable("logi", "admin"); dashboardWorkspace.clickOnAddDialogButton(); clickOnSaveButton(); Assert.assertTrue(dashboardWorkspace.checkEnvVariableExists("logi")); Assert.assertTrue(dashboardWorkspace.checkValueExists("logi", "admin")); dashboardWorkspace.clickOnEditEnvVariableButton("logi"); dashboardWorkspace.enterEnvVariableName("login"); dashboardWorkspace.clickOnUpdateDialogButton(); clickOnSaveButton(); Assert.assertTrue(dashboardWorkspace.checkValueExists("login", "admin")); dashboardWorkspace.clickOnEnvVariableCheckbox("login"); dashboardWorkspace.clickOnDeleteBtn(); dashboardWorkspace.clickOnDeleteDialogButton(); clickOnSaveButton(); dashboardWorkspace.checkValueIsNotExists("login", "admin"); dashboardWorkspace.selectMachine("Environment variables", "db"); variables.forEach( (name, value) -> { dashboardWorkspace.clickOnDeleteEnvVariableButton(name); dashboardWorkspace.clickOnDeleteDialogButton(); dashboardWorkspace.checkValueIsNotExists(name, value); }); clickOnSaveButton(); variables.forEach( (name, value) -> { loader.waitOnClosed(); dashboardWorkspace.clickOnAddEnvVariableButton(); dashboardWorkspace.checkAddNewEnvVarialbleDialogIsOpen(); dashboardWorkspace.addNewEnvironmentVariable(name, value); dashboardWorkspace.clickOnAddDialogButton(); Assert.assertTrue(dashboardWorkspace.checkEnvVariableExists(name)); Assert.assertTrue(dashboardWorkspace.checkValueExists(name, value)); }); clickOnSaveButton(); }