Skip to content

Commit

Permalink
Release changes for v8.2 issues...
Browse files Browse the repository at this point in the history
Issue #49
Issue #50
Issue #58
Issue #57
Issue #55
Issue #48
Issue #46
Issue #40
  • Loading branch information
dtu11 committed Dec 21, 2017
1 parent 4d9b211 commit 43a958a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public static class Elements
{ "Dialog_AddConnectionSave", "id(\"connection|NoRelationship|Form|Mscrm.Form.connection.SaveAndClose-Large\")" },
{ "Dialog_RoleLookupButton", "id(\"record2roleid\")" },
{ "Dialog_RoleLookupTable", "id(\"record2roleid_IMenu\")" },
{ "Dialog_WarningFooter" , "//*[@id=\"crmDialogFooter\"]" },
{ "Dialog_WarningCloseButton", "//*[@id=\"butBegin\"]" },

//GuidedHelp
{ "GuidedHelp_MarsOverlay" , "id(\"marsOverlay\")"},
Expand Down Expand Up @@ -335,6 +337,8 @@ public static class Dialogs
public static string WorkflowHeader = "Dialog_WorkflowHeader";
public static string ProcessFlowHeader = "Dialog_ProcessFlowHeader";
public static string AddConnectionHeader = "Dialog_AddConnectionHeader";
public static string WarningFooter = "Dialog_WarningFooter";
public static string WarningCloseButton = "Dialog_WarningCloseButton";

public static class CloseOpportunity
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,10 @@ public BrowserCommandResult<bool> AddTask(string subject, string description, Da
this.SetValue(Elements.ElementId[Reference.ActivityFeed.ActivityTaskSubjectId], subject);
this.SetValue(Elements.ElementId[Reference.ActivityFeed.ActivityTaskDescriptionId], description);
this.SetCalenderValue(Elements.ElementId[Reference.ActivityFeed.ActivityAddTaskDueDateId], dueDate.ToShortDateString());
driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.ActivityFeed.ActivityTaskScheduledEnd]));
this.SetCalenderValue(Elements.ElementId[Reference.ActivityFeed.ActivityAddTaskDueTimeId], dueDate.ToShortTimeString());
this.SetValue(priority);
driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.ActivityFeed.ActivityTaskOk]));
return true;
Expand Down
14 changes: 14 additions & 0 deletions Microsoft.Dynamics365.UIAutomation.Api/Pages/XrmDialogPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,5 +288,19 @@ public BrowserCommandResult<bool> AddUser(int thinkTime = Constants.DefaultThink
});
}

public BrowserCommandResult<bool> CloseWarningDialog()
{
return this.Execute(GetOptions($"Close Warning Dialog"), driver =>
{
var dialogFooter = driver.WaitUntilAvailable(By.XPath(Elements.Xpath[Reference.Dialogs.WarningFooter]));
if (
!(dialogFooter?.FindElements(By.XPath(Elements.Xpath[Reference.Dialogs.WarningCloseButton])).Count >
0)) return true;
var closeBtn = dialogFooter.FindElement(By.XPath(Elements.Xpath[Reference.Dialogs.WarningCloseButton]));
closeBtn.Click();
return true;
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public BrowserCommandResult<bool> OpenHomePage(int thinkTime = Constants.Default
foreach (var subItem in subItems)
{
dictionary.Add(subItem.Text.ToLowerString(), subItem);
dictionary.Add(subItem.GetAttribute("title").ToLowerString(), subItem);
}
return dictionary;
Expand Down Expand Up @@ -161,7 +161,8 @@ public BrowserCommandResult<bool> GlobalSearch(string searchText, int thinkTime
d =>
{
driver.FindElement(By.XPath(Elements.Xpath[Reference.Navigation.Search])).SendKeys(searchText, true);
driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Navigation.StartSearch]));
Thread.Sleep(500);
driver.FindElement(By.XPath(Elements.Xpath[Reference.Navigation.Search])).SendKeys(Keys.Enter);
},
d => { throw new InvalidOperationException("The Global Search text field is not available."); });
Expand Down
12 changes: 8 additions & 4 deletions Microsoft.Dynamics365.UIAutomation.Api/XrmPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ public BrowserCommandResult<bool> SetValue(string field, bool check)
//return this.Execute($"Set Value: {field}", SetValue, field, check);
return this.Execute(GetOptions($"Set Value: {field}"), driver =>
{
if (driver.HasElement(By.Id("int_" + field)))
if (driver.HasElement(By.Id(field)))
{
var input = driver.FindElement(By.Id("int_" + field));
var input = driver.FindElement(By.Id(field));
var checkBox = input.FindElement(By.TagName("input"));
var bCheck = checkBox.GetAttribute("value") == "1";
if (bool.Parse(input.FindElement(By.TagName("input")).GetAttribute("checked")) && !check)
input.FindElement(By.TagName("input")).Click();
if (bCheck != check)
{
checkBox.Click();
}
}
else
throw new InvalidOperationException($"Field: {field} Does not exist");
Expand Down

0 comments on commit 43a958a

Please sign in to comment.