public void SeEmployer_Create_and_move_Workorder() { var _emp1 = frb.CloneEmployer(); var _emp2 = frb.CloneEmployer(); var _wo = frb.CloneWorkOrder(); _wo.contactName = ui.RandomString(10); // create first worker ui.employerCreate(_emp1); // create 2nd worker ui.employerCreate(_emp2); // create workorder for employer 2 ui.workOrderCreate(_emp2, _wo); // // string prefix = "WO" + _wo.ID + "-"; // click change button Thread.Sleep(3000); ui.WaitThenClickElement(By.Id(prefix + "changeEmployerBtn")); // find new employer ui.WaitForElement(By.Id("employerSelectTable_searchbox")).SendKeys(_emp1.name); // check for name in popup table column ui.WaitForElementValue(By.XPath("//table[@id='employerSelectTable']/tbody/tr/td[2]"), _emp1.name); // doubleclick on row (using elem 6 b/c first elems might be off screen) ui.WaitAndDoubleClick(By.XPath("//table[@id='employerSelectTable']/tbody/tr/td[6]")); // // confirm dialog ui.WaitThenClickElement(By.Id("popup_ok")); ui.WaitThenClickElement(By.Id("employerListTab")); ui.WaitForElement(By.Id("employerTable_searchbox")).SendKeys(_emp1.name); // search for employer 1 ui.WaitForElementValue(By.XPath("//table[@id='employerTable']/tbody/tr/td[2]"), _emp1.name); ui.WaitAndDoubleClick(By.XPath("//table[@id='employerTable']/tbody/tr/td[6]")); Thread.Sleep(5000); var selectedTab = ui.WaitForElement(By.CssSelector("li.employer.ui-tabs-selected a")); var recID = Convert.ToInt32(selectedTab.GetAttribute("recordid")); ui.WaitForElement(By.Id("workOrderListTab_" + _emp1.ID)); Assert.IsTrue(ui.WaitForElementValue(By.XPath("//table[@id='workOrderTable_" + recID.ToString() + "']/tbody/tr/td[5]"), _wo.contactName)); }
public void SeActivity_unauth_open_record() { //Arrange // example from EmployerTests.cs -- SeEmployer_Create_and_move_Workorder() // var selectedTab = ui.WaitForElement(By.CssSelector("li.employer.ui-tabs-selected a")); // var recID = Convert.ToInt32(selectedTab.GetAttribute("recordid")); ui.activityMenuLink(); //Find Activity menu link and click var activityRecord = ui.WaitForElement(By.XPath("//table[@id='activityTable']/tbody/tr[1]")); var activityRecordID = Convert.ToInt32(activityRecord.GetAttribute("recordid")); //Act ui.WaitAndDoubleClick(By.XPath("//table[@id='activityTable']/tbody/tr[1]")); //Assert // look for activityTab to open up var activityNewTab = ui.WaitForElement(By.CssSelector("#activity" + activityRecordID + "-EditTab")); var newTabAnchor = ui.WaitForElement(By.CssSelector("#activity" + activityRecordID + "-EditTab a")); int anchorID = Convert.ToInt32(newTabAnchor.GetAttribute("recordid")); Assert.IsNotNull(activityNewTab, "Failed to find #activityList"); Assert.AreEqual(activityRecordID, anchorID, "activityRecordID from datatables does not match ID in tab for record"); }