#=============================================================================================
# @TITLE			1. Step DBM Wizard.
#
# @NUMBER			DBM2_FKT_02001
#
# @DESCRIPTION		Creating a copy just to test the toolbar and delete the before copied.
# @					Then clicking 'Next'.
#
# @EXP_RESULT		'Installation Template' step.
#
# @REQUIREMENTS		"Database Manager" is installed.
#=============================================================================================
TestName = "DBM2_FKT_02001";
static WizardOpen = 1;
#=============================================================================================
# @STEP 0			Check for welcome screen.
#=============================================================================================

set_window ("Database Manager Installation Wizard", 4);
if (obj_exists("rtbWelcome",2) == E_OK)
{
	button_set ("Do not show this Welcome page again.", ON);
	button_press ("Next >");
}


#=============================================================================================
# @STEP 1			Copy template and checking toolbar items.
#=============================================================================================
set_window ("Database Manager Installation Wizard", 2);
toolbar_button_press ("msvb_lib_toolbar", "Copy Template");
set_window ("Copy Template", 4);
list_select_item ("Save in:_0", "Desktop");
edit_set ("File name:", "test");
button_press ("Save");

set_window ("Database Manager Installation Wizard", 3);

if (GUI_Version == "2") {
	list_select_item ("lvwTemplates", "New");
}
if (GUI_Version == "3") {
	list_select_item ("lvwTemplates", "Blank");
}
toolbar_get_button_info("msvb_lib_toolbar","Open Template",ENABLED,value1);
toolbar_get_button_info("msvb_lib_toolbar","Copy Template",ENABLED,value2);
toolbar_get_button_info("msvb_lib_toolbar","Delete Template",ENABLED,value3);
toolbar_get_button_info("msvb_lib_toolbar","Properties",ENABLED,value4);

if (value1 == 1 && value2 == 1 && value3 == 0 && value4 == 0) {
	
	tl_step ("Installation wizard - install Template","0","Toolbarbutton state is correct. - TN: " & TestName);
} else {
	
	tl_step ("Installation wizard - install Template","1","Toolbarbutton state is incorrect. - TN: " & TestName);
}
set_window ("Database Manager Installation Wizard", 3);
list_select_item ("lvwTemplates", "test");

toolbar_get_button_info("msvb_lib_toolbar","Open Template",ENABLED,value1);
toolbar_get_button_info("msvb_lib_toolbar","Copy Template",ENABLED,value2);
toolbar_get_button_info("msvb_lib_toolbar","Delete Template",ENABLED,value3);
toolbar_get_button_info("msvb_lib_toolbar","Properties",ENABLED,value4);

if (value1 == 1 && value2 == 1 && value3 == 1 && value4 == 1) {
	
	tl_step ("Installation wizard - install Template","0","Toolbarbutton state is correct. - TN: " & TestName);
} else {
	
	tl_step ("Installation wizard - install Template","1","Toolbarbutton state is incorrect. - TN: " & TestName);
}
#=============================================================================================
# @STEP 2			Delete before copied template.
#=============================================================================================
set_window ("Database Manager Installation Wizard", 2);
toolbar_button_press ("msvb_lib_toolbar", "Delete Template");

set_window ("Confirm Delete", 0);
button_press ("Yes");
#=============================================================================================
# @STEP 3			Clicking 'Next'
#=============================================================================================
set_window ("Database Manager Installation Wizard", 2);
if (GUI_Version == "2") {
	list_select_item ("lvwTemplates", "New");
}
if (GUI_Version == "3") {
	list_select_item ("lvwTemplates", "Blank");
}
button_press ("Next >");

