233 lines
16 KiB
C#
233 lines
16 KiB
C#
/*
|
|
*/
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System;
|
|
|
|
namespace Prevu
|
|
{
|
|
[TestClass]
|
|
public class PeopleResources : BaseTest
|
|
{
|
|
#region Initialization & CleanUp
|
|
|
|
[ClassInitialize]
|
|
public static void ClassInitialize(TestContext TestContext)
|
|
{
|
|
BaseTest.ClassInitialize(TestContext);
|
|
}
|
|
[ClassCleanup]
|
|
public static void ClassCleanup()
|
|
{
|
|
BaseTest.ClassCleanup();
|
|
}
|
|
|
|
#endregion Initialization & CleanUp
|
|
|
|
[TestMethod, TestCategory("Smoke Test"), TestCategory("People Resources"), Timeout(testTimeout)]
|
|
[TestProperty("Create People Resource from Team Board Team Resoruces widget", "1. Open the MK Team Board page<br>2. Click 'Add Resource' button in the Team Resources widget<br>3. Fill the following fields:<br> First Name<br> Last Name<br> Employee ID<br> Email Address<br> Expenditure Category: Quality Assurance(zz - N / A)<br> Team: MK<br> Work Week: Stanfarf Week<br> Employee Status: Active<br> Change planned capacity: Check(allows to keep planned capacity up to date after changes; when category or team changed, changes planned capacity for both categories / teams)<br> Permanent: Check<br> Start Date: Today<br> End Date: Today + 180<br>4. Click Save<br>5. Find created people resource and check stored data")]
|
|
public void CreatePeopleResourceFromTeamBoardTeamResourcesWidget()
|
|
{
|
|
string uid = tempId + "1";
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
Assert.IsTrue(teamBoardPage.OpenTeamBoard("c8090d7c-74d4-4036-9e17-b2d8695e1f7d"));
|
|
string id = "";
|
|
string firstName = uid;
|
|
string lastName = uid;
|
|
string employeeID = uid;
|
|
string emailAddress = string.Format("{0}@gmail.com", uid);
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
string team = "MK";
|
|
string workWeek = "Standard Week";
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = true;
|
|
bool permanent = false;
|
|
DateTime startDate = DateTime.Today;
|
|
DateTime endDate = DateTime.Today.AddDays(180);
|
|
Assert.IsTrue(teamBoardPage.CreatePeopleResourceFromTeamBoardTeamResourcesWidget(firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate, out id));
|
|
Assert.IsFalse(string.IsNullOrEmpty(id));
|
|
Assert.IsTrue(peopleResourcePage.CheckPeopleResource(id, firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
}
|
|
|
|
[TestMethod, TestCategory("Smoke Test"), TestCategory("People Resources"), Timeout(testTimeout)]
|
|
[TestProperty("Create People Resource from Team Board Planning Capacity widget", "")]
|
|
public void CreatePeopleResourceFromTeamBoardPlanningCapacityWidget()
|
|
{
|
|
//TODO
|
|
string uid = tempId + "2";
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
Assert.IsTrue(teamBoardPage.OpenTeamBoard("c8090d7c-74d4-4036-9e17-b2d8695e1f7d"));
|
|
string id = "";
|
|
string firstName = uid;
|
|
string lastName = uid;
|
|
string employeeID = uid;
|
|
string emailAddress = string.Format("{0}@gmail.com", uid);
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
string team = "MK";
|
|
string workWeek = "Standard Week";
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = true;
|
|
bool permanent = false;
|
|
DateTime startDate = DateTime.Today;
|
|
DateTime endDate = DateTime.Today.AddDays(180);
|
|
Assert.IsTrue(teamBoardPage.CreatePeopleResourceFromTeamBoardTeamResourcesWidget(firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate, out id));
|
|
Assert.IsFalse(string.IsNullOrEmpty(id));
|
|
Assert.IsTrue(peopleResourcePage.CheckPeopleResource(id, firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
}
|
|
|
|
[TestMethod, TestCategory("Smoke Test"), TestCategory("People Resources"), Timeout(testTimeout)]
|
|
[TestProperty("Edit People Resource", "1. Open people resource details page<br>2. Click the Edit page<br>3. Change all properties<br>4. Click the Save button<br>5. Check the stored changes")]
|
|
public void EditPeopleResource()
|
|
{
|
|
string uid = tempId + "3";
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
string resourceId = "7bcf0353-7381-43ab-8219-931788c370cc";
|
|
string firstName = uid;
|
|
string lastName = uid;
|
|
string employeeID = uid;
|
|
string emailAddress = string.Format("{0}@gmail.com", uid);
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
string team = "MK";
|
|
string workWeek = "Standard Week";
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = true;
|
|
bool permanent = false;
|
|
DateTime startDate = DateTime.Today.AddDays(-5);
|
|
DateTime endDate = DateTime.Today.AddDays(55);
|
|
Assert.IsTrue(peopleResourcePage.EditPeopleResource(resourceId, firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
}
|
|
|
|
[TestMethod, TestCategory("Smoke Test"), TestCategory("People Resources"), Timeout(testTimeout)]
|
|
[TestProperty("Delete People Resource", "1. Open the MK Team Board page<br>2. Find a people resource in the Team Resources widget<br>3. Click the 'Delete' button near the resource<br>4. Make sure that the resource has been deleted")]
|
|
public void DeletePeopleResource()
|
|
{
|
|
string uid = tempId + "4";
|
|
string teamId = "c8090d7c-74d4-4036-9e17-b2d8695e1f7d";
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
Assert.IsTrue(teamBoardPage.OpenTeamBoard(teamId));
|
|
string resourceId = "";
|
|
string firstName = uid;
|
|
string lastName = uid;
|
|
string employeeID = uid;
|
|
string emailAddress = string.Format("{0}@gmail.com", uid);
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
string team = "MK";
|
|
string workWeek = "Standard Week";
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = true;
|
|
bool permanent = false;
|
|
DateTime startDate = DateTime.Today;
|
|
DateTime endDate = DateTime.Today.AddDays(180);
|
|
Assert.IsTrue(teamBoardPage.CreatePeopleResourceFromTeamBoardTeamResourcesWidget(firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate, out resourceId));
|
|
Assert.IsFalse(string.IsNullOrEmpty(resourceId));
|
|
Assert.IsTrue(teamBoardPage.DeletePeopleResource(resourceId, teamId, firstName, lastName));
|
|
}
|
|
|
|
[TestMethod, TestCategory("People Resources"), Timeout(testTimeout)]
|
|
[TestProperty("Create People Resource with changing planned capacity", "1. Open the MK Team Board page<br>2. Click 'Add Resource' button in the Team Resources widget<br>3. Fill the following fields:<br> First Name<br> Last Name<br> Employee ID<br> Email Address<br> Expenditure Category: Quality Assurance(zz - N / A)<br> Team: MK<br> Work Week: Stanfarf Week<br> Employee Status: Active<br> Change planned capacity: Check (allows to keep planned capacity up to date after changes; when category or team changed, changes planned capacity for both categories / teams)<br> Permanent: Check<br> Start Date: Today<br> End Date: Today + 180<br>4. Click Save<br>5. Find created people resource and check stored data<br>6. Check changed planned capacity")]
|
|
public void CreatePeopleResourceWithChangingPlannedCapacity()
|
|
{
|
|
string uid = tempId + "5";
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
string team = "MK";
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
float plannedCapacityBefore = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
Assert.IsTrue(teamBoardPage.OpenTeamBoard("c8090d7c-74d4-4036-9e17-b2d8695e1f7d"));
|
|
string id = "";
|
|
string firstName = uid;
|
|
string lastName = uid;
|
|
string employeeID = uid;
|
|
string emailAddress = string.Format("{0}@gmail.com", uid);
|
|
string workWeek = "Standard Week";
|
|
DateTime startDate = DateTime.Today.AddDays(GetIntNegative());
|
|
DateTime endDate = DateTime.Today.AddDays(GetIntPositive());
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = true;
|
|
bool permanent = false;
|
|
Assert.IsTrue(teamBoardPage.CreatePeopleResourceFromTeamBoardTeamResourcesWidget(firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate, out id));
|
|
Assert.IsFalse(string.IsNullOrEmpty(id));
|
|
Assert.IsTrue(peopleResourcePage.CheckPeopleResource(id, firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
float plannedCapacityAfter = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
Assert.AreNotEqual(plannedCapacityBefore, -1);
|
|
Assert.AreNotEqual(plannedCapacityAfter, -1);
|
|
//Assert.AreNotEqual(plannedCapacityBefore, plannedCapacityAfter); TODO
|
|
}
|
|
|
|
[TestMethod, TestCategory("People Resources"), Timeout(testTimeout)]
|
|
[TestProperty("Create People Resource without changing planned capacity", "1. Open the MK Team Board page<br>2. Click 'Add Resource' button in the Team Resources widget<br>3. Fill the following fields:<br> First Name<br> Last Name<br> Employee ID<br> Email Address<br> Expenditure Category: Quality Assurance(zz - N / A)<br> Team: MK<br> Work Week: Stanfarf Week<br> Employee Status: Active<br> Change planned capacity: Uncheck (allows to keep planned capacity up to date after changes; when category or team changed, changes planned capacity for both categories / teams)<br> Permanent: Check<br> Start Date: Today<br> End Date: Today + 180<br>4. Click Save<br>5. Find created people resource and check stored data<br>6. Check unchanged planned capacity")]
|
|
public void CreatePeopleResourceWithoutChangingPlannedCapacity()
|
|
{
|
|
string uid = tempId + "6";
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
string team = "MK";
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
float plannedCapacityBefore = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
Assert.IsTrue(teamBoardPage.OpenTeamBoard("c8090d7c-74d4-4036-9e17-b2d8695e1f7d"));
|
|
string id = "";
|
|
string firstName = uid;
|
|
string lastName = uid;
|
|
string employeeID = uid;
|
|
string emailAddress = string.Format("{0}@gmail.com", uid);
|
|
string workWeek = "Standard Week";
|
|
DateTime startDate = DateTime.Today.AddDays(GetIntNegative());
|
|
DateTime endDate = DateTime.Today.AddDays(GetIntPositive());
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = false;
|
|
bool permanent = false;
|
|
Assert.IsTrue(teamBoardPage.CreatePeopleResourceFromTeamBoardTeamResourcesWidget(firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate, out id));
|
|
Assert.IsFalse(string.IsNullOrEmpty(id));
|
|
Assert.IsTrue(peopleResourcePage.CheckPeopleResource(id, firstName, lastName, employeeID, emailAddress, expenditureCategory, team, workWeek, employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
float plannedCapacityAfter = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
Assert.AreNotEqual(plannedCapacityBefore, -1);
|
|
Assert.AreNotEqual(plannedCapacityAfter, -1);
|
|
Assert.AreEqual(plannedCapacityBefore, plannedCapacityAfter);
|
|
}
|
|
|
|
[TestMethod, TestCategory("People Resources"), Timeout(testTimeout)]
|
|
[TestProperty("Edit People Resource with changing planned capacity", "1. Open people resource details page<br>2. Click the Edit page<br>3. Change planned capacity: Check (allows to keep planned capacity up to date after changes; when category or team changed, changes planned capacity for both categories / teams)<br>4. Click the Save button<br>5. Check the stored changes<br>5. Check changed planned capacity")]
|
|
public void EditPeopleResourceWithChangingPlannedCapacity()
|
|
{
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
string team = "MK";
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
string resourceId = "b354b34a-5eb9-4d49-aa88-27502a73e05c";
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = true;
|
|
bool permanent = false;
|
|
DateTime startDate = DateTime.Today.AddDays(-300);
|
|
DateTime endDate = DateTime.Today.AddDays(-240);
|
|
Assert.IsTrue(peopleResourcePage.EditPeopleResource(resourceId, "", "", "", "", "", "", "", employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
float plannedCapacityBefore = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
|
|
startDate = DateTime.Today.AddDays(GetIntNegative());
|
|
endDate = DateTime.Today.AddDays(GetIntPositive());
|
|
Assert.IsTrue(peopleResourcePage.EditPeopleResource(resourceId, "", "", "", "", "", team, "", employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
float plannedCapacityAfter = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
Assert.AreNotEqual(plannedCapacityBefore, -1);
|
|
Assert.AreNotEqual(plannedCapacityAfter, -1);
|
|
Assert.AreNotEqual(plannedCapacityBefore, plannedCapacityAfter);
|
|
}
|
|
|
|
[TestMethod, TestCategory("People Resources"), Timeout(testTimeout * 100)]
|
|
[TestProperty("Edit People Resource without changing planned capacity", "1. Open people resource details page<br>2. Click the Edit page<br>3. Change planned capacity: Uncheck (allows to keep planned capacity up to date after changes; when category or team changed, changes planned capacity for both categories / teams)<br>4. Click the Save button<br>5. Check the stored changes<br>5. Check changed planned capacity")]
|
|
public void EditPeopleResourceWithoutChangingPlannedCapacity()
|
|
{
|
|
Assert.IsTrue(loginPage.SignInAdmin());
|
|
string team = "MK";
|
|
string expenditureCategory = "Quality Assurance (zz-N/A)";
|
|
float plannedCapacityBefore = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
string resourceId = "7bcf0353-7381-43ab-8219-931788c370cc";
|
|
DateTime startDate = DateTime.Today.AddDays(GetIntNegative());
|
|
DateTime endDate = DateTime.Today.AddDays(GetIntPositive());
|
|
bool employeeStatusIsActive = true;
|
|
bool changePlannedCapacity = false;
|
|
bool permanent = false;
|
|
Assert.IsTrue(peopleResourcePage.EditPeopleResource(resourceId, "", "", "", "", "", "", "", employeeStatusIsActive, changePlannedCapacity, permanent, startDate, endDate));
|
|
float plannedCapacityAfter = capacityManagementPage.GetPlannedCapacity(team, expenditureCategory);
|
|
Assert.AreNotEqual(plannedCapacityBefore, -1);
|
|
Assert.AreNotEqual(plannedCapacityAfter, -1);
|
|
Assert.AreEqual(plannedCapacityBefore, plannedCapacityAfter);
|
|
}
|
|
|
|
}
|
|
}
|