EnVisageOnline/Main/TestSystem/Prevu/Tests/Companies.cs

77 lines
3.8 KiB
C#

/*
*/
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace Prevu
{
[TestClass]
public class Companies : 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("Companies"), Timeout(testTimeout)]
[TestProperty("Create Company", "1. Open the Companies page<br>2. Click 'Add Company' button<br>3. Fill the following fields:<br> Company Name<br>4. Select Clients:<br> MK<br>5. Select Views:<br> Front Office<br>4. Click Save<br>5. Find created company and check stored data")]
public void CreateCompany()
{
Assert.IsTrue(loginPage.SignInAdmin());
Assert.IsTrue(companiesPage.OpenCompanies());
string id = "";
string companyName = string.Format("Company {0}", tempId);
string[] clients = new string[1] { "MK" };
string[] views = new string[1] { "Front Office" };
Assert.IsTrue(companiesPage.CreateCompany(companyName, clients, views, out id));
Assert.IsFalse(string.IsNullOrEmpty(id));
Assert.IsTrue(companiesPage.CheckCompany(id, companyName, clients, views));
}
[TestMethod, TestCategory("Smoke Test"), TestCategory("Companies"), Timeout(testTimeout)]
[TestProperty("Delete Company", "1. Find a company<br>2. Click Delete button<br>3. Check warning message:<br> You are about to delete the<Company>.Are you sure you want to delete it?<br>4. Click Delete button<br>5. Make sure that company is deleted")]
public void DeleteCompany()
{
Assert.IsTrue(loginPage.SignInAdmin());
Assert.IsTrue(companiesPage.OpenCompanies());
string id = "";
string companyName = string.Format("Company {0}d", tempId);
string[] clients = new string[2] { "MK", "Nelnet - Loan Servicing Operations" };
string[] views = new string[3] { "Front Office", "Network", "Systems" };
Assert.IsTrue(companiesPage.CreateCompany(companyName, clients, views, out id));
Assert.IsFalse(string.IsNullOrEmpty(id));
Assert.IsTrue(companiesPage.DeleteCompany(id, companyName));
}
[TestMethod, TestCategory("Smoke Test"), TestCategory("Companies"), Timeout(testTimeout)]
[TestProperty("Edit Company", "1. Find a company<br>2. Click Edit button<br>3. Change the following fields:<br> Company Name<br>4. Add the following client:<br> Nelnet - Loan Servicing Operations<br>5. Add the following viewa<br> Network<br> Systems<br>6. Click Save<br>7. Open the company details<br>8. Check edited field values")]
public void EditCompany()
{
Assert.IsTrue(loginPage.SignInAdmin());
Assert.IsTrue(companiesPage.OpenCompanies());
string id = "";
string companyName = string.Format("Company {0}", tempId);
string[] clients = new string[1] { "MK" };
string[] views = new string[1] { "Front Office" };
Assert.IsTrue(companiesPage.CreateCompany(companyName, clients, views, out id));
Assert.IsFalse(string.IsNullOrEmpty(id));
companyName = string.Format("Company {0} E", tempId);
clients = new string[1] { "Nelnet - Loan Servicing Operations" };
views = new string[2] { "Network", "Systems" };
Assert.IsTrue(companiesPage.EditCompany(id, companyName, clients, views));
}
}
}