Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@smarenich
Created August 16, 2016 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarenich/4a0e2e2503c5850ce83f538e2ecfb29f to your computer and use it in GitHub Desktop.
Save smarenich/4a0e2e2503c5850ce83f538e2ecfb29f to your computer and use it in GitHub Desktop.
public class Test1 : Check
{
//Add your test-specific logic in the method below for every test.
public override void Execute()
{
PxLogin.LogIn("admin", "123");
//Test case 1
JournalEntry journalEntry = new JournalEntry();
journalEntry.OpenScreen();
//Test case 2
journalEntry.Insert();
journalEntry.Summary.BranchID.Select("MAIN");
journalEntry.Summary.LedgerID.Select("ACTUAL");
journalEntry.Summary.Description.Type("Test journal entry 1");
journalEntry.Details.New();
journalEntry.Details.Row.AccountID.Select("101020");
journalEntry.Details.Row.AccountID.VerifyError("Denominated GL Account currency is different from transaction currency.");
journalEntry.Details.Row.AccountID.Type("100000");
journalEntry.Details.Row.AccountID_Account_description.VerifyEquals("Petty Cash USD");
journalEntry.Details.Row.ProjectID.Select("X");
journalEntry.Details.Row.CuryDebitAmt.Type(100);
journalEntry.Details.New();
journalEntry.Summary.CuryDebitTotal.VerifyError("Batch is out of balance, please review.");
journalEntry.Details.Row.AccountID.Select("101000");
journalEntry.Details.Row.ProjectID.VerifyEquals("X");
journalEntry.Details.Row.CuryCreditAmt.Type(0);
journalEntry.VerifyAlert(journalEntry.Save, "Error #13: Inserting 'GL Batch' record raised one or more errors. Please review.");
journalEntry.Details.ActivateRow(2);
journalEntry.Details.Row.CuryCreditAmt.Type(100);
journalEntry.Save();
//Test case 3
journalEntry.Release();
journalEntry.Summary.AutoReverseCopy.VerifyEquals(false);
//Test case 4
journalEntry.ReverseBatch();
journalEntry.Summary.AutoReverseCopy.VerifyEquals(true);
journalEntry.Summary.Description.Type("Test journal entry 2");
journalEntry.Save();
//Test case 5
ReleaseTransactionsGl releaseTransactionsGl = new ReleaseTransactionsGl();
releaseTransactionsGl.OpenScreen();
releaseTransactionsGl.Details.VerifyRowsCount(1);
releaseTransactionsGl.Details.Row.Selected.SetTrue();
releaseTransactionsGl.Process();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment