Exemple #1
0
 public void WhenICommitTheBatch(Table batchRows)
 {
     try
     {
         if (batchRows.RowCount != 1)
         {
             throw new ArgumentException("Only provide one row to select.");
         }
         BBCRMHomePage.OpenRevenueFA();    //Open revenue functional area
         RevenueFunctionalArea.BatchEntry();
         var batchRow = batchRows.Rows[0]; // select only the first row of the batch
         if (batchRow.ContainsKey("Description") && batchRow["Description"] != null &&
             batchRow["Description"] != string.Empty)
         {
             batchRow["Description"] += uniqueStamp;           //The unique stamp is a series of numbers to keep constituents different from each other
         }
         BatchEntryPanel.SelectUncommittedBatch(batchRow);     //select uncommitted batch according to the table parameter
         if (BatchEntryPanel.UncommittedBatchExists(batchRow)) // if the selected batch exists
         {
             System.Threading.Thread.Sleep(2000);              //pause because otherwise the code runs so rapidly that the next line is not invoked in time
             BatchEntryPanel.SelectSectionDatalistRow(batchRow, "Uncommitted batches");
             BatchEntryPanel.CommitSelectedBatch();            //commit the batch
         }
         else
         {
             throw new ArgumentException(String.Format("Uncommitted batch '{0}' does not exist", batchRow.Values));
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error: could not commit the batch. " + ex.Message);
     }
 }
Exemple #2
0
        public void WhenICommitTheBatch(Table batchRows)
        {
            if (batchRows.RowCount != 1)
            {
                throw new ArgumentException("Only provide one row to select.");
            }
            BBCRMHomePage.OpenRevenueFA();
            RevenueFunctionalArea.BatchEntry();
            // reset datalist, if needed
            string resetButtonPath = XpathHelper.xPath.VisiblePanel + "//button[text()='Reset']";

            // ensure that we can find the either enabled or disabled reset button
            try
            {
                BaseComponent.GetEnabledElement(resetButtonPath, 5);
                BaseComponent.WaitClick(resetButtonPath);
            }
            catch
            {
                // eat the exception
            }
            //clear filters button
            string clearFiltersPath = XpathHelper.xPath.VisiblePanel + "//button[text()='Clear all filters']";

            // Click on the button if it is enabled
            try
            {
                BaseComponent.GetEnabledElement(clearFiltersPath, 5);
                BaseComponent.WaitClick(clearFiltersPath);
            }
            catch
            {
                //eat exception as button is not enabled
            }

            var batchRow = batchRows.Rows[0];

            if (batchRow.ContainsKey("Description") && !string.IsNullOrEmpty(batchRow["Description"]))
            {
                batchRow["Description"] += uniqueStamp;
            }
            try
            {
                BatchEntryPanel.SelectUncommittedBatch(batchRow);
            }
            catch
            {
                BatchEntryPanel.SelectUncommittedBatch(batchRow);
            }
            BatchEntryPanel.CommitSelectedBatch();
            ThenTheBatchCommitsWithoutErrorsOrExceptions();
        }
Exemple #3
0
        public void WhenICommitTheBatch(Table batchRows)
        {
            if (batchRows.RowCount != 1)
            {
                throw new ArgumentException("Only provide one row to select.");
            }
            BBCRMHomePage.OpenRevenueFA();
            RevenueFunctionalArea.BatchEntry();
            var batchRow = batchRows.Rows[0];

            if (batchRow.ContainsKey("Description") && batchRow["Description"] != null &&
                batchRow["Description"] != string.Empty)
            {
                batchRow["Description"] += uniqueStamp;
            }
            BatchEntryPanel.SelectUncommittedBatch(batchRow);
            BatchEntryPanel.CommitSelectedBatch();
        }