public CheckStatus ExecuteCheck(Check check, IIQObject activeObject) { CheckStatus checkStatus = CheckStatus.Completed; log.Debug(">ExecuteCheck"); try { switch (check.Condition) { case "mustHaveLinkWith": checkStatus = IIQHelper.CheckMustHaveLinkWith(activeObject.Id, check.Value) ? CheckStatus.Completed : CheckStatus.Pending; break; case "xpathMustMatch": checkStatus = IIQHelper.CheckXpathMustMatch(activeObject.Id, check.Value) ? CheckStatus.Completed : CheckStatus.Pending; break; } log.Debug("<ExecuteCheck"); return(checkStatus); } catch (Exception ex) { log.Error($"Check error: {check.ToString()}. Exception message: {ex.Message}"); return(CheckStatus.Error); } }
private void closeAllTestsToolStripMenuItem_Click(object sender, EventArgs e) { var confirmResult = MessageBox.Show("Are you sure you want to close all test cases?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (confirmResult == DialogResult.Yes) { //stop execution btnStop_Click(this, new EventArgs()); //lstTestCases.Rows.Clear(); dgvActions.Rows.Clear(); dgvChecks.Rows.Clear(); _testCases = new List <TestCase>(); _activeTestCaseIndex = 0; _activeObject = null; txtActiveObject.Text = string.Empty; btnPlay.Enabled = false; lblStatus.Text = "Doing nothing..."; } }
public void ExecuteChecks(List <Check> checks, IIQObject activeObject) { log.Debug("Starting check execution"); bool allSuccessfull = true; foreach (Check check in checks) { check.Status = ExecuteCheck(check, activeObject); if (check.Status != CheckStatus.Completed) { allSuccessfull = false; } } ChecksExecuted(this, allSuccessfull); if (allSuccessfull) { AllChecksSuccessfull(this, new EventArgs()); } }