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

78 lines
4.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Что такое GLAccount?
Что-то вроде структурного подразделения внутри компании. Ни на какие бизнес процессы влияния не оказывает, используется просто как классификатор.
Number of Expenditures - это как раз случай использования его как классификатора.
Из БД достаются все ExpenditureCategory у которых GLAccountId = GLAccount.Id.
На эту таблицу также ссылается Client.GLAccountId.
Смысл в обоих случаях одинаковый, клиенты (Client) с которыми работает подразделение GLAccount "1й отдел"
или должности (ExpCat) которые есть в подразделении GLAccount "1й отдел"
*/
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace Prevu
{
[TestClass]
public class GLAccounts : 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("GL Accounts"), Timeout(testTimeout)]
[TestProperty("Create GL Account", "1. Open the GL Accounts page<br>2. Click 'Add GL Account' button<br>3. Fill the following fields:<br> Account Name<br> Account Number<br>4. Click Save<br>5. Find created GL account and check stored data")]
public void CreateGLAccount()
{
Assert.IsTrue(loginPage.SignInAdmin());
Assert.IsTrue(glAccountsPage.OpenGLAccounts());
string id = "";
string glAccountName = string.Format("Test GL Account {0}", tempId);
string glAccountNumber = tempId;
Assert.IsTrue(glAccountsPage.CreateGLAccount(glAccountName, glAccountNumber, out id));
Assert.IsFalse(string.IsNullOrEmpty(id));
Assert.IsTrue(glAccountsPage.CheckGLAccount(id, glAccountName, glAccountNumber));
}
[TestMethod, TestCategory("Smoke Test"), TestCategory("GL Accounts"), Timeout(testTimeout)]
[TestProperty("Delete GL Account", "1. Find a GL account<br>2. Click Delete button<br>3. Check warning message:<br> You are about to delete the < Account Name >.Are you sure you want to delete it?<br>4. Click Delete button<br>5. Make sure that GL account is deleted")]
public void DeleteGLAccount()
{
Assert.IsTrue(loginPage.SignInAdmin());
Assert.IsTrue(glAccountsPage.OpenGLAccounts());
string id = "";
string glAccountName = string.Format("Test GL Account {0}d", tempId);
string glAccountNumber = string.Format("{0}d", tempId);
Assert.IsTrue(glAccountsPage.CreateGLAccount(glAccountName, glAccountNumber, out id));
Assert.IsFalse(string.IsNullOrEmpty(id));
Assert.IsTrue(glAccountsPage.DeleteGLAccount(id, glAccountName));
}
[TestMethod, TestCategory("Smoke Test"), TestCategory("GL Accounts"), Timeout(testTimeout)]
[TestProperty("Edit GL Account", "1. Find a GL account<br>2. Click Edit button<br>3. Change the following fields:<br> Account Name<br> Account Number<br>4. Click Save<br>5. Open the GL account details<br>6. Check edited field values")]
public void EditGLAccount()
{
Assert.IsTrue(loginPage.SignInAdmin());
Assert.IsTrue(glAccountsPage.OpenGLAccounts());
string id = "";
string glAccountName = string.Format("Test GL Account {0}", tempId);
string glAccountNumber = tempId;
Assert.IsTrue(glAccountsPage.CreateGLAccount(glAccountName, glAccountNumber, out id));
Assert.IsFalse(string.IsNullOrEmpty(id));
glAccountName = string.Format("Test GL Account {0} E", tempId);
glAccountNumber = string.Format("{0}-1", tempId);
Assert.IsTrue(glAccountsPage.EditGLAccount(id, glAccountName, glAccountNumber));
}
}
}