Skip to content

Commit

Permalink
Add MFA Key to UCI Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelRodriguez8008 committed Jan 23, 2020
1 parent a136955 commit fbfc3c7
Show file tree
Hide file tree
Showing 43 changed files with 202 additions and 547 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,25 @@
// Licensed under the MIT license.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Dynamics365.UIAutomation.Api.UCI;
using Microsoft.Dynamics365.UIAutomation.Browser;
using System;
using System.Security;

namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class BusinessProcessFlowNextStageUCI
public class BusinessProcessFlowNextStage : TestsBase
{
private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
private readonly SecureString _password = System.Configuration.ConfigurationManager.AppSettings["OnlinePassword"].ToSecureString();
private readonly Uri _xrmUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["OnlineCrmUrl"].ToString());
[TestInitialize]
public override void InitTest() => base.InitTest();

[TestCleanup]
public override void FinishTest() => base.FinishTest();

public override void NavigateToHomePage() => _xrmApp.Navigation.OpenSubArea("Sales", "Leads");

[TestMethod]
public void UCITestBusinessProcessFlowNextStage()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

xrmApp.Navigation.OpenSubArea("Sales", "Leads");

xrmApp.Grid.OpenRecord(0);

xrmApp.BusinessProcessFlow.NextStage("Qualify");
}
_xrmApp.Grid.OpenRecord(0);
_xrmApp.BusinessProcessFlow.NextStage("Qualify");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,30 @@
// Licensed under the MIT license.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Dynamics365.UIAutomation.Api.UCI;
using Microsoft.Dynamics365.UIAutomation.Browser;
using System;
using System.Security;

namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class SwitchBusinessProcessFlowUCI
public class SwitchBusinessProcessFlow : TestsBase
{
private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
private readonly SecureString _password = System.Configuration.ConfigurationManager.AppSettings["OnlinePassword"].ToSecureString();
private readonly Uri _xrmUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["OnlineCrmUrl"].ToString());
[TestInitialize]
public override void InitTest() => base.InitTest();

[TestCleanup]
public override void FinishTest() => base.FinishTest();

public override void NavigateToHomePage() => _xrmApp.Navigation.OpenSubArea("Sales", "Leads");

[TestMethod]
public void UCITestSwitchBusinessProcessFlow()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);
_xrmApp.Navigation.OpenSubArea("Sales", "Leads");

xrmApp.Navigation.OpenSubArea("Sales", "Leads");
_xrmApp.Grid.OpenRecord(0);

xrmApp.Grid.OpenRecord(0);
//xrmApp.Entity.SwitchProcess("AccountEventingProcess");
_xrmApp.Entity.SwitchProcess("Lead to Opportunity Sales Process");

//xrmApp.Entity.SwitchProcess("AccountEventingProcess");
xrmApp.Entity.SwitchProcess("Lead to Opportunity Sales Process");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,31 @@

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Dynamics365.UIAutomation.Api.UCI;
using Microsoft.Dynamics365.UIAutomation.Browser;
using System;
using System.Security;


namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class AssignAccountUCI
public class AssignAccount : TestsBase
{
private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
private readonly SecureString _password = System.Configuration.ConfigurationManager.AppSettings["OnlinePassword"].ToSecureString();
private readonly Uri _xrmUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["OnlineCrmUrl"].ToString());
[TestInitialize]
public override void InitTest() => base.InitTest();

[TestCleanup]
public override void FinishTest() => base.FinishTest();

public override void NavigateToHomePage() => _xrmApp.Navigation.OpenSubArea("Sales", "Accounts");

[TestMethod]
public void UCITestAssignAccount()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

xrmApp.Navigation.OpenSubArea("Sales", "Accounts");

xrmApp.Grid.OpenRecord(0);

xrmApp.ThinkTime(2000);
_xrmApp.Grid.OpenRecord(0);

xrmApp.CommandBar.ClickCommand("Assign");
_xrmApp.ThinkTime(2000);

xrmApp.Dialogs.Assign(Dialogs.AssignTo.User, "Grant");
_xrmApp.CommandBar.ClickCommand("Assign");

}
_xrmApp.Dialogs.Assign(Dialogs.AssignTo.User, "Grant");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,31 @@
// Licensed under the MIT license.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Dynamics365.UIAutomation.Api.UCI;
using Microsoft.Dynamics365.UIAutomation.Browser;
using System;
using System.Security;

namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class CloseOpportunityUCI
public class CloseOpportunity : TestsBase
{
private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
private readonly SecureString _password = System.Configuration.ConfigurationManager.AppSettings["OnlinePassword"].ToSecureString();
private readonly Uri _xrmUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["OnlineCrmUrl"].ToString());
[TestInitialize]
public override void InitTest() => base.InitTest();

[TestCleanup]
public override void FinishTest() => base.FinishTest();

public override void NavigateToHomePage() => _xrmApp.Navigation.OpenSubArea("Sales", "Opportunities");

[TestMethod]
public void UCITestCloseOpportunity()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

xrmApp.Navigation.OpenSubArea("Sales", "Opportunities");

xrmApp.Grid.OpenRecord(0);
_xrmApp.Navigation.OpenSubArea("Sales", "Opportunities");

xrmApp.CommandBar.ClickCommand("Close as Won");
_xrmApp.Grid.OpenRecord(0);

