public void WhenAddAStep(Table steps) { foreach (var step in steps.Rows) { PlanPanel.AddCompletedStep(step); } }
public void WhenAddContactReport(string planName, Table batchRows) { try { planName += uniqueStamp; //The unique stamp is a series of numbers added to the end to keep names distinctive string xPath = "*//div/table/tbody/tr[1]/td[9]/div/a[text()='" + planName + "']"; //this path goes to the link which opens to the plan page Dialog.WaitClick(xPath, 20); if (batchRows.RowCount != 1) { throw new ArgumentException("Only provide one row to select."); } var batchRow = batchRows.Rows[0]; // select only the first row of the batch if (batchRow.ContainsKey("Owner") && batchRow["Owner"] != null && batchRow["Owner"] != string.Empty) { batchRow["Owner"] += uniqueStamp; //The unique stamp is a series of numbers to keep constituents different from each other } PlanPanel.SelectSectionDatalistRow(batchRow, "Planned and pending steps"); //Open the row that has the data in the batchRows batch PlanPanel.ClickButton("Contact report"); //click on the contact report button PlanPanel.WaitClick("//a[contains(@id,'bbui-gen-tbaraction')]/span[text()='File a contact report']", 20); // click on the "file a contact report" button } catch (Exception ex) { throw new Exception("Error: could not add a contact report to a prospect. " + ex.Message); } }
public void ThenACompletedStepIsSaved(Table steps) { foreach (var step in steps.Rows) { if (!PlanPanel.CompletedStepExists(step)) { throw new ArgumentException(String.Format("Completed step '{0}' does not exist.", step.Values.ToString())); } } }
public Plan() { panel = new PlanPanel("", PanelButtonClick); screensStack = new Stack <string>(); Footer footer = new Footer(Resources.Close, Resources.Back); footer.SetCallback(0, (s, e) => { this.Close(); }); footer.SetCallback(1, (s, e) => { if (screensStack.Count == 0) { return; } currentScreen = screensStack.Pop(); panel.LoadButtons(currentScreen, PanelButtonClick); }); Controls.Add(panel); Controls.Add(footer); }