/// <summary> /// delete /// </summary> public void SelectDelete() { string currentWindow = Driver.CurrentWindowHandle; Report.Write("The current window is: '" + currentWindow + "'."); DeleteLink.Click(); AlertHandler alert = new AlertHandler(); alert.VerifyText("Are you sure you want to delete this rubric? All associations to this rubric will be permanently deleted."); alert.Accept(); //switch to window DriverCommands.WaitToSwitchWindow(currentWindow, 5); }
/// <summary> /// Find the GUID for the form and set the FormGuid property /// </summary> public void FindFormGuid() { if (DeleteLink == null) { FindDeleteLink(); } if (DeleteLink == null) { return; } var onclick = DeleteLink.GetAttribute("onclick"); var left = onclick.IndexOf("{DeleteFormSent(\"", StringComparison.Ordinal) + "{DeleteFormSent(\"".Length; var right = onclick.IndexOf("\") }", StringComparison.Ordinal); var guid = onclick.Substring(left, right - left); // Set the FormHash property FormGuid = guid; }
/// <summary> /// click the delete link /// </summary> public void SelectDelete() { CurrentWindow = Driver.CurrentWindowHandle; Report.Write("The current window is: '" + CurrentWindow + "'."); DeleteLink.Wait(5).Click(); IAlert alert = Driver.SwitchTo().Alert(); string expected = "Are you sure you want to delete this rubric?"; if (Driver.WrappedDriver.GetType() == typeof(DummyDriver)) { ((DummyIAlert)alert).Text = expected; } string actual = alert.Text; Report.Write("The alert text: '" + actual + "'."); Assert.IsTrue(actual.Contains(expected), "The delete confirmation pop-up does not contain the expected text: '" + expected + "'; actual text: '" + actual + "'."); alert.Accept(); //switch to window DriverCommands.WaitToSwitchWindow(CurrentWindow, 5); DriverCommands.WaitAndMeasurePageLoadTime(90, 30); }
/// <summary> /// select actions, then select delete /// </summary> public void SelectDelete() { SelectActions(); DeleteLink.Wait(3).Click(); }
public DeletePage delete() { DeleteLink.Click(); return(new DeletePage(_driver)); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { DeleteLink?.Invoke(this, e); }