xrmApp.Dialogs.CloseOpportunity(123.45, DateTime.Now, "test");
_xrmApp.CommandBar.ClickCommand("Close as Won");

}
_xrmApp.Dialogs.CloseOpportunity(123.45, DateTime.Now, "test");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,38 @@
// Licensed under the MIT license.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Dynamics365.UIAutomation.Api.UCI;
using Microsoft.Dynamics365.UIAutomation.Browser;
using System;
using System.Collections.Generic;
using System.Security;

namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class CommandButton
public class CommandButton : TestsBase
{
private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
private readonly SecureString _password = System.Configuration.ConfigurationManager.AppSettings["OnlinePassword"].ToSecureString();
private readonly Uri _xrmUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["OnlineCrmUrl"].ToString());
[TestInitialize]
public override void InitTest() => base.InitTest();

[TestCleanup]
public override void FinishTest() => base.FinishTest();

public override void NavigateToHomePage() => _xrmApp.Navigation.OpenSubArea("Sales", "Accounts");

[TestMethod]
public void UCITestNewCommandBarButton()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

xrmApp.Navigation.OpenSubArea("Sales", "Accounts");

xrmApp.CommandBar.ClickCommand("New");
xrmApp.ThinkTime(2000);
}
_xrmApp.Navigation.OpenSubArea("Sales", "Accounts");
_xrmApp.CommandBar.ClickCommand("New");
_xrmApp.ThinkTime(2000);
}

[TestMethod]
public void UCITestRetrieveCommandBarValues()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

xrmApp.Navigation.OpenSubArea("Sales", "Accounts");

var commandValues = xrmApp.CommandBar.GetCommandValues().Value;
int commandCount = commandValues.Count;

var includeMoreCommandValues = xrmApp.CommandBar.GetCommandValues(true).Value;
int totalCommandCount = includeMoreCommandValues.Count;
var commandValues = _xrmApp.CommandBar.GetCommandValues().Value;
int commandCount = commandValues.Count;

xrmApp.ThinkTime(2000);
var includeMoreCommandValues = _xrmApp.CommandBar.GetCommandValues(true).Value;
int totalCommandCount = includeMoreCommandValues.Count;

}
_xrmApp.ThinkTime(2000);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,32 @@
// Licensed under the MIT license.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Dynamics365.UIAutomation.Api.UCI;
using Microsoft.Dynamics365.UIAutomation.Browser;
using System;
using System.Security;


namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class DuplicateDetectionUCI
public class DuplicateDetection : TestsBase
{
private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
private readonly SecureString _password = System.Configuration.ConfigurationManager.AppSettings["OnlinePassword"].ToSecureString();
private readonly Uri _xrmUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["OnlineCrmUrl"].ToString());
[TestInitialize]
public override void InitTest() => base.InitTest();

[TestCleanup]
public override void FinishTest() => base.FinishTest();

public override void NavigateToHomePage() => _xrmApp.Navigation.OpenSubArea("Sales", "Contacts");
[TestMethod]
public void UCITestDuplicateDetection()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

xrmApp.Navigation.OpenSubArea("Sales", "Contacts");

xrmApp.CommandBar.ClickCommand("New");
_xrmApp.Navigation.OpenSubArea("Sales", "Contacts");

xrmApp.Entity.SetValue("firstname", "EasyRepro");
xrmApp.Entity.SetValue("lastname", "Duplicate");
xrmApp.Entity.SetValue("emailaddress1", "[email protected]");
_xrmApp.CommandBar.ClickCommand("New");

xrmApp.Entity.Save();
_xrmApp.Entity.SetValue("firstname", "EasyRepro");
_xrmApp.Entity.SetValue("lastname", "Duplicate");
_xrmApp.Entity.SetValue("emailaddress1", "[email protected]");

}
_xrmApp.Entity.Save();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,24 @@
// Licensed under the MIT license.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Dynamics365.UIAutomation.Api.UCI;
using Microsoft.Dynamics365.UIAutomation.Browser;
using System;
using System.Security;

namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class SelectDashboardUCI
public class SelectDashboard : TestsBase
{
private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
private readonly SecureString _password = System.Configuration.ConfigurationManager.AppSettings["OnlinePassword"].ToSecureString();
private readonly Uri _xrmUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["OnlineCrmUrl"].ToString());
[TestInitialize]
public override void InitTest() => base.InitTest();

[TestCleanup]
public override void FinishTest() => base.FinishTest();

[TestMethod]
public void UCITestSelectDashboard()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

xrmApp.Navigation.ClickQuickLaunchButton("Dashboards");

xrmApp.Dashboard.SelectDashboard("My Knowledge Dashboard");
_xrmApp.Navigation.ClickQuickLaunchButton("Dashboards");

}
_xrmApp.Dashboard.SelectDashboard("My Knowledge Dashboard");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Microsoft.Dynamics365.UIAutomation.Sample.UCI
{
[TestClass]
public class Grid
public class Grid : TestsBase
{

private readonly SecureString _username = System.Configuration.ConfigurationManager.AppSettings["OnlineUsername"].ToSecureString();
Expand All @@ -23,7 +23,7 @@ public void UCIGridSort()
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password);
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password, _mfaSecrectKey);

xrmApp.Navigation.OpenApp(UCIAppName.Sales);

Expand Down
Loading

0 comments on commit fbfc3c7

Please sign in to comment.