/*
*/
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
2. Click 'Add Company' button
3. Fill the following fields:
Company Name
4. Select Clients:
MK
5. Select Views:
Front Office
4. Click Save
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
2. Click Delete button
3. Check warning message:
You are about to delete the.Are you sure you want to delete it?
4. Click Delete button
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
2. Click Edit button
3. Change the following fields:
Company Name
4. Add the following client:
Nelnet - Loan Servicing Operations
5. Add the following viewa
Network
Systems
6. Click Save
7. Open the company details
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));
}
}
}