#=============================================================================================
# @TITLE			9. Step DBM Wizard.
#
# @NUMBER			DBM2_FKT_02012
#
# @DESCRIPTION		Installation Mode.
#
# @EXP_RESULT		'Start Installation' step.
#
# @REQUIREMENTS		"Database Manager" is installed.
#=============================================================================================
TestName = "DBM2_FKT_02012";
static WizardOpen = 1;
#=============================================================================================
# @STEP 1			Going 'Back' and checking window content.
#=============================================================================================
if (win_exists("Database Manager Installation Wizard") == 0) {

	set_window ("Database Manager Installation Wizard", 2);
	button_press ("< Back");
	wait(2);
	
	if (match (kernel_version, "7.5.00") != 0 ||
		match (kernel_version, "7.6.00") != 0) {
		
		set_window ("Database Manager Installation Wizard", 2);
		button_press ("< Back");
		wait(2);
	}
	
	ActiveX_get_info("DBMWfr2.Framework", "HeaderTitle", Header);
	
	if (Header == "Backup Medium") {		
		tl_step ("Installation wizard - 'Installation Mode' - 'Back'", "0", "Window is correct. - TN: " & TestName);
	} else {		
		tl_step ("Installation wizard - 'Installation Mode' - 'Back'", "1", "Window is incorrect. - TN: " & TestName);
	}
#=============================================================================================
# @STEP 2			Going 'Next' and checking window content.
#=============================================================================================
	set_window ("Database Manager Installation Wizard", 2);
	button_press ("Next >");	
	wait(2);
	
	if (match (kernel_version, "7.5.00") != 0 ||
		match (kernel_version, "7.6.00") != 0) {
		
		set_window ("Database Manager Installation Wizard", 2);
		obj_get_text("DBMWfr2.Framework", text);
		
		if (match (text, "Hot Standby System") > 0) {
			button_press ("Next >");	
			wait(2);
		}
	}
	
	ActiveX_get_info("DBMWfr2.Framework", "HeaderTitle", Header);
	
	if (GUI_Version == "2") {
		exp_Header = "Installation Mode";
	}
	if (GUI_Version == "3") {
		exp_Header = "Creation Mode";
	}
	
	if (Header == exp_Header) {		
		tl_step ("Installation wizard - 'Installation Mode' - 'Next'", "0", "Window is correct. - TN: " & TestName);
	} else {		
		tl_step ("Installation wizard - 'Installation Mode' - 'Next'", "1", "Window is incorrect. - TN: " & TestName);
	}
#=============================================================================================
# @STEP 3			Checking controls - Install and start instance.
#=============================================================================================
	set_window ("Database Manager Installation Wizard", 2);
		
	if (obj_exists("Install and start instance", 0) == 0 &&
		obj_exists("Install instance for recovery", 0) == 0) {
		
		tl_step ("Installation wizard - 'Installation Mode' - Radio buttons", "0", "Displayed correctly. - TN: " & TestName);
		
		obj_get_info ("Install and start instance", "value", state1);
		obj_get_info ("Install instance for recovery", "value", state2);
		
		if (state1 == 1 &&
			state2 == 0) {
			
			tl_step ("Installation wizard - 'Installation Mode' - Radio buttons", "0", "State of buttons correct. - TN: " & TestName);
			
			obj_get_info ("txtDBAUser", "enabled", value1);
			obj_get_info ("txtDBAPassword", "enabled", value2);
			obj_get_info ("txtDBAConfirm", "enabled", value3);
			
			if (value1 == 1 &&
				value2 == 1 &&
				value3 == 1) {
				
				tl_step ("Installation wizard - 'Installation Mode' - textboxes", "0", "State of boxes correct. - TN: " & TestName);
			} else {
				tl_step ("Installation wizard - 'Installation Mode' - textboxes", "1", "State of boxes incorrect. - TN: " & TestName);
			}
		} else {
			tl_step ("Installation wizard - 'Installation Mode' - Radio buttons", "1", "State of buttons incorrect. - TN: " & TestName);
		}
#=============================================================================================
# @STEP 4			Checking controls - Install instance for recovery.
#=============================================================================================
		set_window ("Database Manager Installation Wizard", 3);
		button_set ("Install instance for recovery", ON);
		
		obj_get_info ("Install and start instance", "value", state1);
		obj_get_info ("Install instance for recovery", "value", state2);
		
		if (state1 == 0 &&
			state2 == 1) {
			
			tl_step ("Installation wizard - 'Installation Mode' - Radio buttons", "0", "State of buttons correct. - TN: " & TestName);
			
			obj_get_info ("txtDBAUser", "enabled", value1);
			obj_get_info ("txtDBAPassword", "enabled", value2);
			obj_get_info ("txtDBAConfirm", "enabled", value3);
			
			if (value1 == 0 &&
				value2 == 0 &&
				value3 == 0) {
				
				tl_step ("Installation wizard - 'Installation Mode' - textboxes", "0", "State of boxes correct. - TN: " & TestName);
			} else {
				tl_step ("Installation wizard - 'Installation Mode' - textboxes", "1", "State of boxes incorrect. - TN: " & TestName);
			}
		} else {
			tl_step ("Installation wizard - 'Installation Mode' - Radio buttons", "1", "State of buttons incorrect. - TN: " & TestName);
		}
		
		set_window ("Database Manager Installation Wizard", 3);
		button_set ("Install and start instance", ON);
	} else {
		tl_step ("Installation wizard - 'Installation Mode' - Radio buttons", "1", "Displayed incorrectly. - TN: " & TestName);
	}
#=============================================================================================
# @STEP 5			Going 'Next >'.
#=============================================================================================
	set_window ("Database Manager Installation Wizard", 2);
	button_press ("Next >");
	
	wait(4);
} else {
	
	tl_step("Database Manager Installation Wizard - Window Check", "1", "Window not open - TN: " & TestName);
	WizardOpen = 0;
}
