#=============================================================================================
# @TITLE			Start DB User Wizard.
#
# @NUMBER			DBM3_DBUser_001_OpenWizard
#
# @DESCRIPTION		The DB User wizard get started.
#
# @EXP_RESULT		The "DB User" window opens.
#
# @REQUIREMENTS		"Database Manager" is installed.
#=============================================================================================
static WizardOpen = 1;
static TestName = "DBM3_DBUser_001_OpenWizard";

#=============================================================================================
# @STEP 1			Selecting database.
#=============================================================================================
set_window ("Database Manager", 3);

list_expand_item ("tvwFolders", "Servers");
list_select_item ("tvwFolders", "Servers;<Local>");

list_select_item ("lvwDatabases", database);
list_activate_item ("lvwDatabases", database);

wait(5);

#=============================================================================================
# @STEP 2			Checking whether database is online.
#=============================================================================================
set_window ("Database Manager", 3);
toolbar_get_button_info("msvb_lib_toolbar_1", "Online", ENABLED, value);

if (value == 1) {

	toolbar_button_press ("msvb_lib_toolbar_1", "Online");
	toolbar_get_button_info("msvb_lib_toolbar_1","Offline",ENABLED,value1);
	
	while (value1 == 0) {
		
		toolbar_get_button_info("msvb_lib_toolbar_1","Offline",ENABLED,value1);
	}
	wait(5);
}


#=============================================================================================
# @STEP 3			Starting db user wizard.
#=============================================================================================
set_window ("Database Manager", 5);
list_activate_item ("lvwDatabases", database);
wait(10);
#select menu item via shortcuts (I)nstance -> Confi(g)uration -> (D)atabase User...");
menu_select_item_by_shortcut("I;g;D");


if (win_exists("Configuration Wizard",5) == E_OK) {
	tl_step ("DB User Wizard - open",0,"Testname: " & TestName & ", Line:" & getvar("line_no"));
} else {
	tl_step ("DB User Wizard - not open",1,"Testname: " & TestName & ", Line:" & getvar("line_no"));
}




